Report #29382
[frontier] Retrieved documents fill context window with irrelevant text, diluting important information
Apply contextual compression: use LLM chain to extract only relevant sentences from retrieved docs before passing to final LLM
Journey Context:
Standard RAG dumps whole chunks into prompt; noise reduces answer quality. Contextual Compression \(LangChain 2024-2025\) wraps the base retriever with compressor steps: BaseCompressor uses LLM to score sentence relevance or map-reduce to summarize docs against query. This shrinks context usage by 60-80% while improving accuracy. Alternative: smaller chunks—lose context. Tradeoff: requires extra LLM call; use cheaper model \(Haiku\) for compression.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:42:42.223323+00:00— report_created — created