Skip to content
Try Pro free for 14 days (card required)HeyBrain is now generally available.Start Free
Compare

Mem0 vs Zep: Which memory layer fits your agents?

Pick Mem0 if you want an open-source memory layer you can run yourself as a library or a server, or use hosted. Pick Zep if you want a hosted context layer that records when it infers each fact became true and, once replaced, when it stopped, built on its open-source Graphiti framework. Both work with Claude and other AI tools over MCP (Model Context Protocol, an open standard that lets AI tools call outside services).

  • Mem0's library (Python or npm) and self-hosted server are open source under Apache 2.0; the hosted Mem0 Platform is a separate managed service.
  • Zep is a hosted service; its Graphiti framework is open source under Apache 2.0, and Zep Community Edition was discontinued in April 2025.
  • Zep keeps dated facts in a temporal knowledge graph; Mem0's extraction adds new memories rather than overwriting old ones, and its hosted Platform supersedes outdated facts.
  • Both publish benchmarks that favour themselves, and a May 2025 Zep post disputes the LoCoMo results in Mem0's 2025 paper, so test each on your own data.
  • If you want your team's documents answered with sources under each person's permissions, HeyBrain is one knowledge layer you can add.

· 9 min read

Contents

Mem0 vs Zep

Which memory layer fits your agents

How do Mem0 and Zep compare?

Mem0 and Zep both give AI agents long-term memory through an API, SDKs and a hosted MCP server. They differ most on what is open source, who runs it and how memory changes over time: Mem0 extracts memories you can run yourself, while Zep is a hosted service that dates every fact. Each is described from its own pages, checked on November 24, 2026.

Checked against each company's official pages on November 24, 2026.
Mem0Zep
Made byMem0, a Y Combinator S24 companyZep, which also maintains the open-source Graphiti framework
ApproachA memory layer that extracts memories from conversations and links the entities in themA context layer that builds temporal context graphs from conversations, documents and business data, with connectors such as Google Drive, Notion and Slack
Open-source partsThe library and the self-hosted server, both Apache 2.0; the hosted Platform is a separate managed serviceGraphiti, the graph framework inside Zep, Apache 2.0; Zep Community Edition was discontinued in April 2025
Hosted optionThe Mem0 Platform; on-premises on the Custom planZep Cloud; your own model keys or bring-your-own-cloud in your VPC on Enterprise
How memory changes over timeA single extraction pass adds new memories rather than overwriting old ones; Mem0's MCP can update memories, and the hosted Platform supersedes outdated factsEach fact carries the dates Zep infers for when it became valid and, once replaced, when it stopped; a contradicting fact marks the old one invalid instead of deleting it
Frameworks and SDKsPython and npm SDKs, a CLI, and integrations such as LangGraph and CrewAIPython, TypeScript and Go SDKs, and integrations such as LangGraph, CrewAI, AutoGen, Mastra and the Vercel AI SDK
MCPA hosted MCP server for Claude Desktop, Claude Code, Codex, Cursor, Windsurf, VS Code and OpenCode; browser sign-in or an API keyA hosted Context MCP Server with OAuth 2.1 sign-in through Google Workspace, or your own identity provider on Enterprise; MCP seats by plan, from 1 on Free to 15 on Flex Plus
Sharing across agents or usersMemory kept per user, session and agent; organizations and projects with Reader and Owner rolesShared context graphs authorized per MCP connection, with a write toggle for each; SSO, SCIM and audit logs on Enterprise
Pricing modelA free plan with monthly limits on adds and retrievals, and usage past them billed up to a cap you set; a Custom plan on request with SSO, audit logs and on-premisesFree with 10,000 credits a month; Flex $125 a month; Flex Plus $375 a month; Enterprise custom
Best forAn open-source memory layer you can run yourself or use hostedHosted, governed context and memory that tracks how facts change over time

How does Mem0 store and update memory?

Mem0 stores memory by extracting it from conversations and keeping it per user, session and agent, so an assistant can remember a person across chats and an agent can remember what it did. Its current extraction runs in a single pass and adds new memories rather than overwriting old ones, and it links the entities that appear across them.

Memories can still change. Mem0's MCP can update them, and the hosted Mem0 Platform supersedes outdated facts. Search combines meaning, keywords and entities, with dates on the hosted Platform. The library, installed with pip or npm, and the self-hosted server are open source under Apache 2.0. The hosted Platform is a separate managed service, and Mem0's README notes that it includes optimizations the library does not. The Mem0 repository covers all three.

How does Zep store and update memory?

Zep stores memory as a temporal context graph: entities become nodes, and facts become links between them, each carrying the dates Zep infers for when it became valid and, once replaced, when it stopped. When new data contradicts a fact, Zep attempts to mark the old fact invalid and adds the new one, so an agent can query what Zep currently holds as valid and what it held before.

The graph is built with Graphiti, Zep's open-source framework for temporal knowledge graphs, licensed Apache 2.0. Graphiti runs only where you host it, with your own graph database such as Neo4j, FalkorDB or Amazon Neptune, plus your own LLM and embedding model. Its README presents the bundled MCP and REST servers as reference code rather than production servers, and warns that they have no authentication or authorization; Zep's hosted MCP server uses OAuth 2.1 sign-in. The Graphiti repository has the setup. Zep itself is hosted; its self-hosted Community Edition was discontinued in April 2025.

How Mem0 and Zep store and update memory: Mem0 extracts memories per user, session and agent and adds rather than overwrites; Zep builds a graph of facts with inferred dates and tries to mark old facts invalid when new ones contradict them.
How each one stores and updates memory

When should you pick Mem0?

Pick Mem0 when you want open source you control. The library runs inside your own app with pip or npm, the self-hosted server runs with Docker Compose, and both are Apache 2.0. Mem0 also fits when memory per user, session and agent is enough, and when you want a hosted MCP server that works with Claude, Cursor and Codex.

Its free plan covers unlimited end users. Mem0 pays for model calls for the first 30 days; after that you use your own LLM key, which also raises the monthly add and retrieval limits. Usage past the limits is billed, up to a monthly cap you set. For a side-by-side with HeyBrain, see how HeyBrain compares with Mem0, and for Mem0 against another memory API, see Supermemory vs Mem0.

When should you pick Zep?

Pick Zep when your agents must know how facts change over time, such as a customer's plan, an account's status or a preference that was later reversed. Each fact carries the dates Zep infers for when it held. Zep also fits teams that want a hosted service with nothing to run, connectors for company data, SDKs in Python, TypeScript or Go, and enterprise controls such as SSO and SCIM.

If you want Zep's graph approach but must host everything yourself, Graphiti is the open-source route, at the cost of running a graph database and your own models. Zep's paid plans are priced by monthly credits, and its MCP seats grow with the plan. For a side-by-side with HeyBrain, see HeyBrain vs Zep.

Five situations matched to Mem0, Zep, Graphiti or HeyBrain, from open source you run yourself to team documents answered with sources under each person's permissions.
Pick by what your agents need

Is Mem0 or Zep better on benchmarks?

Both publish benchmark results, and both publish results that favour themselves. Mem0 reports scores on LoCoMo, LongMemEval and BEAM and runs a page comparing itself with Zep. Zep publishes its own research, a page presenting itself as a Mem0 alternative, and a May 2025 blog post disputing the LoCoMo results in Mem0's 2025 paper. Neither set is a neutral comparison.

The most reliable test is a small evaluation on your own data: a few dozen real conversations, the questions your agents must answer, and a check on what each tool recalls, misses and gets wrong after facts change. Our overview of agent memory layers compared sets out what to test across five approaches.

Where does company knowledge fit next to Mem0 or Zep?

Company knowledge can come in through either tool or through a separate layer. Mem0 remembers what users and agents said. Zep also brings in documents and business data, through its API or connectors such as Google Drive, Notion and Slack. HeyBrain is one more option: a knowledge layer that connects Google Drive, Notion and GitHub and answers people and AI tools with sources, within the permissions you set.

People ask in Ask HeyBrain, while Claude, Cursor and Codex ask over MCP, and HeyBrain keeps activity records of the questions asked. It does not use connected content to train AI models. The split between the two layers is set out in agent knowledge vs agent memory.

Google Drive, Notion, GitHub, the Web Crawler and uploaded files connect to HeyBrain, which answers people in Ask HeyBrain and AI tools such as Claude, Cursor and Codex, beside Mem0 or Zep.
Company knowledge beside Mem0 or Zep

Frequently asked questions

Is Zep better than Mem0?

Neither is better for every case. Zep suits agents that must track how facts change, since each fact carries the dates Zep infers for when it held, and teams that want a hosted service with enterprise controls. Mem0 suits teams that want an open-source memory layer they run themselves. Test both on your own conversations before you choose.

What is Graphiti?

Graphiti is Zep's open-source framework for building and querying temporal knowledge graphs for AI agents, licensed Apache 2.0. Each fact has an inferred time window for when it held. It is self-hosted only: you bring a graph database such as Neo4j, FalkorDB or Amazon Neptune, plus an LLM and an embedding model. Zep's hosted service is built on it.

Is Mem0 open source?

Yes. Mem0's library and self-hosted server are licensed Apache 2.0, and the library installs with pip or npm. The hosted Mem0 Platform is a separate managed service with a free plan, and the README notes that it includes optimizations the open-source library does not, so results from the two versions can differ.

Which handles long conversations better?

Neither vendor's own numbers settle it. Both avoid replaying a whole history by extracting what matters: Mem0 keeps memories per user, session and agent, while Zep builds a graph of dated facts and keeps thread summaries. The fair test is a set of your own long conversations, checking what each recalls after facts change.

Can Mem0 or Zep share memory across agents?

Yes. Mem0 keeps memory per user, session and agent, and groups work into organizations and projects with Reader and Owner roles. Zep lets you authorize shared context graphs for each MCP connection and turn writing on or off for each one, with SSO, SCIM and audit logs on its Enterprise plan.

Do I need a memory layer if I already have a knowledge base?

It depends on what your agents must remember. A knowledge base holds what the company has written down; a memory layer such as Mem0 holds what users and agents said, like preferences, and Zep covers some of both. Teams can use both kinds: a memory layer for what was said, and a knowledge layer such as HeyBrain for shared documents.

The short version

Pick Mem0 for open source you control and Zep for hosted, governed context that tracks how facts change. If your team also wants its own documents answered with sources under each person's permissions, HeyBrain is one option to add beside them. For a knowledge graph engine you run yourself, see Cognee vs Mem0.

Yigit GokHeyBrain

Stay in the loop

Follow articles on AI knowledge, agent governance and product updates in your feed reader.

Follow the HeyBrain blog

Get new articles in your feed reader.

Subscribe via RSS →