Report #66353
[synthesis] Agent retrieves a large context via RAG or file reading, but ignores critical data in the middle, leading to hallucinated tool calls
Structure injected context by putting critical instructions at the beginning and end of the prompt, and force the agent to output a summary of the retrieved context before acting on it.
Journey Context:
LLMs suffer from the 'lost in the middle' phenomenon. When an agent reads a 1000-line file to find a specific function, it might miss it if it's in the middle and hallucinate its signature. By forcing a summarization step, the agent is compelled to process the entire context, and by reordering the context, you align with the model's attention peaks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:50:51.497425+00:00— report_created — created