Use LangGraph Store to persist cross-thread agent memories between conversations

domain: docs.langchain.com/langgraph · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. For development use InMemoryStore; for production use a backend such as langgraph-store-mongodb or a Redis-backed store
  2. Instantiate the store and pass it to compile: graph = builder.compile(checkpointer=checkpointer, store=store)
  3. Inside a node, access the store via the injected store argument: items = store.search(namespace=('user', user_id), query='preferences')
  4. Write new facts with store.put(namespace=('user', user_id), key='pref_theme', value={'color': 'dark'})
  5. Unlike the checkpointer, the store requires explicit reads and writes in your node logic — it is not automatic
  6. Use namespacing (e.g. ('user', user_id) or ('agent', agent_id)) to prevent cross-user memory leakage

Known gotchas

Related routes

Add persistent cross-session memory to an AI agent using Mem0
docs.mem0.ai · 6 steps · unrated
Add a Postgres checkpointer to a LangGraph agent for durable cross-session state
docs.langchain.com/langgraph · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans