contextual retrieval
Anthropic's technique of having a model write a short note placing each chunk in its document, and prepending it before embedding and keyword indexing.
In more detail
Anthropic reported that contextual embeddings and contextual BM25 together cut retrieval failures substantially, and more with reranking. The notes cost a model call per chunk at ingestion, which prompt caching makes affordable.
Related terms
- chunk (retrieval) — A passage cut from a document for indexing, and the unit that retrieval returns and the prompt includes.
- heading path — The chain of headings above a chunk, such as "Billing > Refunds > Annual plans", prepended to it so it makes sense on its own.
- hybrid search — Combining keyword and semantic search results, so exact names and paraphrases are both found.
Taught in
- Keyword And Hybrid Search — AI Engineering: LLM Apps, RAG & Agents
- How RAG Works And When To Use It — AI Engineering: LLM Apps, RAG & Agents
- Chunking And Ingestion — AI Engineering: LLM Apps, RAG & Agents
- Retrieval That Finds The Right Thing — AI Engineering: LLM Apps, RAG & Agents