← Back to the blog A row of brass-bound ledgers on an oak shelf in late-afternoon sun, one open with a pressed ribbon marking the latest page.

7 Best Memory APIs for AI Agents (October 2026)

Compare seven memory APIs for AI agents on pricing, free tiers, self-hosting, memory model, MCP support, and published LoCoMo and LongMemEval results.

A memory API stores what an agent learns about a person or a task and puts the relevant part back into the context window on a later turn. The providers differ in how they store it (extracted facts, a graph with dates, or plain files), who decides what gets saved, and whether you can run it yourself. Our AI agent memory explainer covers the underlying ideas; this post compares the tools. Details below were checked against each provider's official pages in October 2026.

What is the best memory API for AI agents?

For most agents that need to remember users, start with Mem0: add and search memories with one API, hosted or self-hosted, with a hosted MCP server. Use Zep when facts change over time and you need to know which version is current, Letta when you want the whole agent to be stateful rather than adding a memory store, Supermemory for user profiles plus document search in one call, Cognee to turn documents and conversations into an open-source knowledge graph, LangMem if you already build on LangGraph, and the Claude memory tool when you want the model to keep its own files in storage you control.

API Consider it when you need… What to evaluate
Mem0 Per-user memories from conversations with little setup Whether extracted facts stay correct when the user changes their mind
Zep Facts with dates, and history of what changed Credit cost of your ingestion volume, and graph quality on your data
Letta A stateful agent runtime that edits its own memory Whether you want a runtime, not only a memory store
Supermemory User profiles and document retrieval from one API Ingestion cost in SM tokens at your volume
Cognee An open-source knowledge graph built from your content Graph extraction quality and LLM cost during ingestion
LangMem Memory tools inside a LangGraph agent The storage, hosting, and tuning you take on yourself
Claude memory tool Readable memory files on storage you own Your handler's path checks, size caps, and cleanup

How do memory APIs compare on pricing and features?

The main differences are the billing unit (requests, credits, tokens, or nothing at all), the shape of the memory, and whether you can run it on your own infrastructure. All figures come from the linked official pages.

API Free tier Paid pricing Open source and self-hosting Memory model MCP server
Mem0 10,000 adds and 1,000 retrievals a month for the first 30 days; 50,000 adds and 10,000 retrievals with your own LLM key (pricing) Usage-based past the limits, with a monthly cap you set; Custom plan by contract. No list prices published Apache 2.0; self-hosted server with Docker (repo) Facts extracted from conversations, searched by meaning, with entity linking; graph memory on Custom Hosted at mcp.mem0.ai, 11 tools (docs)
Zep 10,000 credits a month (pricing) Flex $125 a month for 50,000 credits, Flex Plus $375 for 200,000. 1 credit per 350 bytes ingested; retrieval and storage are free Zep is cloud, with bring-your-own-cloud on Enterprise. Its graph engine, Graphiti, is Apache 2.0 Temporal knowledge graph; facts carry valid and invalid dates (facts) Context MCP Server at api.getzep.com/mcp, sign-in through your identity provider, seats by plan (docs)
Letta Free plan: up to 3 stateful agents, 5 MiB per memory repository (pricing) API plan $20 a month, plus $0.10 per active agent a month and model tokens at cost Apache 2.0; local runtime or self-hosted App Server, no Letta account needed (self-hosting) Memory blocks stored as Markdown files in a git-backed repository; some pinned to the prompt, the rest read on demand Hosted at api.letta.com/mcp to create and message agents, API key auth (docs)
Supermemory $5 of credits a month (pricing) Pro $19, Max $100, Scale $399 a month; memory ingestion $0.005 per 1,000 SM tokens MIT; local version as a single binary or Docker (repo) Extracted memories, user profiles, and document search in one index Hosted at mcp.supermemory.ai, open source
Cognee 1M tokens and 1 workspace (pricing) $1 per 1M tokens processed, $5 per extra workspace Apache 2.0; free to run locally or on your own stack (repo) Knowledge graph plus vector search Included in the self-hosted server; Cognee Cloud also reachable over MCP (docs)
LangMem Free library, MIT (repo) Your storage and LLM calls Library only; runs wherever your agent runs Semantic, episodic, and procedural memory in a LangGraph store Not stated on the pages we checked
Claude memory tool Part of the Claude API (docs) A separate fee is not stated on the pages we checked; you pay for model tokens and your own storage Client-side: storage is yours Files under a /memories directory Not applicable; it is a tool in the Messages API

What does an AI agent need from a memory API?

An agent needs the right facts back in few tokens, a way to notice that a fact changed, and a way for someone to see and delete what was saved. Consider a support agent that hears this over two months:

In August: “We're on the Pro plan and I prefer email over calls.” In October: “We moved to the Team plan last week. Can you check why our invoice doubled?”

Answering well touches four capabilities:

  • Extraction: the plan and the contact preference have to be pulled out of chat and saved for this customer, not for everyone.
  • Updates: “Team plan” must replace “Pro plan”. A store that keeps both as equal facts gives the model two answers.
  • Retrieval: the invoice question should pull the plan change and its date, not every memory about this customer.
  • Control: the customer can ask you to forget them, so you need to list and delete memories by user.

The invoice amount itself does not belong in memory. It lives in the billing system, and the agent should look it up each time. Our explainer lists what else to keep out.

Mem0

The default choice for adding per-user memory to an existing agent.

You send conversation turns to Mem0; it extracts facts, links the entities they mention, and returns the relevant ones when you search for a user or agent. The open-source version is Apache 2.0 and runs as a Python library or a self-hosted Docker server.

The pricing page now lists two plans. Free includes 10,000 adds and 1,000 retrievals a month for the first 30 days with model calls on Mem0, or 50,000 adds and 10,000 retrievals with your own LLM key. Past that, billing is usage-based with a monthly cap you set; graph memory, SSO, and on-prem are on the Custom plan. The hosted MCP server exposes 11 tools for adding, searching, updating, and deleting memories.

Zep

A strong fit when facts change and the agent must know which version is current.

Zep builds a temporal knowledge graph per user. Each fact is an edge with timestamps for when it became true and when it stopped being true, so a newer message can invalidate an older fact without deleting its history. Retrieval returns a prompt-ready Context Block. The graph engine, Graphiti, is Apache 2.0 and runs on Neo4j, FalkorDB, or Amazon Neptune if you want to host it yourself.

Pricing is per credit: one credit for each 350 bytes you send, while retrieval, storage, and users are free. The free plan has 10,000 credits a month; Flex is $125 a month for 50,000. The Context MCP Server lets a person's own MCP client read their memory after signing in through your identity provider. Graphiti's reference MCP server has no authentication, so keep it local.

Letta

Worth evaluating when you want a stateful agent, not a memory store beside one.

Letta is an agent runtime in which memory is part of the agent. Memory blocks are now Markdown files in a git-backed repository the agent owns. Files under system/ are in the prompt every turn; the agent reads the rest on demand and edits its memory with tools. Optional background “dreaming” subagents review recent conversations and consolidate what was learned.

The code is Apache 2.0, and the self-hosted runtime needs no Letta account. On Letta Cloud, the API plan is $20 a month plus $0.10 per active agent and model tokens at cost. Its hosted MCP server lets another agent create and message Letta agents rather than read raw memories.

Supermemory

An option when you want user memory and document search behind one API.

Supermemory ingests text, conversations, URLs, and files, extracts memories, and resolves contradictions between them. A profile call returns stable facts and recent context for a user, and hybrid search covers memories and documents together. Connectors sync Google Drive, Notion, GitHub, and others. The repository is MIT and includes a local version that runs as one binary or in Docker.

Pricing is credit based. The free plan includes $5 of credits a month and Pro is $19 a month for $20 of credits. Ingestion costs $0.005 per 1,000 SM tokens, its unit for content processed. The hosted MCP server at mcp.supermemory.ai has three tools: save or forget, recall, and load a user's profile.

Cognee

The open-source choice for turning documents and conversations into a knowledge graph.

Cognee converts text into entities, relationships, and searchable chunks, and code into a graph of symbols and dependencies. Its operations are remember, recall, improve, and forget; recall picks graph, vector, or code context for the question. It is Apache 2.0 and ships an MCP server with the self-hosted Docker setup.

Cognee Cloud is free for 1M tokens and one workspace, then $1 per 1M tokens processed and $5 per extra workspace. It suits agents that answer from a body of material more than ones that track one user's preferences.

LangMem

A good fit when your agent already runs on LangGraph.

LangMem is an MIT library, not a service. It gives the agent tools to save and search memories during a conversation, and a background manager that extracts and consolidates memories afterwards. Its conceptual guide separates semantic memory (facts), episodic memory (past interactions as examples), and procedural memory (how the agent should behave, including prompt updates).

Memories live in LangGraph's long-term store. The default in-memory store loses data on restart, so production use needs a database-backed store such as Postgres. There is no per-request fee; you pay for the store and the model calls.

Claude memory tool

A candidate when you want the model to keep plain files you can read and edit.

Anthropic's memory tool lets Claude view, create, edit, rename, and delete files under /memories. It runs client-side: Claude asks for the file operation and your application performs it against storage you control, such as a per-user directory or database rows. It is available on Claude 4 and later models, and the Python and TypeScript SDKs include a ready-made local filesystem handler.

There is no extraction pipeline or search index; Claude decides what to write and reads its own notes. The docs make your handler responsible for path traversal checks, size caps, and expiring old files. It works only with Claude models, so a multi-model agent needs another layer.

What do the benchmarks say about memory APIs?

Almost every published score for these products is vendor-run, and the vendors disagree about each other's numbers. We have not run our own benchmark. Read the results below as claims with a stated setup, not as a ranking.

The two common benchmarks are academic. LoCoMo tests recall over very long conversations of about 300 turns. LongMemEval (ICLR 2025) uses 500 questions across information extraction, multi-session reasoning, temporal reasoning, knowledge updates, and abstention.

Published by Benchmark Reported result
Mem0, April 2025 paper LoCoMo 26% relative improvement over OpenAI's memory on an LLM-judge score; 91% lower p95 latency and over 90% fewer tokens than full context
Mem0, README LoCoMo, LongMemEval 92.5 and 94.4 for its April 2026 algorithm on the managed platform; Mem0 notes the open-source SDK will not match exactly
Zep, January 2025 paper DMR, LongMemEval 94.8% vs 93.4% for MemGPT on DMR; accuracy up to 18.5% higher and latency 90% lower than baselines on LongMemEval
Zep, rebuttal post LoCoMo 75.14% for Zep (after a correction), against 65.99% in Mem0's paper and about 68% for Mem0's graph variant
Letta, August 2025 post LoCoMo 74.0% with GPT-4o mini and plain file search tools, no dedicated memory layer

Two findings matter more than any single score. Zep's post reports a full-context baseline near 73% on LoCoMo, and Letta reached 74% with file search, so LoCoMo may not stress memory much. Zep also notes that LoCoMo does not test knowledge updates, which is the failure in the support example above. LongMemEval does test updates and abstention. Supermemory and Cognee also publish self-reported results on their repository pages; the same caution applies.

Mem0 vs Zep vs Letta: which should you choose?

Choose by where you want memory to live:

  • Mem0 to add memory to an agent you already have. Send turns in, search memories out, keep your own loop.
  • Zep when facts change over time. Dated facts and invalidation are the core of the design.
  • Letta when the agent itself should be stateful. You adopt its runtime, and memory comes with it.

Pick the closest fit, then run one alternative on the same history.

How do you test a memory API on your own task?

Take 10 to 20 real conversation histories, replay them into two or three providers, and ask the same follow-up questions in a fresh session. Keep the model and prompt fixed so only the memory layer changes.

Question type What a useful result looks like
A stated preference from an early session Recalled without the user repeating it
A fact that changed later The new value, ideally with when it changed
Something never mentioned “I don't know”, not a guess
A question that spans several sessions Pieces from each session combined correctly
Another user's detail Never returned
A deletion request The memory is gone from later answers

Record accuracy, the tokens each retrieval adds to the prompt, latency, and ingestion cost. Then read what each provider actually stored. A wrong answer can come from a bad extraction, a missed update, or a search that returned the wrong memory, and each needs a different fix.

How do I connect a memory API to my agent without writing glue code?

Use a provider's hosted MCP server. Mem0, Supermemory, Zep, and Letta all run one, and Cognee's self-hosted server includes one. The agent then gets save and search tools without custom code.

In Dexto, connections accept any custom MCP server, and Dexto discovers the tools that server offers. Add the memory server's URL in Connections settings, or ask Dexto to connect it for you. This is useful when the same memory also serves agents you built in your own product. Our MCP server shortlist covers other servers worth connecting.

Where does Dexto fit?

The APIs above are parts you assemble into your own agent. Dexto is the agent, with memory already built in. A memory store is one piece; you also need standing instructions, procedures, files, and a schedule. That surrounding system is the harness, and it is what Dexto provides.

  • Memory: Dexto's Memory learns preferences and decisions from your conversations, and you manage what it has saved in the Brain app.
  • Projects: a project groups related chats with instructions, skills, apps, and connections, so standing context loads every time.
  • Skills: a skill holds a repeatable method and loads when a task calls for it.
  • A computer: Dexto has a persistent cloud computer where it stores files, runs code, and opens browsers, so the record of past work stays in files rather than in memory.

If you are building an agent into your own product, pick an API from this list. If you want an agent that remembers how you work, Dexto already does that, and you can still connect one of these servers.

Try it in Dexto

Tell Dexto one preference you are tired of repeating, then start a new chat and see it applied. Open Dexto or read the quickstart.