---
title: "Mem0 vs LangMem: Library or Service for Agent Memory"
description: "Mem0 vs LangMem compared on memory model, temporal handling, retrieval, deployment, and pricing, with a decision path for LangGraph teams."
canonical: https://past.dev/blog/mem0-vs-langmem
date: 2026-09-03
category: Research
authors: The past.dev team
---
# Mem0 vs LangMem: Library or Service for Agent Memory

Mem0 vs LangMem is a choice between two kinds of software. [LangMem](https://langchain-ai.github.io/langmem/) is a Python library from the LangChain team: memory tools and background extraction for agents, persisting through LangGraph's storage layer. [Mem0](https://docs.mem0.ai/core-concepts/memory-operations) is a standalone memory layer: a managed platform behind a REST API, or an open-source package you run yourself, callable from any framework. A team already on LangGraph can pick either. A team on anything else is picking between Mem0 and other standalone systems, and LangMem drops off the shortlist.

## Mem0 vs LangMem at a glance

The past.dev column comes from our own published docs. The other two come from each product's documentation, linked per cell, current as of September 2026.

| Dimension | Mem0 | LangMem | past.dev |
|---|---|---|---|
| Memory model | LLM extracts facts and preferences from messages; stored additively, scoped by `user_id`, `agent_id`, `run_id` ([operations](https://docs.mem0.ai/core-concepts/memory-operations)) | Semantic, episodic, and procedural memories saved as JSON items in a LangGraph store, organized by namespace ([concepts](https://langchain-ai.github.io/langmem/concepts/conceptual_guide/)) | Facts derived from raw ingested text, each tied to its sources |
| Temporal handling | Optional `timestamp` on add backdates a memory ([timestamp](https://docs.mem0.ai/platform/features/timestamp)); optional `expiration_date` hides it later ([operations](https://docs.mem0.ai/core-concepts/memory-operations)) | Store items carry timestamps and keys ([background quickstart](https://langchain-ai.github.io/langmem/background_quickstart/)); event-time semantics are left to your schema | Event time from the source timestamp, validity windows, supersession links |
| Entity handling | Graph Memory links memories that mention the same person, place, or organization; connections come from co-occurrence ([graph memory](https://docs.mem0.ai/platform/features/graph-memory)) | Developer-defined profiles and collections per memory type ([concepts](https://langchain-ai.github.io/langmem/concepts/conceptual_guide/)) | Entity resolution at ingestion links references across email, transcripts, tickets, chat |
| Retrieval | Ranked memories with one combined relevance score ([graph memory](https://docs.mem0.ai/platform/features/graph-memory)) | `create_search_memory_tool` and `store.search()` return matching items ([docs](https://langchain-ai.github.io/langmem/)) | `POST /api/v1/recall` returns ranked, dated evidence with sources and a status: Supported, Conflicted, NoKnownSupport, UnknownBecauseDegraded |
| Deployment | Managed platform; or pip/npm library and self-hosted server via Docker Compose ([open source](https://docs.mem0.ai/open-source/overview)) | In-process library; persistence via your LangGraph store, `InMemoryStore` in dev, `AsyncPostgresStore` in production ([docs](https://langchain-ai.github.io/langmem/)) | Managed, or self-hosted in your own Postgres: docker compose, pinned images, same API |
| Pricing model | Free tier with 10,000 add and 1,000 retrieval requests per month; Starter $19/mo; Pro $249/mo ([pricing](https://mem0.ai/pricing)) | Open-source package; you pay for the store and LLM calls you run | Managed or self-hosted; start at the [quickstart](/docs/memory-api/quickstart) |

## What LangMem provides

LangMem installs with `pip install -U langmem` and ships two kinds of machinery. The first is a pair of agent tools: `create_manage_memory_tool` lets an agent create, update, and delete its own memories mid-conversation, and `create_search_memory_tool` lets it query them ([docs](https://langchain-ai.github.io/langmem/)). The second is a background path: `create_memory_store_manager` extracts and consolidates memories from finished conversations, and `ReflectionExecutor` defers that work to avoid redundant processing on every turn ([background quickstart](https://langchain-ai.github.io/langmem/background_quickstart/)).

The [conceptual guide](https://langchain-ai.github.io/langmem/concepts/conceptual_guide/) names these two formation paths hot path and background, and sorts memories into semantic (facts, as collections or single structured profiles), episodic (past interactions kept as examples), and procedural (behavior rules refined through prompt optimization). Persistence goes through LangGraph's `BaseStore`, with namespaces separating users and agents. LangChain's current framework docs describe the same store primitives directly, as JSON documents organized by namespace and key, written and read through `runtime.store` ([long-term memory guide](https://docs.langchain.com/oss/python/langchain/long-term-memory)).

## What Mem0 provides

Mem0's `add` call runs messages through an LLM that extracts facts, decisions, and preferences. The [operations guide](https://docs.mem0.ai/core-concepts/memory-operations) states that new memories are added without overwriting or deleting existing ones; ranking at search time decides what surfaces. Setting `infer=False` skips extraction and stores raw payloads. Memories are scoped by `user_id`, `agent_id`, `app_id`, and `run_id`, and can carry metadata filters.

Three features matter most for this comparison. A [timestamp field](https://docs.mem0.ai/platform/features/timestamp) records when an event actually happened, which makes historical import possible. [Graph Memory](https://docs.mem0.ai/platform/features/graph-memory) turns the people, places, and organizations mentioned across memories into nodes and connects memories that share an entity; the docs note connections are inferred from co-occurrence rather than declared as typed relationships. And the engine is also [open source](https://docs.mem0.ai/open-source/overview): the same extraction pipeline as a library or a Docker Compose server, with your choice of vector store and LLM.

## Lock-in: LangMem runs on LangGraph's store

LangMem's stateful components, the memory tools and the store manager, read and write through LangGraph's store interface ([docs](https://langchain-ai.github.io/langmem/)). The functional core that transforms memory state has no storage dependency, so the extraction logic is portable, but the persistence and deployment story assume a LangGraph application with a configured store. Mem0 carries no framework assumption in either direction: the platform is a [REST API with SDKs](https://docs.mem0.ai/api-reference), and the open-source package embeds in any codebase. The cost runs both ways. Leaving LangGraph later means rebuilding memory plumbing that lives in LangMem. Adopting Mem0 from inside LangGraph adds a network dependency and a second vendor that an in-process library avoids.

## When a LangGraph team should still choose each

Choose LangMem when memory is an application concern you want versioned with your code: same process, same store, same deploy, and schemas you define. It fits teams that already run a Postgres-backed store and want procedural memory and prompt optimization in the same package. Choose Mem0 when memory must serve more than one graph or one language, or when you want extraction managed and metered instead of operated. Choose a system like past.dev when answers depend on when facts were true, which requires dated evidence instead of ranked snippets. See [facts that change over time](/guides/facts-that-change-over-time) for why that distinction decides real cases.

## Self-published numbers

Mem0 and past.dev both publish results on BEAM, the same long-horizon benchmark, so the two sets of figures can appear together. Mem0 reports 64.1% at 1M events and 48.6% at 10M ([their 2026 benchmark post](https://mem0.ai/blog/ai-memory-benchmarks-in-2026)). On BEAM's complete splits, past.dev reports 91.50% at 100K events, 86.18% at 1M, and 82.61% at 10M ([benchmarks](/benchmarks), setup in the [methodology](/benchmarks/methodology)). We found no published accuracy benchmarks for LangMem to cite, so evaluate it on your own data. All numbers above are vendor-reported.

## How to decide

Run five tests before committing; the full walkthrough is in [choosing a memory system](/guides/choose-memory-system).

1. Change a fact, then ask for the old and new values with dates. Systems that overwrite or only re-rank return one value.
2. Backfill a year of history with original timestamps, then ask what was known at a past date. Mem0's [timestamp field](https://docs.mem0.ai/platform/features/timestamp) covers the write side; check what retrieval does with it. In LangMem, decide up front how event time enters your item schema.
3. Give one person three identifiers (email address, chat handle, ticket ID) and check whether facts land on one entity or three.
4. Ask something the stored data cannot answer, and watch whether the system says so or improvises.
5. Price your actual volume: Mem0 meters add and retrieval requests ([pricing](https://mem0.ai/pricing)); LangMem costs whatever your store and extraction LLM cost.

## Where past.dev sits in this comparison

past.dev is a memory API built for facts that change. `POST /api/v1/ingest` takes raw text with its original timestamp; `GET /api/v1/ingest/{id}` reports `settled: true` when processing completes; `DELETE /api/v1/ingest/{id}` forgets a source and erases what only it supported. `POST /api/v1/recall` returns ranked, dated evidence with sources, and every answer carries one of four statuses ([evidence status](/glossary/evidence-status)): Supported, Conflicted, NoKnownSupport, or UnknownBecauseDegraded. Facts keep event time, validity windows, and supersession links, and entity resolution at ingestion connects references across email, transcripts, tickets, and chat. Recall is audience-scoped. Deployment is managed or self-hosted in your own Postgres with the same API, data export is supported, and SOC 2 Type II, ISO 27001, and ISO 27701 certifications are held.

If you want an in-process library versioned with a LangGraph app, LangMem is the right tool. If you want extraction-based per-user memory as a hosted service or a library you operate, Mem0 fits. If your agent must answer with dates, sources, and an explicit status when evidence is missing, start at the [quickstart](/docs/memory-api/quickstart).

For the deeper design comparisons, see [past.dev vs Mem0](/vs/mem0), the [LangMem comparison](/compare/langmem), and the [Mem0 alternatives roundup](/blog/mem0-alternatives).
