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.
| Checkpointer | Store | |
|---|---|---|
| Scope | Per thread (one conversation) | Cross-thread (user lifetime) |
| What it saves | Full graph state per step | Arbitrary key-value data |
| Accessed by | Thread ID + checkpoint ID | Namespace + key, or semantic search |
| Use case | Resume a conversation, time travel | User preferences, learned facts, past interactions |
| Resets when | New thread starts | Never (until explicitly deleted) |