Report #103897
[architecture] Agent tries to stuff full conversation history into the LLM context window
Treat the context window as a scarce cache, not a log file. Use a tiered memory hierarchy: working context \(recent turns\) → semantic memory \(embedded facts\) → episodic storage \(raw traces\). Always retrieve, never append the full history.
Journey Context:
The obvious first implementation appends every exchange to the prompt. It works for demos, then degrades once history exceeds the model's context limit, latency spikes, costs explode, and older turns drown the system prompt. The fix is memory-first design: decide up front what belongs in context and fetch it selectively. LangChain's memory abstractions and MemGPT's virtual-context paging both converge on this hierarchy. The hard part is not retrieval, it is eviction: what stays in working memory and what gets summarized or embedded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:53:34.882458+00:00— report_created — created