Long-Term Memory
The store.
A checkpointer remembers one conversation. But a returning customer starts a new conversation, on a new thread. To remember them across conversations, like their favourite genre, we need long term memory. LangGraph calls it the store.

- Checkpointer: one thread
- New chat, new thread
- The store: across threads
Put, get, search
The in memory store saves items. Put takes a namespace, a key, and a dictionary value. Get fetches one item by key. Search lists every item in a namespace. Run it. We read back Sam's favourite genre, and see both saved keys.
from langgraph.store.memory import InMemoryStore
store = InMemoryStore()
store.put(("customers", "sam"), "genre", {"value": "science fiction"})
store.put(("customers", "sam"), "format", {"value": "paperback"})
item = store.get(("customers", "sam"), "genre")
print("genre:", item.value["value"])
print("all keys:", [i.key for i in store.search(("customers", "sam"))])genre: science fiction all keys: ['genre', 'format']
Checkpointer vs store
So we have two kinds of memory. The checkpointer saves the state of one thread, the conversation. The store saves facts that outlive any one conversation, shared across all threads, like a customer profile.
Checkpointer
- One threadThe conversationShort-term
Store
- Across threadsFacts and profilesLong-term
Summary
The store keeps long term memories, shared across threads. Put, get, and search work with namespaces and keys. Next, organising memories with namespaces.
Key takeaways- store.put(ns, key, value)
- store.get
- store.search(ns)