Agent Architecture/Agent Memory
★ 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

Agent Memory TypesShort-term MemoryConversation buffer within a single threadscope: current session · persistence: ephemeralEphemeralLong-term MemoryCross-thread store shared across conversationsscope: all threads · persistence: session+SessionEpisodic MemoryPast interactions, outcomes, and learned patternsscope: historical · persistence: permanentPermanentpersistence increases

Three tiers of agent memory: ephemeral buffers, cross-session stores, and permanent episodic recall

TypeScopePersistenceImplementationExample
Short-termCurrent conversationThread lifetime onlyMessagesState (messages list)Last 10 messages in this chat
Long-termAcross all conversationsPermanent (Store API)store.put() / store.search()User prefers dark mode, speaks Spanish
EpisodicAcross conversationsPermanent (vectorized)Embedded summaries in vector storeLast week user asked about refund policy