Files
lancedb/docs/web/tutorials/agents/contextual-rag.mdx
T
Brendan Clement 198812fd53 docs: clean up prose flagged by the shared Vale rules (#4596)
The existing docs have 254 findings from our shared Vale rules.
Contributors would otherwise inherit these when editing the same lines.

Clean up the prose across 80 pages: correct product names and a repeated
word, simplify a few phrases, and replace dashes with punctuation that
fits each sentence. The pinned Vale scan now reports zero findings, with
no suppressions.
2026-10-19 13:45:55 -07:00

25 lines
993 B
Plaintext

---
title: "Contextual RAG"
sidebarTitle: "Contextual RAG"
description: "Prepend LLM-generated context to each chunk before embedding it."
---
Addresses the "lost in the middle" problem in retrieval. An LLM generates a
succinct piece of context for each document chunk, which is prepended to the
chunk before embedding, so a chunk carries enough surrounding meaning to be
retrieved for the right queries.
<Note>
This example is a runnable notebook in the
[vectordb-recipes](https://github.com/lancedb/vectordb-recipes) repository rather than a page here.
</Note>
<CardGroup cols={2}>
<Card title="Open in Colab" icon="google" href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Contextual-RAG/Anthropic_Contextual_RAG.ipynb">
Run it end to end in the browser.
</Card>
<Card title="View on GitHub" icon="github" href="https://github.com/lancedb/vectordb-recipes/tree/main/examples/Contextual-RAG">
Read the source.
</Card>
</CardGroup>