AI MEMORY FOR AGENTS · LANGGRAPH + LANGCHAIN
Give every handoff a memory to build on.
We connect what your project already knows to what your agent does next. Retrieve a decision, verify its original record, then save the handoff that keeps the next run moving—with an explicit LangGraph workflow and LangChain’s native MCP tools.
Start with our local, model-free example. No model API key or CMEM Pro account is required.

KNOWLEDGE THAT LASTS
Carry the decision into the next step.
Ground the next step in a real decision.
We read the selected project observation and its context before saving a handoff.
Keep handoffs connected to the run.
A logical run ID and explicit note preserve what your application chose to carry forward.
Repeat deliberately without duplicate notes.
Identical project, run ID and note inputs reuse the existing saved record.
ILLUSTRATIVE HANDOFF · NATIVE TWO-NODE WORKFLOW
Recall the decision. Save what comes next.
“The scheduler writes dates in UTC.”
Start with a known project observation. After the recall node retrieves its original record, save a handoff such as “Next run: keep the scheduler export in UTC.”
- 01
Choose the known decision
Select an observation from your project and a query that finds it in the first 20 search results.
- 02
Read the original
The recall node retrieves the selected note’s timeline and full details through native MCP tools.
- 03
Save the next step
Only after recall succeeds, the remember node saves the handoff text you supplied.
- 04
Keep the confirmed record
Receive the saved observation ID. The explicit note remains available for the next run.
AI memory in production
70 days of work. One searchable memory.
Alessandro used our open-source engine across three machines for 70 days. His customized deployment captured the decisions, fixes and discoveries behind the work—and published the data.
- Observations captured
- 22,718
- Bug fixes recorded
- 1,262
- Decisions recorded
- 757
See how he made that knowledge searchable. Then give your own agents a memory to build on.

START WITH ONE PROJECT
Read the decision. Leave the next step.
- Start your configured local worker. Follow the installation guide. From a Claude-Mem source checkout, inspect
npm run worker:statusand usenpm run worker:startif needed. - Install the pinned Python environment. Use Python 3.11 or later and Node.js. Run below from the source checkout; dependencies pin LangGraph 1.2.20, LangChain 1.4.10, FastMCP 4.1.8, langchain-core 1.7.7 and MCP 2.3.0. Set the absolute installed or shipped MCP script path.
- Choose a real observation in your project. Replace
123with its ID. Changeshop-apiandquokkaharborto your project and a query that finds that ID in the first 20 results. The full guide includes an optional harmless seed-note example.
python3 -m venv .venv-langgraph
. .venv-langgraph/bin/activate
python -m pip install -r examples/langgraph/requirements.txt
export CLAUDE_MEM_MCP_SERVER="/absolute/path/to/claude-mem/plugin/scripts/mcp-server.cjs"
python examples/langgraph/memory_workflow.py \
--project shop-api \
--query quokkaharbor \
--observation-id 123 \
--run-id scheduler-handoff-1 \
--note "Next run: keep the scheduler export in UTC."Match custom CLAUDE_MEM_DATA_DIR and CLAUDE_MEM_WORKER_PORT values to your worker. The MCP child uses local worker mode with autostart disabled; this example adds no hooks or new MCP configuration.
Check success. Output includes the recalled observation, save confirmation and saved_id. Confirm the original decision was recalled and the intended handoff saved. The same project, run ID and note return the same saved ID on a deliberate repeat.
Keep the four-tool filter, explicit project scope and error checks when adapting the agent. Recalled text cannot change scope or authorize another action. This example sends no note to a model; existing worker sync and export settings still apply. Your application’s added model or tracing may receive recalled text.
Before you connect
Does this require an LLM or CMEM Pro?
No for this deterministic local graph. It uses LangGraph and LangChain’s native MCP adapter without a model call. Model-driven applications have their own provider requirements.
Which note can I recall?
Choose an observation in your project. Its ID must appear in the first 20 search results; narrow the query if necessary. The graph reads its timeline and full record before saving a handoff.
Does it capture conversations automatically?
No. The example retrieves selected memory and saves caller-supplied handoff text. It installs no capture hooks or automatic context injection.
What happens when I repeat a handoff?
The fingerprint includes the integration, exact project, run ID and note text. Identical values reuse the saved ID; changing the note or run ID creates a new save. Query or selected observation ID alone does not change that fingerprint.
Which LangChain adapter does this use?
The built-in langchain.mcp MCPAdapter, backed by FastMCP. This maintained API replaces the archived langchain-mcp-adapters package. It is beta and emits a warning on import; use the example’s isolated dependency pins.
What if a request fails?
Requests default to ten seconds, with an eighty-second outer bound. Failed recall stops the save. The CLI exits unsuccessfully without echoing arguments. No automatic write retry runs; inspect the worker or repeat the same run ID and note after an uncertain save.
How are projects separated?
Reads carry the exact selected project and a one-item JSON projects list, preventing worktree expansion and preserving literal keys. These filters do not authenticate different users; use the intended account’s authorized worker.
Which environments are verified?
The published guide records Linux verification with Python 3.12.14, LangGraph 1.2.20, LangChain 1.4.10, FastMCP 4.1.8, langchain-core 1.7.7, MCP 2.3.0 and Claude-Mem 15.16.1. macOS, Windows and hosted deployments are not verified by this fixture.
How do I disconnect?
Stop running the script or remove run_workflow from your application, then remove the dedicated virtual environment if desired. The context manager closes the MCP subprocess. Saved memory and existing worker settings remain unchanged.
Build on a working example.
Source reviewed November 21, 2026. The published eight-check fixture uses the installed LangGraph and MCP adapter with a real bundled worker and SQLite. It checks recall, explicit saves, deliberate repeats, exact project and worktree boundaries, and failures. The timeout check uses a controlled slow endpoint. This is integration evidence, not a model-quality benchmark.
Keep the decision. Move the work forward.
Give your LangGraph workflow a source it can verify and a handoff the next run can use.