LangMemLangMem 0.0.30 · LangGraph 1.2 · Python 3.10+
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
19 small wins to finish your pathNext lesson →

The LangGraph store

The LangGraph store is a key-value store for JSON documents, organised by namespace, that LangMem's stateful parts read and write so memories outlive the Python process that made them.

Last updated: 30 Sep, 2026 · LangMem 0.0.30

So far every memory lived in a Python list and vanished when the script ended. LangMem's store managers and memory tools save to a LangGraph BaseStore instead. This lesson uses the store directly, with no model, so you know what the later lessons are writing to.

Syntax:

python
store.put(namespace, key, value)     # namespace is a tuple, value a dict
store.get(namespace, key)            # an Item, or None
store.search(namespace_prefix)       # the Items under that namespace
store.delete(namespace, key)

A namespace per customer

A namespace is a tuple of strings, like a folder path. ("memories", "asha") holds only Asha's memories.

python
from langgraph.store.memory import InMemoryStore

store = InMemoryStore()
store.put(("memories", "asha"), "contact", {"content": "Wants us to email her"})
store.put(("memories", "ravi"), "contact", {"content": "Prefers a phone call"})

Reading one item back

python
item = store.get(("memories", "asha"), "contact")
print(item.value)

Putting, reading and deleting

Example
from langgraph.store.memory import InMemoryStore

store = InMemoryStore()
store.put(("memories", "asha"), "contact", {"content": "Wants us to email her"})
store.put(("memories", "ravi"), "contact", {"content": "Prefers a phone call"})

print(store.get(("memories", "asha"), "contact").value)
print([item.key for item in store.search(("memories", "asha"))])
print(store.list_namespaces())

store.put(("memories", "asha"), "contact", {"content": "Wants us to text her"})
print(store.get(("memories", "asha"), "contact").value)
store.delete(("memories", "asha"), "contact")
print(store.get(("memories", "asha"), "contact"))

What each call returned

  • get returned an Item; its value is the dictionary that was put.
  • search on Asha's namespace found only her key, contact. Ravi's item is in another namespace.
  • list_namespaces shows both customers' namespaces.
  • A second put to the same namespace and key replaced the value; there is no history.
  • delete removed it, so the last get printed None.

Store vs checkpointer

StoreCheckpointer
HoldsDocuments you put, by namespace and keyThe state of one conversation thread
Shared across threadsYesNo, one history per thread_id
LangMem uses it forLong-term memoriesNothing; your agent uses it for the chat history
In-memory classInMemoryStoreInMemorySaver

Where the store is used

  • As the place a store manager writes memories after a chat.
  • As the backend of an agent's memory tools.
  • For any per-user data your agent should read later: settings, notes, profiles.
Watch out. InMemoryStore lives in the Python process. Restart the script and every memory is gone; Integrations swaps in a store that writes to disk or a database.
Try it yourself
  • Search the prefix ("memories",) and see which items it finds.
  • Store a nested dictionary and read one field back.
  • Print an item's created_at and updated_at after a second put.

This is what real progress feels like.