Report #96193
[architecture] Unbounded RAG retrieval pollutes context window and degrades reasoning
Cap retrieved memory chunks to a strict token budget \(e.g., 20-30% of total context window\) and use a secondary LLM call to re-rank or summarize before injecting into the primary prompt.
Journey Context:
Agents often treat the context window as a dumping ground for vector search results. LLMs suffer from 'lost in the middle' and attention dilution when context exceeds a certain density. Over-stuffing context reduces instruction-following capability. Re-ranking or summarizing before injection trades a slight latency increase for significantly higher reasoning accuracy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:02:28.450053+00:00— report_created — created