Problem
Agents forget. Without somewhere to put it, everything a user said in a previous session is gone, and each conversation starts from zero. The fix is durable context the agent can write to as it learns and read from on every turn, so it builds on prior interactions instead of treating each one as isolated. Two kinds of context are worth keeping:- Working context - unstructured insights drawn from conversations: preferences, tone, recurring topics, and decisions. Updated after each interaction.
- Durable context - stable facts about the user: profile, account tier, identifiers, long-standing preferences. Changes rarely.
The capture and recall loop
On each turn the agent recalls the most relevant context with a query, grounds its response in it, then captures new insights by writing them back. Over time the index becomes a compounding record the agent can draw on.Code walkthrough (JavaScript)
Result
Agents recall user preferences and prior context reliably, and each conversation adds to what they know rather than starting over.Related
Live-call context
Short-term + long-term context during a call.
Cross-agent handoff
Carry context across agents and channels.