Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

From JSON to Vector Search: What I Learned Storing Structured User Data for AI

Описание и применение

В статье описывается, как в приложении SpendWise интегрировать структурированные данные пользователя в векторную базу для семантического поиска, сохраняя при этом традиционную реляционную схему для точных запросов.

Задача

How to make structured user data retrievable for an AI when the user asks context‑dependent questions?

Результат

The hybrid architecture allowed SpendWise to provide contextually relevant user information to the LLM without over‑loading the vector store with data that is better served by SQL queries.

Рабочий процесс

  • Collect structured user data during onboarding
  • Convert relevant fields to a natural‑language paragraph
  • Generate embeddings with an embedding model
  • Store embeddings in a vector database with metadata linking back to the original JSON
  • When a user asks a question, determine if it requires semantic similarity or exact match
  • If semantic, query vector store for relevant context
  • If deterministic, query PostgreSQL directly
  • Feed retrieved context to the LLM for response

Доказательства

When we were building SpendWise, one of the things we wanted was pretty simple: The AI should know something about the user before answering them.

Источник

The AI might need context such as: {"investment_experience":"Beginner","risk_preference":"Moderate","financial_goal":"Buy a house in 5 years"}

Источник

If I need: expenses > ₹10,000 ... SQL is extremely good at that.

Источник

  • Дата записи: 2026-10-06T19:41:01.743Z