LangGraph/Persistence
Intermediate10 min

Long-term Memory with Store

LangGraph Store is a key-value store that persists across threads and sessions. Use it to remember user preferences, learned facts, and past interactions — things that should survive beyond a single conversation.

Quick Reference

  • Store is cross-thread memory — checkpointers save one conversation, Store saves across all of them
  • Namespaces are tuples: (user_id, 'memories') — isolate data per user and category
  • store.put(namespace, key, value) to write, store.get(namespace, key) to read exactly
  • store.search(namespace, query) for semantic search — requires embedding config
  • Pass store at compile time: graph.compile(store=store)

Checkpointer vs Store

LangGraph has two memory systems that serve different purposes. Checkpointers save the full graph state at every step within a thread — they power conversation continuity and crash recovery within a single session. Store is different: it's a shared key-value database that any thread can read from and write to. It's how your agent remembers things about a user across all their conversations, forever.

CheckpointerStore
ScopePer thread (one conversation)Cross-thread (user lifetime)
What it savesFull graph state per stepArbitrary key-value data
Accessed byThread ID + checkpoint IDNamespace + key, or semantic search
Use caseResume a conversation, time travelUser preferences, learned facts, past interactions
Resets whenNew thread startsNever (until explicitly deleted)