Report #37008
[research] RAG system hallucinates answers instead of using relevant documents placed in the middle of the context window
Re-rank retrieved documents so the most relevant are placed at the very beginning and very end of the prompt context. Limit context window size to only strictly necessary retrieved chunks.
Journey Context:
Agents often stuff the context window with top-k retrieved documents. Research shows LLMs suffer from 'lost-in-the-middle' degradation—they reliably use information at the start and end of the context but ignore or forget middle context, leading to hallucinations when the answer is buried there. Naive chunk ordering causes high failure rates on multi-hop reasoning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:35:39.775424+00:00— report_created — created