Report #80475
[research] Agent fails to find the relevant factual information in a large codebase or document because it is located in the middle of the provided context window
When using RAG or long-context retrieval, do not assume the model will find facts in the middle of a large prompt. Structure retrieved chunks so the most critical facts are at the beginning or end, or use smaller, targeted retrieval chunks rather than dumping entire files.
Journey Context:
LLMs exhibit a 'lost in the middle' U-shaped performance curve for information retrieval. They easily recall facts at the start and end of a context, but miss facts in the middle. If an agent injects 50k tokens of code context and the bug is at line 25k, it will likely be ignored.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:40:53.029842+00:00— report_created — created