LangMem: LangChain's Long-Term Memory SDK, Explained
LangMem is an open-source Python library from LangChain that gives AI agents long-term memory. It uses a language model to read conversations, pull out facts worth keeping, merge them with what the agent already knows, and even rewrite the agent’s own instructions based on feedback. It works with any storage system and plugs directly into LangGraph, LangChain’s framework for building agents. LangChain released it in February 2025, and it’s free under the MIT license.
The quick answer: LangMem is a toolkit, not a service. You bring the model, the database and the agent, and LangMem supplies well-designed building blocks for three kinds of memory: facts, past experiences and learned behavior. Its most distinctive feature is procedural memory, where the agent’s system prompt improves from feedback. It’s still on version 0.0.30, released in October 2025, and work since then has mostly been dependency updates. A disclosure: we make Carly, an AI assistant with its own memory, so we compete on the memory side. Everything below comes from LangMem’s documentation, GitHub repository and LangChain’s announcements.
LangMem at a glance
Checked against LangMem’s documentation, GitHub repository and PyPI release history on November 12, 2026.
| LangMem | |
|---|---|
| What it is | An open-source Python library for agent long-term memory |
| Made by | LangChain |
| Memory types | Semantic (facts and profiles), episodic (past experiences), procedural (learned instructions) |
| Storage | Any storage system; native support for LangGraph’s long-term memory store |
| Language | Python 3.10 and up; no TypeScript version |
| License | MIT, about 1,800 GitHub stars |
| Latest release | 0.0.30, October 27, 2025 |
What LangMem does
LangChain’s launch post from February 18, 2025 describes LangMem as “a library that helps your agents learn and improve through long-term memory.” The README lists four pieces:
- A core memory API that works with any storage system.
- Memory tools an agent can call to save and search information during a conversation.
- A background memory manager that extracts, consolidates and updates knowledge automatically.
- Native integration with LangGraph’s long-term memory store, available by default in LangGraph Platform deployments.
Every memory operation follows the same pattern, per LangMem’s conceptual guide: take the conversation and the current memory, ask a language model how to expand or consolidate that memory, and return the updated state. That means LangMem needs an API key for a model provider, and each extraction is a model call.
The three kinds of memory
LangMem organizes memory the way cognitive scientists describe human memory.
Semantic memory stores facts. It comes in two shapes. Collections are open-ended sets of individual memories, searched when relevant, which suit knowledge that builds up over many conversations. Profiles are a single document with a fixed structure, like a user’s preferred name and communication style, that gets updated in place. The guide’s advice is to use profiles when you only care about the latest state and collections when you don’t want to lose information.
Episodic memory stores past experiences, such as a successful interaction distilled into an example: the situation, the reasoning and why the approach worked. The docs show how to capture these with the same memory tools by giving them a schema.
Procedural memory stores how the agent should behave, and it’s where LangMem stands out. A prompt optimizer reviews conversations along with feedback, identifies what worked and what didn’t, and rewrites the agent’s system prompt. LangMem ships three optimizer approaches, from a single-step update to one that separates critique from rewriting. LangChain’s example: an agent that gave a planetary-science answer and got a low score for missing the user’s interest in Mars’s moons ends up with instructions that adapt to what users actually ask for.
Hot path or background
LangMem supports two moments for forming memories:
- In the hot path. The agent saves memories itself during the conversation using LangMem’s manage-memory and search-memory tools. It’s simple, but the guide notes that “it adds perceptible latency to user interactions” and gives the agent one more decision to make.
- In the background. A memory manager reviews a conversation after it ends, or after it goes quiet, and extracts insights without slowing anything down. LangChain calls this “subconscious” memory formation and says it’s better for recall.
Memories are organized by namespace, usually including a user ID, so one user’s memories don’t leak into another’s. They can also be scoped to a team or shared across all users when the agent should learn general procedures.
Where LangMem stands in late 2026
A few facts matter for anyone deciding whether to build on LangMem today:
- Releases have slowed. The most recent version on PyPI is 0.0.30 from October 27, 2025. The repository is still maintained, but commits through 2026 have been mostly dependency and documentation updates.
- Upgrades have lagged LangGraph. When LangGraph moved to version 1.0 in October 2025, developers spent about three weeks asking in GitHub issues for a LangMem release that would install alongside it, with some installing straight from GitHub as a workaround, until 0.0.30 shipped.
- Python only. A request for a TypeScript version has been open since September 2025, so LangChain.js developers can’t use it.
- LangChain’s own docs have moved on. LangChain’s current memory guides, including its conceptual guide and the long-term memory pages for LangChain and Deep Agents, build memory directly on the LangGraph store and, for Deep Agents, on memory files the agent reads and edits. They don’t mention LangMem.
None of this makes LangMem stop working, and its design ideas show up across the field. But teams choosing it should expect to maintain their own integration rather than rely on a fast-moving product.
The company behind it
LangChain, the company, makes the widely used LangChain and LangGraph open-source frameworks and LangSmith, its platform for testing and monitoring agents. In October 2025 it raised $125 million at a $1.25 billion valuation, led by IVP, and released LangChain and LangGraph 1.0. LangMem is one of its smaller projects, with about 1,800 GitHub stars.
How LangMem compares
LangMem is a library you assemble. Most other memory options are services or engines that handle more for you:
- Cognee is an open-source engine that builds a knowledge graph from documents, code and conversations, with a managed cloud option.
- Zep is a managed service built on time-aware knowledge graphs, aimed at companies, with its open-source Graphiti framework.
- Supermemory is a hosted memory API with user profiles, plugins and an MCP server.
- Honcho focuses on reasoning about what each user is like.
- Mem0 is a popular memory layer with both open-source and hosted versions; our guide covers connecting Mem0 to an AI agent.
LangMem’s advantages are that it’s free, lightweight, works with whatever database you use, and fits naturally into a LangGraph agent. Its procedural memory is also unusual. The tradeoffs are that you do more of the work, it depends on model calls for every update, and it’s moving slowly.
LangMem is for developers wiring memory into their own agents. If you want an assistant that remembers you without any of that assembly, Carly has memory built in: it saves named memory documents that it reads and searches in later conversations, searches a knowledge base of files you upload by meaning, and keeps your to-dos, data tables and CRM in one workspace. It works inside ChatGPT or Claude or by text with nothing to configure, and it also labels and sorts email across all your accounts, handles advanced scheduling, and makes and answers calls and texts.
Who LangMem suits
LangMem is a good fit if:
- You’re already building agents in Python with LangGraph.
- You want memory building blocks you control, on your own database.
- You want an agent whose instructions improve from feedback.
- You’re comfortable maintaining an integration with an early-version library.
Look elsewhere if:
- You build in TypeScript.
- You want a managed memory service with support and ongoing releases.
- You want a finished assistant rather than a library.
FAQ
What is LangMem?
LangMem is LangChain’s open-source Python library for long-term agent memory. It extracts facts from conversations, keeps user profiles, stores examples of past interactions and updates an agent’s instructions from feedback.
Is LangMem free?
Yes. LangMem is open source under the MIT license. You pay for the language model calls it makes and whatever database you store memories in.
Does LangMem require LangGraph?
No. Its core functions work with any storage system and agent framework, but it integrates natively with LangGraph’s long-term memory store.
Does LangMem support TypeScript?
No. LangMem is Python only. A request for a TypeScript version has been open on GitHub since September 2025.
Is LangMem still maintained?
The repository is still updated, but the latest release is version 0.0.30 from October 2025, and 2026 changes have mostly been dependency updates.
Ready to automate your busywork?
Carly schedules, researches, and briefs you—so you can focus on what matters.
See what people say
"Before Carly, I relied on a Calendly link, but the whole process felt impersonal and not very professional. Carly changed that by handling all the back-and-forth, so I'm no longer stuck in endless email threads trying to line up schedules.
Now Carly reaches out to candidates, shares my real-time availability, lets them pick a slot, then sends a Zoom link and drops it straight into my calendar. She sends reminders to both of us before each call, which has significantly reduced no-shows and last-minute confusion.
On top of scheduling, Carly acts like a full executive assistant, sending me my schedule the night before so I can prepare for each call. It reminds me of the old x.ai assistant, but Carly is noticeably smarter, faster, and better suited to my healthcare recruitment business."


