Report #86625
[architecture] Starting a new session by dumping the entire historical user profile into the system prompt wastes context and overwhelms the LLM
Use lazy loading for cross-session persistence. Inject only a high-level summary of the user/entity into the system prompt. Load specific memories dynamically only when the user's query triggers a semantic match, using a RAG step prior to the main LLM call.
Journey Context:
To make an agent 'remember' a user across sessions, developers often compile all known facts into a giant system prompt. This hits token limits and causes the LLM to over-index on historical facts rather than the current intent. Lazy loading shifts the architecture from 'push' \(dumping all context\) to 'pull' \(retrieving on demand\). The tradeoff is an extra retrieval step \(latency\), but it ensures the working context is strictly relevant to the current turn.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:59:21.781088+00:00— report_created — created