LangChain Agents Can Now Remember: One Node, Persistent Memory

John Rood··5 min read

Here is the thing nobody tells you when you build your first LangChain agent.

It works. It is brilliant. It reasons, it calls tools, it chains steps together like magic.

And then the session ends, and it forgets everything.

The next conversation starts from zero. The architecture decision you made yesterday is gone. The bug you already debugged together, gone. The user's preferences, their project, the three months of context you built up, all of it wiped the moment the thread resets.

LangChain gives you the brain. It does not give you the memory.

Today that changes.

MemoryRouter now plugs straight into LangChain and LangGraph

We just shipped the official MemoryRouter integration for LangChain. If you are building agentic applications on LangChain or LangGraph, you can now give every user a private, persistent memory layer with almost no code.

Not chat history. Not "summarize the last 10 messages and hope the model cares." Actual user-scoped memory that survives across sessions, compaction, restarts, and resets.

And the best part: you can drop it in as a single graph node.

One node turns a forgetful agent into a memory agent

LangGraph builds agents as graphs. Nodes do work, edges decide flow, state carries the conversation.

MemoryRouter adds two nodes:

from langchain_memoryrouter import create_recall_node, create_retain_node

recall = create_recall_node()   # pulls this user's relevant memory before the model runs
retain = create_retain_node()   # stores the new exchange after the model responds

Wire them into your graph:

recall -> agent -> retain

That is the entire pattern.

Before your model runs, the recall node looks at the live conversation, retrieves only the relevant memories for this exact user, and injects them into state. After your model responds, the retain node quietly stores the new exchange.

The user talks to your agent. Behind the scenes, the agent already knows them.

Why this is different from a "memory tool"

Most "memory" integrations are actually a tool the model can choose to call. The agent has to decide, mid-reasoning, that it should go look something up. If it does not think to ask, no memory shows up. That is not memory. That is a filing cabinet the agent forgets it owns.

MemoryRouter's recall node is not optional. It runs every turn, automatically, before the model ever sees the prompt. The memory is just there, the same way your own memory is just there when you walk into a room.

It is the difference between an agent that can remember if it tries, and an agent that simply does.

We still ship a recall tool for the cases where you want agent-initiated lookups. But the headline pattern, the one that makes your product feel alive, is the automatic node.

It is conversation-aware out of the box

The recall node does not make you hand-craft a search query. It takes the actual conversation and figures out what matters.

Under the hood it calls MemoryRouter's prepare endpoint, which reads the live conversation context, retrieves the few relevant facts for the current moment, and hands them back ready to inject. You do not reimplement retrieval logic. You do not tune a query. You connect the node and it behaves like memory should.

One source of truth for "how do we turn a conversation into the right memories," shared across every surface you build.

Private memory, per user, by default

This is the part that matters for anyone shipping a real product.

Every user gets their own private vault:

user_id -> Memory Key -> private vault

User A never sees User B's memory. You do not build sharding, isolation, retention, or retrieval infrastructure. You pass a key, MemoryRouter handles the rest.

That means you can build a LangChain product where every single customer has a persistent, isolated, growing memory of their own relationship with your AI. At scale. Without standing up a vector database, an embeddings pipeline, and a memory service before you write your first real feature.

What this unlocks

Think about what you can build now.

A coding agent that remembers your repo structure, your stack decisions, and the bugs you already chased, across every session.

A support agent that knows this customer's history the moment they say hello.

A research assistant that compounds. Session 14 is smarter than session 1 because it never lost the scar tissue from the first thirteen.

A personal AI that actually feels personal, because it does not greet you like a stranger every morning.

All of it on the LangChain stack you already use. Your models, your provider routing, your tools, your graph. MemoryRouter just makes it remember.

Get started

  1. Install it:
pip install langchain-memoryrouter
  1. Grab a free memory key at app.memoryrouter.ai (50M tokens free, no credit card).

  2. Add the recall and retain nodes to your graph.

That is it. Your agent stops forgetting.

LangChain gave the world the brain. MemoryRouter gives it the memory. Together, they give your users an AI that actually knows them.

The agents you are building deserve to remember. Now they can.