★ OverviewIntermediate11 min
Agent Memory Systems
Short-term, long-term, and episodic memory for agents — how to make your agent remember context across conversations and learn from experience.
Quick Reference
- →Short-term memory = conversation history in the graph state (messages list), lost when the thread ends
- →Long-term memory = persisted key-value store (LangGraph Store API) that survives across threads
- →Episodic memory = summaries of past interactions stored as searchable documents for retrieval
- →Use MemorySaver for checkpointing thread state; use Store for cross-thread user preferences and facts
- →Token management: summarize or trim old messages to stay within the context window budget
The Three Memory Types
Three tiers of agent memory: ephemeral buffers, cross-session stores, and permanent episodic recall
| Type | Scope | Persistence | Implementation | Example |
|---|---|---|---|---|
| Short-term | Current conversation | Thread lifetime only | MessagesState (messages list) | Last 10 messages in this chat |
| Long-term | Across all conversations | Permanent (Store API) | store.put() / store.search() | User prefers dark mode, speaks Spanish |
| Episodic | Across conversations | Permanent (vectorized) | Embedded summaries in vector store | Last week user asked about refund policy |