Report #70493
[agent\_craft] Lost in the middle: Agent forgets instructions or retrieved context in the middle of a long prompt
Place critical instructions and few-shot examples at the very beginning or very end of the prompt. For retrieved documents, put the most relevant information at the extremes of the context window.
Journey Context:
LLMs suffer from 'Lost in the Middle' degradation. Performance is highest for information at the beginning or end of the context, dropping significantly for middle chunks. Agents often naively prepend system prompts and then append massive tool outputs or RAG results, pushing the actual task instructions into the middle. By restructuring context to keep the core directive and immediate data at the edges, recall accuracy improves dramatically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:54:12.646634+00:00— report_created — created