An agent that runs across more than one session hits the same wall every time: the model remembers nothing between calls, so you either replay the entire history into the context window or the agent forgets what the user told it yesterday. Replaying gets expensive on every call, and the workarounds (summarize, truncate, hope) quietly lose the one fact that mattered.
That gap is the whole market for agent memory platforms. Zep publishes 94.7% accuracy on the LoCoMo benchmark at 155ms and a 5,760-token context block. Mem0 publishes 92.5 on LoCoMo and 94.4 on LongMemEval at roughly 6,900 tokens per query, against 25,000-plus for stuffing the full history. Both are self-run on different harnesses, so the interesting question is not which vendor scores highest. It is which memory model fits your data, what it costs at your volume, and what happens when you need to run it yourself.
What a Memory Layer Actually Does
Every platform here sits between your agent and the model, and most do some version of four things: ingest episodes (messages, tool results, JSON records), extract facts and entities with an LLM call, store them as vectors or graph edges, and retrieve a compact block for the current turn. Underneath, they differ in what they preserve and how they retrieve it. Some turn conversations into extracted facts or relationships. GoodMem preserves the original source material, extracts and chunks its text, and retrieves relevant passages with references to their source, which gives the application control over what becomes durable memory and a way back to the underlying evidence.
The differences that matter show up in the last two steps. A vector-first system is cheaper to run and degrades predictably: it returns semantically similar text, including stale text, unless the application scopes queries with metadata filters or deletes superseded entries. That is control you exercise, not automatic contradiction handling. A graph-first system tracks relationships between entities and, in Zep's case, attaches a validity window to every fact so a superseded fact is marked invalid rather than overwritten. That costs more per write and pays off when your questions are relational ("who approved the last renewal") or temporal ("what did they use before Postgres").
Two things are worth knowing before you shop. A bigger context window does not remove the need for a memory layer, which is the core finding of the BEAM benchmark at 1M and 10M token scales. And Anthropic now ships a client-side memory tool (memory_20250818, on all Claude 4 and later models) where Claude reads and writes files in a /memories directory backed by your own storage. That is a free baseline, so any paid platform has to beat a directory of markdown files.
If you want the underlying architecture with code for each tier, we covered it in AI Agent Memory in 2026. This post is about picking a product.
Head-to-Head Comparison
The short version, with the detail on each one below it.
| Platform | Memory model | Free tier | Paid entry | Self-host | Best for |
|---|---|---|---|---|---|
| Mem0 | Vector, optional graph | 10k adds, 1k retrievals | $19/mo, $249/mo for graph | Full OSS core, Apache-2.0 | Fastest prototype to production |
| Zep | Temporal knowledge graph | 10k credits/mo | $125/mo, reads unmetered | Graphiti plus a graph DB, Apache-2.0 | Relational and temporal questions |
| Letta | Agent-owned memory blocks | $0, 3 agents, bring your own keys | $20/mo | Docker server, Apache-2.0 | Stateful agents with an identity |
| GoodMem | Source-preserving memory, weighted dense and sparse retrieval, optional reranking and answers | Free commercial self-hosting, 14-day cloud trial | Cloud from $15/mo, compute and storage billing | Proprietary free binary, SDKs Apache-2.0 | Enterprise agents needing retrieval control, permissions and deployment flexibility |
| Cognee | Graph plus vector, pluggable | $0 cloud, 1M tokens, or self-host | $2.50 per 1M tokens | Free forever, Apache-2.0 | A graph without a vendor |
| LangMem | Store primitives for LangGraph | Library only | n/a | Yes, MIT | Existing LangGraph stacks |
Mem0

Mem0 is the most widely adopted platform here and the usual starting point for fact-style memory: 63,900-plus stars on the Apache-2.0 repository, a $24M raise in October 2025, and an SDK that drops into an existing app in about six lines. The current PyPI release is mem0ai 2.0.19.
The fast path is what it does well. You add messages, search with a user filter, and get back scored memories with categories attached. Dream, announced August 24, 2026, adds background consolidation: it runs weekly per project, marks superseded memories as merged or superseded with a pointer to their replacement, and synthesizes summaries when a pattern emerges. None of that runs on the request path, so add and search latency stay flat.
The gotcha is pricing shape. Graph memory and Dream both sit on the $249/month Pro plan, and the cheap tiers are metered generously for writes but stingily for reads: Starter includes 50,000 adds and only 5,000 retrievals per month, and a chat agent retrieves at least once per turn.
Pricing: Hobby free (10,000 adds, 1,000 retrievals/month) · Starter $19/month (50,000 adds, 5,000 retrievals) · Pro $249/month (500,000 adds, 50,000 retrievals, graph memory, Dream) · Enterprise custom
The open-source package is the same core engine running against your own vector store and LLM keys, defaulting to Qdrant plus OpenAI, so the self-hosted path is real rather than a teaser. Mem0 also publishes OpenMemory, a local-first MCP memory server shared across Claude Desktop, Cursor and other MCP clients.
Python# pip install mem0ai && export OPENAI_API_KEY=sk-... from mem0 import Memory m = Memory() messages = [ {"role": "user", "content": "I ship to Austin, TX and prefer Postgres over MySQL."}, {"role": "assistant", "content": "Noted: Austin shipping address, Postgres preference."}, ] m.add(messages, user_id="u_1042") hits = m.search( "which database does this user prefer?", filters={"user_id": "u_1042"}, top_k=5, ) for hit in hits["results"]: print(round(hit["score"], 3), hit["memory"])
Note filters={"user_id": ...} on search. Older tutorials pass user_id= directly and that no longer matches the 2.x signature, which is the most common paste-and-fail in Mem0 code today.
Zep

Zep is the graph-native option, built on Graphiti, its Apache-2.0 temporal knowledge graph engine with more than 30,000 stars (currently graphiti-core 0.29.3). Every fact becomes an edge with a validity window, so contradicting information invalidates the old edge with its history intact.
Its published numbers are the strongest on latency at scale: 94.7% on LoCoMo at 155ms and 5,760 tokens, 90.2% on LongMemEval at 162ms and 4,408 tokens, and p95 retrieval under 200ms from small graphs up to more than 100 million nodes. It also does something the others do not: retrieval, storage, threads, users and graph storage are all unmetered. You pay for what you write, not what you read.
Model that billing carefully, because it is unusual. Zep bills credits by ingested bytes: one credit per episode up to 350 bytes, plus one more per additional 350 bytes or part thereof. A 640-byte message is 2 credits. A 1,200-byte JSON record is 4.
Pricing: Free (10,000 credits/month, 2 projects) · Flex $125/month or $1,250/year, 50,000 credits then $25 per 10,000 · Flex Plus $375/month or $3,750/year, 200,000 credits then $75 per 40,000 · Enterprise custom (SOC 2 Type II, HIPAA BAA, BYOK and BYOC)
The catch is self-hosting. Zep Community Edition was discontinued in April 2025; the repository stays Apache-2.0 but gets no updates. Self-hosting today means running Graphiti plus a compatible graph database (Neo4j, FalkorDB or Kuzu) plus your own service layer, which is a different operational commitment than docker run. Graphiti's MCP server (now at mcp-v1.0.2) is the shortcut if all you want is memory for your coding agents.
Python# pip install zep-cloud from zep_cloud.client import Zep from zep_cloud.types import Message client = Zep(api_key="z_...") client.user.add(user_id="u_1042", email="dana@example.com", first_name="Dana") client.thread.create(thread_id="t_88", user_id="u_1042") client.thread.add_messages( "t_88", messages=[ Message( role="user", name="Dana Reyes", content="We moved the deploy to us-east-1 last Tuesday.", ) ], ) # One string, already assembled, ready to drop into your system prompt. context = client.thread.get_user_context(thread_id="t_88").context
The get_user_context call is worth copying even if you pick a different vendor. Zep hands back an assembled context block rather than a list of chunks you rank and format yourself, which removes a surprising amount of glue code.
Letta

Letta comes from the Berkeley team behind MemGPT, raised a $10M seed, and its Apache-2.0 server has more than 24,000 stars. Its model is different in a way that matters: Letta does not sell you a memory API to call from your agent, it gives you the agent. State lives on the agent in editable memory blocks the model can rewrite with its own tools, and enable_sleeptime=True lets a background agent reorganize those blocks between turns.
Be clear-eyed about the direction. Letta's own "next phase" post describes a shift to Letta Code, with legacy server-side memory tools, templates, identities and tool rules deprecated in favor of client-side filesystem access and git-backed context repositories. The new Agent SDK (August 17, 2026) is TypeScript-first, the Python letta-client package has not seen a release since June 2, 2026, and letta.com/pricing now 301s straight to the Letta Code pricing docs. If you want a stable memory-as-a-service API for something shipping this quarter, Letta is the riskiest of the three. If you want a stateful coding agent with real memory, it is the most interesting.
Pricing: Free $0 (3 stateful agents, bring your own model keys) · Personal Pro $20/month (up to 20 stateful agents) · API plan $20/month plus $0.10 per active agent per month and $0.00015 per second of tool execution · Teams Pro $20/seat/month · Enterprise custom
Python# pip install letta-client from letta_client import Letta client = Letta(api_key="sk-let-...") agent = client.agents.create( model="openai/gpt-4.1", memory_blocks=[ {"label": "human", "value": "Name: Dana. Works on payments at a Chicago fintech."}, {"label": "persona", "value": "Concise engineering assistant. Cites files."}, ], enable_sleeptime=True, ) reply = client.agents.messages.create( agent_id=agent.id, messages=[{"role": "user", "content": "What did we decide about the deploy region?"}], )
Self-hosting is a Docker server with your own model provider keys, and the whole stack including Letta Code (npm i -g @letta-ai/letta-code) is Apache-2.0.
GoodMem

GoodMem, from PAIR Systems, is a strong option for enterprise agents that need persistent access to business knowledge while keeping control over retrieval, permissions and deployment. It stores the original source material and retrieves passages linked to that evidence. That material can be documents, operational guidance or durable lessons the agent or application chooses to keep: in PAIR's production-agent study, the guidance the agent retrieved was built from earlier conversations, with the application deciding what to store rather than the storage API extracting it on its own. PDF and Office ingestion extend the same memory to the files a business already has.
Retrieval is where it gives you the most control. Embedders, rerankers and LLMs are registered resources with their own IDs, a space can weight several embedders for hybrid dense and sparse search, and a reranker attaches per query. Those models can be hosted providers or local inference endpoints, including TEI and vLLM, so teams that need document processing to stay inside their own infrastructure can point GoodMem at their own models. A query can return source-linked chunks directly, or run an optional post-processor that reranks them and has an LLM write the answer, so the application gets either the raw evidence or a finished response. In PAIR's hybrid-search experiment on SQuAD, MiniLM plus SPLADE reached 0.8147 MRR@10 against 0.7069 for dense-only MiniLM, with the code and run data public. PAIR also reports 28% lower aggregate token consumption (95% interval 2% to 47%) and a 53% reduction in median tokens per query in its production BI-agent experiment. Those are two measures from one workload, so read them like the LoCoMo numbers above: a vendor run, not a guarantee.
GoodMem Cloud's Retrieval Optimizer is the managed version of this guide's advice to test on your own workload. It compares embedding and reranking combinations on your content and representative queries, screening candidates on one set of queries and comparing finalists on a separate held-out set, and reports retrieval-quality estimates with uncertainty, so you choose a pipeline from evidence rather than an unrelated leaderboard. It evaluates existing model weights; fine-tuning is a separate workflow, and the free self-hosted build does not include the optimizer.
For security reviews, GoodMem checks retrieval permissions before searching the requested spaces. An existing space the caller is not authorized to search fails the request with a 403 (a space that does not exist returns 404) instead of returning a partial result from the other spaces. Roles, service identities and scoped API keys limit what each agent can reach, and optional retrieval logging records query activity under policies an administrator defines; it covers retrieval calls, not every API operation. Core application data stays in PostgreSQL with pgvector, so teams run storage with database tooling they already know and no separate vector database. Model inference still needs its own endpoints and compute.
GoodMem can also keep page images from PDFs, Word documents, presentations and spreadsheets, so an application can show the source or pass visual evidence to a multimodal model. This is set per memory: on by default for file uploads in the CLI, opt-in through the API and SDKs. When enabled, images dominate storage. In PAIR's storage analysis, page images were about 80% of an 80-page PDF's 48 MB stored footprint, and text documents with page images off came to roughly six times their source size, with actual requirements depending on the document and indexing settings. At that analysis's storage prices, the example document costs about $0.13 a year to store, an illustrative figure rather than a GoodMem Cloud quote.
The tradeoff is that GoodMem leaves memory lifecycle decisions to the application. It does not extract facts automatically or reconcile conflicting ones, and replacing stored content currently means deleting the old memory and creating a new one. Applications can attach version or effective-date metadata at ingestion, apply metadata filters at retrieval, and explicitly remove superseded material. That gives teams control over which sources can answer a query, but they have to define the update policy themselves.
GoodMem's server is proprietary and distributed under the GoodMem Free Binary License, so "free" describes the price, not open source. The license permits covered commercial self-hosting and embedding GoodMem within an application, including as an internal component of a commercial SaaS product. Offering GoodMem itself as a standalone managed service needs a separate agreement, and the free license grants no source-code rights; enterprise agreements can add source access and reseller or managed-service rights. The client SDKs (Python goodmem 0.1.41, plus TypeScript, Java, Go and .NET) are Apache-2.0, and there are official Claude Code and ChatGPT plugins.
Pricing: Self-hosted free for covered commercial use · GoodMem Cloud from $15/month, with compute billed per second while an instance runs plus stored data (pausing stops compute charges, not storage), 14-day free trial with no credit card · Enterprise custom (on-prem or VPC, source code access, 99.99% SLA)
Python# pip install goodmem # Prerequisites: a GoodMem server (self-hosted or Cloud) reachable over trusted TLS, # its URL and API key, and keys for the providers you register. OpenAI and Voyage # are illustrative choices; local TEI or vLLM endpoints register the same way. import os import sys import time from goodmem import Goodmem client = Goodmem( base_url=os.environ["GOODMEM_BASE_URL"], api_key=os.environ["GOODMEM_API_KEY"], ) # One-time setup: register the retrieval stack and create a space. embedder = client.embedders.create( display_name="OpenAI small", model_identifier="text-embedding-3-small", # provider, URL, dims auto-filled api_key=os.environ["OPENAI_API_KEY"], ) reranker = client.rerankers.create( display_name="Voyage rerank-2.5", model_identifier="rerank-2.5", api_key=os.environ["VOYAGE_API_KEY"], ) space = client.spaces.create( name="u_1042", space_embedders=[{"embedder_id": embedder.embedder_id}], ) # Application calls: store content, wait for ingestion, then retrieve. mem = client.memories.create( space_id=space.space_id, original_content="Dana moved the deploy to us-east-1 and prefers Postgres.", ) deadline = time.monotonic() + 120 # adjust for your document sizes while True: status = client.memories.get(id=mem.memory_id).processing_status if status == "COMPLETED": break if status == "FAILED": raise RuntimeError("Memory ingestion failed") if status not in ("PENDING", "PROCESSING"): raise RuntimeError(f"Unexpected ingestion status: {status}") if time.monotonic() >= deadline: raise TimeoutError("Memory ingestion did not complete within 120 seconds") time.sleep(1) events = client.memories.retrieve( message="Which region does this user deploy to?", space_ids=[space.space_id], reranker_id=reranker.reranker_id, stream=False, ) for event in events: if event.status: # e.g. a reranker warning that came with fallback results print(f"{event.status.code}: {event.status.message}", file=sys.stderr) if event.retrieved_item and event.retrieved_item.chunk: print(event.retrieved_item.chunk.chunk.chunk_text)
reranker_id alone reranks the chunks without an LLM; add llm_id and the same call also returns an LLM-written answer. Printing status events matters because a reranker warning can arrive with fallback results, which would otherwise look like a successful rerank.
Open Source Options Worth Self-Hosting

Cognee is the most complete self-hosted option if you want a graph and vector store with no vendor in the loop: Apache-2.0, more than 30,000 stars, currently 1.5.3. The 1.x API is four verbs (remember, recall, forget, improve, with the older add/cognify/search still working) and the storage layer is genuinely pluggable, with Kuzu by default for the graph (Neo4j, Postgres, Turso, Neptune supported) and LanceDB for vectors (PGVector, Qdrant, Chroma, Weaviate, Milvus available). Self-hosting is free forever; the hosted option is metered on tokens rather than seats.
Pricing: Free $0/month (1M tokens, 1 workspace, unlimited API calls) · Standard $2.50 per 1M tokens plus $5 per additional workspace · Enterprise custom (BYO cloud, support SLA)
Python# pip install cognee import asyncio import cognee async def main(): await cognee.remember("Dana approved the Q3 checkout rewrite and prefers Postgres.") print(await cognee.recall("who approved the checkout rewrite?")) asyncio.run(main())

Hindsight from Vectorize is the benchmark story of 2026. MIT licensed, more than 21,000 stars, and it reports 64.1% on the hardest BEAM tier at 10M tokens against 40.6% for Honcho and 24.9% for a RAG baseline. It self-hosts through Docker Compose, Helm or pip install hindsight-all with no Hindsight account, though retain and recall still call an LLM, so you supply a provider key either way. If your workload is long-horizon and retrieval quality is the thing you are optimizing, it belongs on the shortlist on measured results alone.
Pricing: Self-hosted free · Hindsight Cloud usage-based, with free credits to start and no fixed monthly or per-seat fee

Memori from MemoriLabs takes the no-rip-and-replace angle: Apache-2.0, more than 16,000 stars, turning agent execution into structured state on top of databases you already run, with managed cloud, single-tenant, VPC and on-premises deployments. It is the option when the blocker is a security review rather than a benchmark, but check the quote before you get attached: the open-source build is free on your own database, and the managed tiers start at $60,000/year.
Pricing: Open source self-hosted free (bring your own database) · Cloud Free $0/month (5,000 memories created, 15,000 recalled) · Team from $60,000/year (single production agent, multi-tenant cloud) · Business from $150,000/year (single-tenant) · Enterprise custom (customer VPC or on-premises)
Two more to know about. Honcho from Plastic Labs is well regarded and AGPL-3.0. AGPL allows commercial use, but if you modify Honcho and users interact with it over a network, you must offer them your modified source, so your legal team will want to review it before you embed it in a commercial product. The hosted service gives each new account a dedicated instance and $100 in credits. LangMem is MIT and small, the pragmatic pick if you are already all-in on LangGraph.
What the Benchmark Numbers Mean
LoCoMo and LongMemEval are multi-session conversation benchmarks: given a long synthetic dialogue, can the system answer questions about it. These are the numbers on every pricing page, and vendor runs use different harnesses, models and retrieval budgets, so a two-point gap is not a ranking. BEAM pushes the same idea to 1M and 10M tokens, where context stuffing stops being an option at all.
MemoryArena, a 2026 benchmark from researchers at Stanford, UCSD, UIUC, Princeton and Pitt, is the one that should change how you evaluate. It puts the agent in a continuous loop across web navigation, constrained planning and formal reasoning, where later steps depend on what it learned earlier, and finds that systems near saturation on LoCoMo perform poorly there. Recall and behavior are different capabilities.
The practical version: run a small eval on your own transcripts before you commit. Fifty real conversations with twenty questions you care about will tell you more than any published score, especially about the failure mode that hurts most in production, which is confidently returning a fact the user already corrected.
Cost Math on a Real Workload
Take a support agent handling 2,000 conversations a month, twelve messages each, so 24,000 messages at roughly 600 bytes apiece, with one context retrieval per turn.
On Zep, each 600-byte message is 2 credits, so ingestion is about 48,000 credits and all 24,000 retrievals are free. That fits inside Flex's 50,000 included credits at $125/month, or $104/month billed annually, and read volume never changes the bill.
On Mem0, writes are cheap and reads are the constraint. 24,000 adds sits comfortably inside Starter's 50,000, but 24,000 retrievals blows through Starter's 5,000 limit and, among Mem0's published standard tiers, lands you on Pro at $249/month. Batching adds per conversation drops you to 2,000 adds, but retrieval count is set by your turn count, not your batching.
GoodMem uses a different billing model. Cloud charges for instance compute while it runs and for stored data, with no per-memory, per-API-call or per-seat charge, which makes a retrieval-heavy workload like this one worth evaluating against plans with retrieval allowances. Higher traffic can need more compute, and the embedding, reranking and LLM providers you register bill separately, so the $15 entry price is not a quote for this workload; pricing it properly needs an instance size, a stored corpus and model choices. Self-hosting carries no license fee for covered commercial use, with infrastructure and inference costs on you.
The tradeoff is not "Zep is cheaper," it is that the three meter different things. Model your own read-to-write ratio before comparing sticker prices, and sanity check the token side with the AI Token Counter and the LLM Token Cost Calculator, because a layer that returns 6,000 tokens per turn instead of 25,000 usually saves more on inference than it costs in subscription.
Which One Should You Pick
Prototype or side project: Mem0's Hobby tier or Cognee locally. Both get you working memory in an afternoon with no credit card.
Shipping a SaaS or consumer chat product: Mem0 Starter at $19/month if retrieval volume is low, Pro at $249/month once you need graph memory, Dream or real read headroom. Least intrusive SDK of the three, and the OSS escape hatch is real.
Relational or temporal questions, or an audit requirement: Zep. Validity windows on facts, provenance back to the source episode, unmetered reads, and SOC 2 Type II plus a HIPAA BAA at Enterprise. Check your byte volume against the credit math first.
Data cannot leave your infrastructure: Cognee or self-hosted Memori, or Graphiti with Neo4j if you want Zep's temporal model without Zep's cloud. Self-hosted GoodMem fits here too: point it at local TEI or vLLM endpoints and your own PostgreSQL, and content never has to reach a hosted model. Memori's managed and VPC tiers start at $60,000/year, so price the open-source build first. Budget for the graph database as an operational dependency, not a footnote.
Enterprise agents needing control over knowledge, retrieval and deployment: GoodMem is a strong first option to evaluate. It combines source-preserving ingestion, configurable dense and sparse retrieval, optional reranking and response generation, and permissions for different agents and teams. Teams can run it on their own PostgreSQL and model endpoints, or use GoodMem Cloud. It is particularly well suited to applications that retrieve business knowledge and durable operational guidance under explicit access policies.
Long-horizon agents where recall quality is the product: Hindsight, on measured BEAM results, with the caveat that it is younger than the rest.
A stateful agent rather than a memory API: Letta, with eyes open about the shift toward Letta Code.
Already using Claude for everything: try the memory tool first. A /memories directory mapped onto your own storage covers a real share of "the agent should remember this" at zero incremental cost. Reach for a platform when you need cross-session search over thousands of users, relational queries, or a story for your security reviewer.
Conclusion
All four commercial platforms work. The differences that will decide your project are technical as well as commercial: whether memory should be extracted facts (Mem0, Zep), agent-owned state (Letta) or preserved source material with retrieval you configure (GoodMem), what your read-to-write ratio costs, whether stale facts have to be invalidated or merely outranked, and how much of the stack you can run yourself. The open-source side has closed most of the gap, so "we do not want to build this" is a weaker reason to sign than it was a year ago.
Whichever you pick, wire it behind a small interface of your own (remember(user_id, messages) and recall(user_id, query) is enough), then run fifty real conversations through it including a few where the user changes their mind. That test takes a day and will tell you more than every benchmark table in this post, including the one above.
Related DevToolLab Tools and Reading
- AI Token Counter - Measure how big your retrieved context block actually is before it hits the model
- LLM Token Cost Calculator - Compare memory-backed prompts against full-context replay
- Cosine Similarity Calculator - Check embedding similarity by hand when the wrong memory ranks first
- MCP Server Config Generator - Build the client config for OpenMemory, Graphiti MCP or any memory server
- AI Agent Memory in 2026 - The three-tier architecture behind every platform in this guide
- Context Engineering Guide - How to budget and structure the context window memory feeds
