How RAG and vector search work
Retrieval-augmented generation (RAG) lets a model answer from your data. Documents are split into passages and converted into embeddings, which are stored in a vector index. When a user asks a question, the system retrieves the most relevant passages and passes them to the model, which writes an answer based on them.
For the index we usually use PostgreSQL with pgvector, which keeps data near the rest of the product, or a managed vector database when scale or features call for it. AI services are often written in Python with FastAPI, next to a Next.js and PostgreSQL application. See the tech stack page.
