Agent memory is how an AI agent retains and retrieves context beyond a single prompt. It spans from immediate conversation history to persistent knowledge that survives across sessions.
Types of agent memory
| Type | Scope | Example |
|---|---|---|
| Working memory | Current loop / conversation | Messages and tool results in the active thread |
| Session memory | Single user session | Preferences stated earlier in the conversation |
| Long-term memory | Across sessions | User profile, past interactions, learned facts |
| External memory | Retrieved on demand | Documents, databases, vector stores (often via RAG) |
Why memory matters
Without memory, every interaction starts from zero. An agent that forgets a tenant's prior maintenance history will treat a recurring leak as a new issue. Memory lets agents build context, avoid repeating questions, and make better decisions over time.
Memory design tradeoffs
- More context = better decisions but higher cost and risk of hitting context window limits
- Persistent memory requires storage, privacy controls, and retrieval strategy
- What to remember is an architecture decision — storing everything creates noise; storing too little loses critical context
Related reading
See RAG for how retrieval augments agent memory with external knowledge.