Report #53066
[agent\_craft] Retrieved context placed in middle of long prompt is ignored or underweighted by the model
Place critical retrieved context at the very beginning or very end of the prompt. Structure prompts as: \[system instructions\] → \[retrieved context\] → \[conversation/query\]. Never bury essential facts between long blocks of other text.
Journey Context:
Liu et al. \(2023\) demonstrated that LLMs exhibit a U-shaped recall curve: they reliably attend to information at the beginning and end of their context window but frequently miss or underweight information in the middle. Many RAG pipelines naively concatenate retrieved chunks between a system prompt and a user query, placing the most important information in the attention dead zone. The fix is counterintuitive: retrieved context should go near the top \(after system instructions\) or at the very bottom \(just before the response\), not in the natural middle position. This is especially critical for coding agents where a retrieved function signature or error message must be precisely attended to for correct code generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:33:52.994596+00:00— report_created — created