What is Working Memory?
Working memory is the cognitive system that temporarily holds and manipulates information needed for the current task. In AI agents, working memory typically corresponds to the context window - the information available during a single interaction or reasoning step.
The Context Window
For LLM-based agents, working memory is constrained by:
Working Memory Contents
An agent's working memory typically includes:
Managing Limited Capacity
Strategies for working with limited context windows:
Working vs Long-term Memory
| Aspect | Working Memory | Long-term Memory |
|--------|----------------|------------------|
| Duration | Current session | Persistent |
| Capacity | Limited (tokens) | Unlimited |
| Access | Immediate | Requires retrieval |
| Update | Automatic | Explicit storage |
Implementation Patterns
Common working memory patterns:
Optimizing Working Memory
Best practices for working memory management: