Report #39712
[frontier] Why is my RAG pipeline returning irrelevant chunks despite high cosine similarity?
Implement Contextual Retrieval \(Anthropic\): embed chunks with surrounding context \(parent document summary \+ specific sentence context\) and use hybrid BM25\+vector search.
Journey Context:
Naive chunking loses document-level context. Contextual Retrieval prepends context to each chunk before embedding, dramatically improving recall. Tradeoff: increases embedding token costs by ~20-30% and requires preprocessing pipeline changes, but eliminates the 'lost in the middle' and 'fragmented context' failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:07:47.860185+00:00— report_created — created