Comparisons

LangMem vs. Mem0
Mem0 is the better choice for most teams: a ready-made memory layer for any framework, hosted or self-hosted. LangMem is better for Python teams on LangGraph who want free memory primitives. Pricing and features compared.
Last updated December 2026
Mem0 is the better choice for most teams adding memory to an agent, because it is a ready-made memory layer with automatic extraction, Python and TypeScript SDKs, a self-hostable open-source version and a managed platform. LangMem is the better choice for teams already building on LangGraph that want free, MIT-licensed memory primitives they can wire into LangGraph’s own store and shape themselves.
We make Exabase, which appears as a short third option near the end. This is a neutral comparison of LangMem and Mem0, based on the LangMem documentation and GitHub repository and Mem0’s pricing page and repository, all checked in December 2026.
Quick verdict
Choose Mem0 if you want a memory service that works with any framework, extracts and updates user facts for you, and can run as a hosted API or on your own infrastructure.
Choose LangMem if your agent runs on LangGraph, you are happy writing Python, and you want memory as a set of library functions and tools that store data in a LangGraph store you already operate.
Consider Exabase if you want managed memory plus file storage, document search and per-tenant isolation behind one API, without assembling a store, an extraction step and a search index yourself.
Comparison table
Feature | LangMem | Mem0 |
|---|---|---|
What it is | Python library of memory primitives from LangChain | Memory layer: open-source library and managed platform |
Licence | MIT | Apache-2.0 |
Languages | Python | Python and Node.js / TypeScript |
Framework fit | Built for LangGraph; core functions work with any storage | Framework-agnostic |
Storage | LangGraph BaseStore, such as AsyncPostgresStore | Bundled vector store in the library; managed storage on the platform |
How memory is written | Agent tools in the hot path, or a background manager | Automatic extraction on add, or direct writes |
Managed service | None of its own; LangGraph Platform includes a store | Mem0 platform, Free and Custom plans |
Prompt optimisation | Yes, from feedback and conversations | No |
Graph memory | No dedicated graph layer | Custom plan (entity linking) |
Price | Free library; you pay for storage and model calls | Free plan; Custom priced to volume |
Architecture: primitives or a memory layer
LangMem is a library. It gives you building blocks: memory tools an agent can call during a conversation to store and search memories, a background memory manager that extracts, consolidates and updates knowledge after the fact, and prompt optimisation utilities that adjust an agent’s instructions from feedback. The tools persist to LangGraph’s BaseStore, so memory lives wherever your LangGraph store lives. The docs note that the in-memory store loses everything on restart and recommend AsyncPostgresStore or a similar database-backed store for production. Its core functions can also run against other storage, but most of the value comes from the LangGraph integration.
Mem0 is a memory layer. You call add with a conversation and a user, agent or run ID; an LLM extracts facts and decides which memories to add, update or delete; and you call search before the next model call to retrieve what is relevant. It runs embedded as a Python or Node.js library, as a self-hosted server, or as the managed Mem0 platform, and it works the same way whether your agent uses LangGraph, CrewAI, the OpenAI Agents SDK or a hand-written agent loop.
The practical difference is how much you assemble. LangMem hands you parts and expects you to decide where memory is written, when extraction runs and how namespaces map to users. Mem0 makes those decisions for you and exposes a small API.
Winner: Mem0 for a working memory layer with little assembly. LangMem for LangGraph teams who want to control every part.
How memory gets written
LangMem supports two patterns. In the hot path, the agent itself calls a manage-memory tool when it decides something is worth keeping, which makes memory visible in the agent’s reasoning but costs a tool call and depends on the model’s judgement. In the background, a memory manager processes conversations after they happen, extracting and consolidating memories without slowing the reply. LangMem’s guides cover semantic memory collections, user profiles and episodic memories, and its prompt optimisation updates the agent’s instructions over time, which is closer to procedural memory.
Mem0 writes memory outside the agent. Each add runs its extraction step, which reads the new messages, compares them with existing memories and resolves duplicates and contradictions. You can also write a memory directly when you need exact wording. The agent spends no tokens deciding what to remember, but the extraction logic is Mem0’s.
Winner: tie. LangMem gives you both agent-driven and background writing; Mem0 gives consistent extraction with no agent effort.
Retrieval
LangMem’s search tool queries the LangGraph store within a namespace, using the store’s semantic index if you configure embeddings for it. Namespaces such as a user ID scope the results, and the docs cover configuring them dynamically per user. Ranking, filtering and recency weighting beyond the store’s own search are yours to build.
Mem0 retrieves by semantic search over stored memories, scoped by user, agent or run, with optional reranking, and returns facts ready to place in the prompt. On the Custom plan, graph memory links entities so a query can pull in related facts. Mem0 publishes benchmark results for its managed platform, including 94.4 on LongMemEval and 64.1 on BEAM at 1M tokens, and notes that open-source users should expect directionally similar but not identical numbers.
Winner: Mem0 for retrieval that works without tuning. LangMem if you want retrieval to follow your own store and index choices.
Storage, deployment and operations
LangMem has no service to run. Memory sits in your LangGraph store, which on LangGraph Platform deployments is available by default, and anywhere else is usually Postgres. You own the database, its backups, the embedding configuration and any clean-up of old memories.
Mem0 can be run three ways: embedded in your process, as a self-hosted server you operate, or as the managed platform. The hosted option removes storage and scaling work entirely, and the open-source version keeps everything in infrastructure you control.
Winner: Mem0 for deployment choice. LangMem for teams already running LangGraph Platform, where storage is in place.
Pricing
LangMem is free and MIT-licensed. Your costs are the database behind the LangGraph store, the embedding calls for its index and the LLM calls that extraction and prompt optimisation make, all billed by your own providers.
Mem0’s pricing page, checked in December 2026, lists two plans. Free includes 10,000 adds and 1,000 retrievals a month for the first 30 days with model calls covered by Mem0; after that, using your own LLM key, it allows 50,000 adds and 10,000 retrievals a month, with usage-based billing past the limits and a monthly cap you set. End users are unlimited. Custom is priced to your volume and adds graph memory, user profiles, Dream memory consolidation, advanced analytics, SSO, audit logs, an SLA and on-prem deployment. Neither plan shows a monthly or annual price. Self-hosting the Apache-2.0 library has no licence fee. See Mem0 pricing.
Winner: LangMem on direct cost. Mem0’s free tier is generous for prototypes, and its self-hosted version is free as well.
Ecosystem and maturity
Mem0’s repository has about 68,000 GitHub stars, SDKs in two languages and a managed business behind it. LangMem’s has about 1,700, is Python-only, and is maintained by LangChain as part of the LangGraph ecosystem, so its direction follows LangGraph’s. That makes LangMem a natural fit inside that ecosystem and a weaker one outside it.
Winner: Mem0 for community size and language support.
Security and compliance
LangMem inherits the security of the store and model providers you choose; there is no vendor to assess beyond them. Mem0’s site lists SOC 2 Type I, HIPAA readiness and GDPR readiness, and its Custom plan adds SSO, audit logs and on-prem deployment. Your own compliance depends on your deployment and needs your legal and engineering review.
Winner: tie. LangMem keeps data in your own stack; Mem0 documents more for teams buying a service.
Who should choose Mem0
Mem0 suits teams adding memory to an agent in any framework, teams that work in TypeScript, and products where memory means a current list of user facts. A real-world example: a fitness coaching app built on the OpenAI Agents SDK sends each session to Mem0, which keeps injuries, goals and equipment current, and the coach retrieves them before each reply. See also Mem0 vs Zep, Mem0 vs Letta, Mem0 vs Supermemory and Mem0 alternatives.
Who should choose LangMem
LangMem suits Python teams already on LangGraph who want memory to live in the same store as their agent state, and who want prompt optimisation alongside memory. A real-world example: a support triage agent on LangGraph Platform uses a background memory manager to record each customer’s product setup in the platform’s store and runs prompt optimisation on weekly feedback. See also LangMem vs Zep, Letta vs LangMem and best AI agent frameworks.
A third option: Exabase
Both options leave part of the stack to you: LangMem the store and pipeline, Mem0 the files and documents your agent also needs. Exabase Memory is a managed memory service your agent calls from any framework. Its M-1 engine extracts facts, preferences and events, tracks relationships, resolves contradictions as facts change and consolidates knowledge over time, and it scores 96.4% on LongMemEval and first on BEAM at 100K, 1M and 10M tokens, per Exabase Research. Search is hybrid with recency weighting, optional query expansion and reranking, at about 200ms for simple retrieval. Alongside memory, Resources stores files, notes and links, Deep Search finds passages inside them, and Bases give each user or customer an isolated environment for all of it. Where LangMem and Mem0 are stronger: Exabase is not open source and cannot be self-hosted, and it has a TypeScript SDK and REST API rather than a Python library. Compare in Exabase vs Mem0 and Exabase vs LangGraph memory, or start with the memory docs. The Free plan is $0 a month with 1 GB of storage, 200 credits and up to 100 Bases.
How we compared
We read the LangMem documentation and GitHub repository and Mem0’s pricing page and GitHub repository on 4 December 2026. We compared architecture, how memory is written and retrieved, deployment, price, ecosystem and compliance, and did not run our own benchmarks. Benchmark figures are the vendors’ own. Prices change often, so check each vendor’s page before you commit.
Frequently asked questions
Is LangMem better than Mem0?
Mem0 is better for most teams because it is a complete memory layer that works with any framework and language. LangMem is better for Python teams on LangGraph who want free memory primitives that store data in LangGraph’s own store.
What is LangMem?
LangMem is an MIT-licensed Python library from LangChain that helps agents learn over time. It provides memory tools, a background memory manager and prompt optimisation, and integrates with LangGraph’s long-term memory store.
Is LangMem free?
Yes. LangMem is open source under the MIT licence. You pay for the database behind your LangGraph store and for the model calls that extraction and optimisation make.
Is Mem0 free?
Mem0 has a free plan: 10,000 adds and 1,000 retrievals a month for the first 30 days, then 50,000 adds and 10,000 retrievals a month with your own LLM key. The Apache-2.0 open-source version is free to self-host.
Does LangMem work without LangGraph?
Its core functions can be used with other storage, but the memory tools persist through LangGraph’s BaseStore, and the library is designed around LangGraph. Outside that ecosystem, a framework-agnostic layer such as Mem0 is usually simpler.
Does Mem0 work with LangGraph?
Yes. Mem0 is framework-agnostic, so a LangGraph agent can call Mem0’s add and search before and after each node that talks to the user.
Does LangMem support TypeScript?
The LangMem documentation and repository show Python only. Mem0 has both Python and Node.js / TypeScript SDKs.
Which is better for production?
Mem0, for most teams, because the managed platform and self-hosted server handle storage and scaling and the API is small. LangMem is production-ready when you already run LangGraph Platform or a Postgres-backed store and want to own the pipeline.
Can I migrate from LangMem to Mem0?
Yes. Read the memories out of your LangGraph store by namespace, then write them to Mem0 with matching user IDs, either as raw text for Mem0 to re-extract or as direct memories. Replace LangMem’s tools with calls to Mem0’s add and search.
Does either support graph memory?
Mem0 offers graph memory, with entity linking, on its Custom plan. LangMem stores memories as documents in the LangGraph store and has no dedicated graph layer; for graph-based memory see Zep or the knowledge graph roundup.
Is Exabase an alternative to LangMem and Mem0?
Yes, for teams that want managed memory together with file storage, document search and per-tenant isolation in one API. See the agent memory solution and best agent memory platforms.
Related pages: Mem0 vs Zep, Mem0 vs Letta, LangMem vs Zep, Letta vs LangMem, Mem0 alternatives, Exabase vs Mem0, Exabase vs LangGraph memory, Best open-source agent memory, Agent memory, Long-term memory, Cognee vs Mem0
Compare similar apps and tools:

LangGraph vs. OpenAI Agents SDK

CrewAI vs. AutoGen

n8n vs. Zapier

Relevance AI vs. Lindy

Temporal vs. Inngest

Inngest vs. Trigger.dev

E2B vs. Modal

E2B vs. Modal

E2B vs. Daytona

People Data Labs vs. Apollo

ScreenshotOne vs. Urlbox

Microlink vs. Iframely

AWS Rekognition vs. Google Cloud Vision

Twelve Labs vs. Mixpeek

Twelve Labs vs. Google Video Intelligence

ElevenLabs vs. Deepgram

Deepgram vs. Speechmatics

AssemblyAI vs. Gladia

Zyte vs. ScrapingBee

Bright Data vs. Oxylabs

Google Document AI vs. Azure Document Intelligence

Rossum vs. Nanonets

Mindee vs. Veryfi

Reducto vs. Extend

LlamaParse vs. Mistral OCR

LlamaParse vs. Docling

Bedrock Knowledge Bases vs. Vertex AI Search

Vectara vs. Ragie

LanceDB vs. Chroma

MongoDB Atlas vs. Pinecone

Weaviate vs. Milvus

Vespa vs. Elasticsearch

Algolia vs. Typesense

Typesense vs. Meilisearch

Elasticsearch vs. OpenSearch

LangMem vs. Zep

Vertex AI Memory Bank vs. AWS AgentCore Memory

AWS AgentCore Memory vs. Mem0

Letta vs. Cognee

Zep vs. Cognee

Bedrock Knowledge Bases vs. Azure AI Search

OpenAI file search vs. Pinecone

Docling vs. Unstructured

Azure Document Intelligence vs. Textract

Mistral OCR vs. Textract

Reducto vs. Unstructured

Apify vs. ScraperAPI

Firecrawl vs. ScraperAPI

turbopuffer vs. Pinecone

pgvector vs. Qdrant

Chroma vs. Weaviate

Qdrant vs. Milvus

Letta vs. LangMem

Cognee vs. Mem0

Supermemory vs. Zep

CrewAI vs. LangGraph

LangChain vs. LlamaIndex

Whisper vs. Deepgram

Deepgram vs. AssemblyAI

Textract vs. Google Document AI

Docling vs. Marker

LlamaParse vs. Reducto

LlamaParse vs. Unstructured

Firecrawl vs. Apify

Firecrawl vs. Jina

LangMem vs. Mem0

Mem0 vs. Supermemory

Zep vs. Letta

Mem0 vs. Letta

pgvector vs. Pinecone

Mem0 vs. Zep

Milvus vs. Pinecone

Chroma vs. Qdrant

Weaviate vs. Qdrant

Pinecone vs. Qdrant

Pinecone vs. Chroma

Pinecone vs. Weaviate