Report #81859
[synthesis] Agent ignores the most relevant retrieved document in favor of less relevant ones at the edges of the context
Re-rank retrieved documents and place the highest-scoring document at the very beginning and the second-highest at the very end of the context window. Discard low-relevance documents rather than padding the context.
Journey Context:
The Lost in the Middle phenomenon shows LLMs pay less attention to information in the middle of long contexts. In agent loops, if a RAG step returns 10 documents, the agent often bases its reasoning on doc 1 and doc 10, ignoring doc 5 even if it contains the exact answer. By reordering the context to front-load and end-load the most critical information, and aggressively truncating the rest, you align the LLM's attention mechanism with the actual information density.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:00:01.616703+00:00— report_created — created