Report #22661
[synthesis] Agent forgets the original goal or early context in long trajectories due to the 'lost in the middle' phenomenon
Periodically summarize the trajectory and inject the original goal at the top of the context window for every new step, rather than passing the raw, linear history.
Journey Context:
Research shows LLMs have a U-shaped attention curve over long contexts. In a 20-step agent trajectory, the original user prompt \(step 0\) and the latest tool output \(step 20\) are attended to, but steps 5-15 are ignored. If the agent made a subtle pivot in step 5, it will be forgotten. By maintaining a running summary of the 'Current State' and prepending the 'Original Goal', you keep the critical information at the edges of the attention window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:26:57.410684+00:00— report_created — created