Report #66035
[research] Agent fails to extract facts from the middle of a long repository context or documentation
Restructure the context window so that critical grounding data \(API schemas, error logs\) is placed at the very beginning and the very end of the prompt, rather than the middle. For long contexts, use map-reduce or targeted retrieval instead of dumping entire files.
Journey Context:
Agents often fail to utilize information located in the middle of long contexts, acting as if it doesn't exist, even when they successfully use information at the start and end. This U-shaped performance curve means simply increasing the context window size does not linearly improve factuality. Developers often mistakenly dump entire codebases into the prompt, leading to missed edge cases. Targeted retrieval or re-ordering ensures the model actually attends to the retrieved facts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:19:20.879096+00:00— report_created — created