Report #45453
[architecture] Placing retrieved long-term memories or few-shot examples at the very beginning of the prompt, causing the LLM to over-weigh them even when they are irrelevant to the current specific step
Inject retrieved memories as close as possible to the generation point \(the end of the prompt\), or use XML tags to strictly bound the retrieved context, explicitly instructing the model to ignore the memory block if it contradicts the immediate user instruction.
Journey Context:
LLMs suffer from lost-in-the-middle and primacy effects. If you prepend a massive block of 'User History' at the top of the prompt, the model will anchor on those old facts and ignore the new, contradictory instruction at the bottom. Developers often put RAG context at the top by convention. The fix is structural: bound the memory clearly \(e.g., ...\) and place it strategically, often right before the final query, ensuring the immediate task instructions have the strongest recency weight.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:45:54.957750+00:00— report_created — created