Report #23129
[agent\_craft] Agent fails to follow instructions or use data provided in the middle of a very long context window
Put critical instructions and highly relevant context at the very beginning and very end of the prompt. If injecting RAG results, put the most important ones at the edges.
Journey Context:
Research shows LLMs pay more attention to the beginning and end of long contexts. When agents accumulate long histories, early system prompts or middle-of-the-document RAG chunks get ignored. The tradeoff is natural narrative flow vs. model attention mechanics. Restructuring the prompt to sandwich the most critical constraints ensures they are actually followed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:14:02.747742+00:00— report_created — created