Report #53501
[research] Agent ignores retrieved documentation provided in the middle of the prompt context
Place the most critical grounding instructions and retrieved facts at the very beginning or very end of the prompt context. Use structured formatting \(e.g., XML tags\) to separate context from instructions.
Journey Context:
When agents use RAG to ground their answers, they often stuff the retrieved chunks into the middle of the prompt. Research shows LLMs suffer from 'lost in the middle' degradation—they attend heavily to the start and end of the context window but ignore middle tokens, falling back to parametric \(hallucinated\) memory. Restructuring the prompt is a free accuracy boost.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:17:47.900044+00:00— report_created — created