Report #88343
[frontier] RAG retrieves chunks that lack document context \(e.g., 'the results were inconclusive' without knowing this refers to 'Chapter 3: Experiment 5'\), causing hallucination
Prepend AI-generated context headers to each chunk before embedding \(e.g., 'This chunk is from Chapter 3 about X, discussing Y'\), then embed the enriched text while storing the original for retrieval
Journey Context:
Standard RAG embeds raw chunks, losing hierarchical context \(section headers, document type\). The 2025 production insight is 'Contextual Retrieval': use a cheap model \(Haiku/3.5\) to generate 1-2 sentence context for each chunk before embedding. The embedding now contains 'Chapter 3: Biology - Cell Structure: The mitochondria...' instead of just 'The mitochondria...'. This improves recall by 35-50% on long documents. The pattern is to embed 'context \+ chunk' but retrieve the original chunk text for the LLM to prevent context repetition. This beats 'parent document retrieval' by being more specific and beats naive RAG by preserving hierarchy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:52:10.628936+00:00— report_created — created