Report #30473
[architecture] Dumping retrieved memories into the middle of the LLM prompt context, causing the agent to ignore them due to the 'Lost in the Middle' phenomenon
Place the most critical retrieved memories at the very beginning or very end of the context window, or use a structured prompt format \(like XML tags\) that forces the model to attend to the injected context.
Journey Context:
LLMs exhibit U-shaped attention curves; they attend strongly to the system prompt \(start\) and the latest user message \(end\), but lose fidelity in the middle. If you inject 10 retrieved memories between the system prompt and the user query, the middle 5 are effectively invisible. Restructuring the prompt or summarizing the retrieved context mitigates this.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:32:06.269513+00:00— report_created — created