technique

Contextual retrieval

Contextual retrieval prepends a chunk's surrounding context (document title, section, summary) to each chunk before embedding, dramatically improving retrieval relevance on long documents.

Introduced by Anthropic in 2024 and now standard in 2026 RAG stacks, contextual retrieval addresses a core RAG failure: a chunk that says "the company recorded record revenue" is ambiguous without knowing which company and which quarter. The fix: prepend a model-generated summary of the chunk's surrounding context ("From Acme Corp's Q3 2025 earnings call: ...") before embedding. Empirically reduces retrieval failure rates by 35-67% on long-document corpora vs naive chunking. Pairs naturally with hybrid (vector + BM25) and re-ranking for state-of-the-art retrieval in 2026.

When to use contextual retrieval

Common mistakes

FAQ

What is contextual retrieval?

Contextual retrieval prepends a chunk's surrounding context (document title, section, summary) to each chunk before embedding, dramatically improving retrieval relevance on long documents.

When should I use contextual retrieval?

RAG over long structured documents (earnings calls, legal filings, books). Multi-document corpora where chunks lose meaning without context.

What are the most common mistakes with contextual retrieval?

Generating context with a weak model — degrades the signal. Forgetting that re-embedding the corpus is required when the contextualisation prompt changes.

Sources

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/contextual-retrieval.md.