LangGraph long-term memory
LangGraph long-term memory: a memory store for facts that cross threads, separate from the checkpointer that saves one thread.
Overview
The langgraph surface of the LangChain packages ships a genuine BaseStore implementation compiled straight into any graph via store= (its values live in MemorySync framework state, apart from the user’s memories), pre-model context injection through create_react_agent hooks in both languages and create_agent middleware in Python, a persist node that sends the latest user message for fact extraction (a re-run node or retried model call is recognised, so nothing is extracted twice), and a graph-callable search tool — in Python and Node.js, sharing one wire format.
Setup status and requirements
- Supported version
- langchain-memorysync[langgraph] 1.2.0 (PyPI) / memorysync-langchain 1.2.0 (npm)
- Last setup review
- 2026-10-01
- Permissions
- A MemorySync API key with read and write scopes; store deletes need delete permission.
- Limits
- Requires langgraph 1.2+ (Python 3.10+) or @langchain/langgraph 0.2+ (Node 18+). Thread state belongs in a checkpointer such as langgraph-checkpoint-postgres; this integration is the long-term memory half.
Capabilities
- LangGraph BaseStore with cross-thread durable state — one live value per key
- Semantic store search with zero embedding configuration
- Pre-model context injection for create_react_agent, plus create_agent middleware in Python
- Persist node: the latest user message goes to fact extraction, never twice
- Graph-callable memory search tool that never raises
- One wire format across Python and Node.js — data written by one is read by the other
Quick Start
from langchain.agents import create_agentfrom langchain_memorysync.langgraph import (MemorySyncMemoryMiddleware,MemorySyncStore,)agent = create_agent(model,tools=tools,middleware=[MemorySyncMemoryMiddleware(user_id="customer-7")],store=MemorySyncStore(),)
Use Cases
LangGraph agents that remember users across threads
Multi-step workflows with durable state
Support agents that recall facts from past conversations
Guides and related pages
Related integrations
Explore More
Add long-term memory to LangGraph
Start free with 10,000 add requests a month and no credit card. Memory is stored per end user and comes back in every later session.
