Report #31456
[frontier] Naive chunk-based RAG returns irrelevant context causing agent hallucination and drift
Implement Contextual Retrieval using Contextual Embeddings \(generating context-specific summaries for chunks before embedding\) and Contextual BM25. Combine with an agentic reranking step.
Journey Context:
Naive RAG chunks documents and embeds them, losing the broader document context. When an agent retrieves a chunk, it lacks situational awareness, leading to out-of-context answers. Contextual retrieval prepends a brief, LLM-generated summary of the entire document to each chunk before embedding. This makes the embedding context-aware, drastically improving retrieval precision for complex agent queries without requiring massive vector DB overhauls.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T07:11:09.419571+00:00— report_created — created