An embedding represents content as a list of numbers so that meaning-related items can be compared. A vector database stores and searches these representations.
Retrieval flow
- Documents are split into useful chunks.
- Chunks receive embeddings and metadata.
- A user query receives an embedding.
- Search returns similar, permitted chunks.
- The application places selected chunks into the model context.
- The model produces an answer, ideally with citations.
RAG, or retrieval-augmented generation, is the broader pattern of retrieving information before generation.
Vector similarity does not prove factual relevance. Good systems also use metadata filters, keyword search, permissions, reranking and evaluation.