# Contextual Retrieval

> Each chunk gets a short note that says where it came from.

**Field:** Artificial Intelligence  
**Category:** Retrieval & Search  
**Also known as:** Contextual Embeddings, Contextual Chunk Headers, Contextual BM25

## Think of it like

It is like writing the book name on each torn page. Each page still makes sense.

## Definition

Contextual retrieval adds a short note to each chunk before it is indexed. A model reads the whole document and writes one or two lines saying where the chunk fits. A chunk that says "sales grew 3%" becomes "From Acme's 2023 report: sales grew 3%". The note goes into both the embedding and the keyword index. Chunks that made no sense alone can now be found.

## Example

Anthropic tested it in 2024. Adding notes cut failed searches by 49%, and by 67% with reranking on top.

## Why it matters

Chunks lose their context when cut out. This puts the context back, so fewer facts get lost.

## Common mistake

Forgetting the cost. A model has to read the document once per chunk, though prompt caching helps.

## Three principles

- **Note each chunk.** Where it fits in the document.
- **Before indexing.** Into vectors and keywords both.
- **Fewer misses.** Lonely chunks become findable.

## Related terms

- [Chunking (RAG)](https://learn.benibix.com/term/ai/chunking)
- [Embedding (AI)](https://learn.benibix.com/term/ai/embedding)
- [Okapi BM25](https://learn.benibix.com/term/ai/okapi-bm25)
- [Reranking](https://learn.benibix.com/term/ai/reranking)
- [Prompt Caching](https://learn.benibix.com/term/ai/prompt-caching)

![Top, a bare chunk reading sales grew 3% over the last quarter, with a question mark asking which company and which year. Bottom, the same chunk with a note added in front, from Acme's 2023 report, second quarter, and a tick because a search can now find it.](https://learn.benibix.com/diagrams/ai3-contextual-chunk.svg)

---

Source: https://learn.benibix.com/term/ai/contextual-retrieval
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
