Retrieval
AIRetrieval is the step of fetching relevant documents or chunks for a given query. In RAG, retrieval runs first: the query is embedded, vector search (and optionally reranking) returns the top chunks, and those are passed to the LLM as context for completion.
Retrieval in DocLD
- Embed query — Same embedding model as document chunks.
- Search — Vector search (e.g., top-k) in Pinecone, optionally with metadata filters.
- Rerank — Optional reranking to improve order.
- Pass to LLM — Retrieved text is used as context for the answer with citations.
Retrieval quality depends on chunking, embedding, and knowledge base scope.
Related Concepts
Retrieval is the fetch phase of RAG. It uses vector search, semantic search, top-k, and optionally reranking. Results feed citation and completion.