8 Best AI Agent Memory Frameworks in 2026: Mem0, Zep, Letta and More

We ran the same memory job through four open source memory frameworks, installed all eight tools, and compared default telemetry, prompt size per memory write, install size, advisories, and pricing.

Last updated October 24, 2026. We installed all eight memory tools that day, ran the same memory job through the four open source libraries with every request captured, and checked releases, downloads, advisories, docs, and pricing on GitHub, PyPI, and each vendor’s site.

The best AI agent memory frameworks in 2026 are Mem0 for drop in user memory, Zep and Graphiti for facts that change over time, and Letta for agents that manage their own memory, with four more picks for specific stacks. We tested these AI agent memory frameworks on October 24, 2026, and the gaps showed up in what each one sends to your model and to outside servers.

This guide sits in our agent frameworks hub, and our guide to the 12 best AI agent frameworks covers the orchestration layer that memory plugs into. Here we focus on the memory layer itself: what each tool stores, how it decides what to remember, and what it costs to run in production.

We ran the same two conversation memory job through Mem0, Graphiti, Cognee, and LangMem five times against a scripted local model, logging every model call and every outbound connection. No vendor paid for placement or reviewed this page, per our editorial standards and disclosure policy.

TL;DR

  • Pick Mem0 for user memory with the least code. It led on PyPI with 2,020,516 downloads last month and stored 3 clean facts per run, but each write sent 35,876 bytes to the model in a single call.
  • Pick Zep or Graphiti when facts change over time. Graphiti tracks when each fact became true, and Zep sells it as a managed service from $125 per month.
  • Pick Letta for agents that edit their own memory. Its API Plan is $20 per month plus $0.10 per active agent, and its open source code now ships as Letta Code.
  • Three of four libraries phone home by default. Cognee made 26 outside connection attempts per run, Mem0 13, and Graphiti 3, while LangMem made 0.
  • Cognee is the heaviest install. It pulled 174 packages and 1,230 MB, and pip-audit flagged 41 advisories, 37 of them in Pillow 12.3.0.
  • Graphiti needed two fixes in a clean install. Version 0.31.2 failed to import until we added httpx, and its deprecated Kuzu backend crashed, so we used embedded FalkorDB Lite.

AI Agent Memory Frameworks at a Glance

Every library we ran stored and recalled the same facts, so the real differences are memory model, data leaving the network, install weight, and price. The table compares fit, defaults, and entry pricing from vendor pages, GitHub, PyPI, and our test on October 24, 2026. Cloud only services were checked on docs and pricing.

ToolBest forMemory modelSelf hostOutside calls by defaultFirst paid tier
Mem0User facts for chat assistantsVector store plus optional graphYes, Apache 2.013 (PostHog, GitHub)Starter $19 per month
ZepManaged temporal memoryTemporal knowledge graphEnterprise BYOC onlyNot tested, cloud serviceFlex $125 per month
GraphitiSelf hosted temporal graphsBi temporal knowledge graphYes, Apache 2.03 (PostHog)Free, you run the graph database
LettaAgents that manage their own memoryMemory blocks plus archival storeYes, App ServerNot testedPro $20 per month
CogneeDocuments turned into a memory graphGraph plus vectorYes, Apache 2.026 (telemetry, LiteLLM)Standard $1 per 1M tokens
SupermemoryManaged memory API with connectorsManaged memory graphYes, DockerNot testedPro $19 per month
LangMemLangGraph agentsMemories in the LangGraph storeYes, MIT0Free
MemoriMemory inside your own SQL databaseStructured records in your databaseYes, bring your own databaseNot testedTeam from $60K per year
Eight AI agent memory tools compared on fit, memory model, hosting, telemetry, and entry pricing. Sources: vendor pricing pages, GitHub, PyPI, and an AgentStack test on October 24, 2026.

Verdict: Choose Mem0 when you want user facts in a few lines of code, Graphiti or Zep when the order of events matters, and Letta when the agent itself should decide what to keep. Choose LangMem if you already run LangGraph, and Cognee when your memory starts as a pile of documents.

Bar chart of outbound connection attempts per run: Cognee 26, Mem0 13, Graphiti 3, LangMem 0
Outbound connection attempts during one memory run with default settings and a blocked network, from an AgentStack hands-on test on October 24, 2026. Image: AgentStack.

What an Agent Memory Framework Adds Beyond RAG

A memory framework decides what to remember from a conversation, updates or retires old facts, and returns only the relevant ones later, which plain retrieval over documents does not do. RAG answers from a fixed corpus, while memory changes after every turn, so the extraction step and the update rules matter most.

  • Extraction: a model call turns raw messages into short facts such as “lives in Lisbon”. Every library we ran does this, and it is where most of your memory token spend goes.
  • Update and conflict handling: when Maya moves from Berlin to Lisbon, a good system replaces or dates the old fact instead of keeping both as equally true.
  • Retrieval: an embedding search, a graph walk, or both, scoped by user, agent, or session.
  • Decision rule: if your agent only needs the current conversation plus a document index, you need RAG and a longer context window, not a memory framework.

How We Tested Eight Memory Tools

To compare libraries on equal terms, we fed each one the same two conversations: Maya says she lives in Berlin, works at Acme, is vegetarian, and is allergic to peanuts, then later says she moved to Lisbon. Each library wrote both conversations to memory and then answered one search query.

  • Scripted local model: every LLM and embedding call went to a local server that answered from the JSON schema in each request, so runs were offline, free, and repeatable.
  • Native API per library: Mem0 Memory.add with a local Qdrant store, a Graphiti add_episode on embedded FalkorDB Lite, Cognee add plus cognify, and a LangMem store manager on the LangGraph in memory store.
  • Five runs per setting: defaults for all four, plus telemetry switched off for Mem0, Graphiti, and Cognee.
  • Network check: a logging proxy refused every outbound connection, which is what a locked down production network does, and we recorded each host a run tried to reach.
  • Install and health for all eight: a fresh Python 3.12 virtual environment per package, package count, disk size, pip-audit, GitHub stars, license, and PyPI downloads, all checked the same day.

Zep, Supermemory, and Memori cloud, plus the hosted Letta API, need accounts and send data to the vendor by design, so we judged them on docs, SDK installs, and published pricing rather than traffic logs.

What Our October 24 Hands-On Test Found

All four open source libraries completed the memory job in 5 of 5 runs, and their request sizes were identical across runs, so the gaps below come from design rather than chance. The biggest spread was in how much text each one sends to the model to store a single update, which drives your memory token bill.

Bar chart of bytes sent to the model per memory write: Mem0 35,876, Graphiti 18,547, LangMem 7,445, Cognee 7,432
Request bytes sent to the LLM when adding a two message update to existing memory, from an AgentStack hands-on test on October 24, 2026. Image: AgentStack.
  • Mem0 sends the biggest prompt: one LLM call per write, but 35,876 bytes, about five times LangMem, because its extraction prompt carries long instructions and examples.
  • Graphiti splits the work: 2 LLM calls and 5 embedding calls per episode, 18,547 bytes, and graph tools add calls as real models return more entities.
  • LangMem grows with what it knows: its first write sent 3,404 bytes and the second 7,445, because it passes existing memories back to the model to update them.
  • Cognee spends at search time: writes were light at 7,432 bytes, but its default search made 3 LLM calls and sent 25,227 bytes to answer one question.
  • Blocked telemetry slows cold starts: Mem0 took a median 8.3 seconds per run with telemetry on and 1.2 seconds with it off.

Memory runs on every turn, so a large extraction prompt multiplies across every user and every session. Track that spend with the LLM cost monitoring tools we tested, and trace memory calls with the AI agent observability tools we reviewed.

1. Mem0: Best for User Memory With Little Code

Mem0 pricing page showing Hobby free, Starter at 19 dollars, Pro at 249 dollars, and Enterprise custom plans
Mem0 pricing page with the Hobby, Starter, Pro, and Enterprise plans, captured October 24, 2026. Image: Mem0.

Mem0 is the default pick for adding user memory to an assistant, because one add call extracts facts and one search call returns them. It is Apache 2.0 licensed with 67,731 GitHub stars, the most on this list, and drew 2,020,516 PyPI downloads last month.

In our test it stored 3 facts per run in a local Qdrant store and made 1 LLM call per write. Telemetry is on by default and tried us.i.posthog.com and raw.githubusercontent.com 13 times per run, and MEM0_TELEMETRY=False dropped that to 0, as the open source docs describe.

from mem0 import Memory

config = {
    "llm": {"provider": "openai", "config": {"model": "gpt-4.1-mini"}},
    "vector_store": {"provider": "qdrant", "config": {"path": "./qdrant"}},
}
m = Memory.from_config(config)   # set MEM0_TELEMETRY=False first
m.add(messages, user_id="maya")
hits = m.search("Where does Maya live?", filters={"user_id": "maya"})
  • Best for: Chat assistants and support agents that need per user facts with minimal setup.
  • Pricing (October 2026): Open source is free. The hosted platform has a free Hobby tier with 10,000 adds and 1,000 retrievals per month, Starter at $19 per month, Pro at $249 per month with graph memory, and custom Enterprise.
  • Watch out for: The 35,876 byte extraction prompt on every write, and default telemetry.

2. Zep: Best for Managed Temporal Memory

Zep pricing page header stating that self serve plans are credit based and enterprise plans add deployment options
Zep pricing page header, captured October 24, 2026. Image: Zep.

Zep suits teams that want memory where every fact carries a time, delivered as a managed service with security reviews already done. It builds on Graphiti, so a fact like “lives in Berlin” is closed when “moved to Lisbon” arrives instead of competing with it.

The zep-cloud SDK installed in 12 packages and 16 MB and drew 292,185 PyPI downloads last month. Self hosting now means the Enterprise bring your own cloud option on the pricing page, so teams that need open source on their own servers should run Graphiti instead.

  • Best for: Teams that want temporal memory, SOC 2 Type II, and HIPAA BAA without running a graph database.
  • Pricing (October 2026): A free tier with 10,000 credits per month. Flex is $125 per month with 50,000 credits, then $25 per 10,000. Flex Plus is $375 per month with 200,000 credits, and Enterprise is custom.
  • Watch out for: Credit math, since each credit covers up to 350 bytes of an episode, so long transcripts burn credits quickly.

3. Graphiti: Best for Self Hosted Temporal Graphs

Graphiti GitHub repository page showing 32.2k stars, Apache 2.0 license, and release v0.31.2
Graphiti repository on GitHub, captured October 24, 2026. Image: Zep.

Graphiti is the open source engine behind Zep, and it is the best choice when you want a bi temporal knowledge graph on your own infrastructure. It is Apache 2.0 licensed with 32,176 GitHub stars and 619,128 PyPI downloads last month, and it supports Neo4j, FalkorDB, and Amazon Neptune.

Our clean install of graphiti-core 0.31.2 failed on import with No module named 'httpx', because the package imports httpx without declaring it, and openai 3.37.0 no longer pulls it in. Adding httpx fixed it. The Kuzu backend is marked deprecated and crashed in add_episode, so we used the embedded FalkorDB Lite extra, which worked in 5 of 5 runs.

pip install "graphiti-core[falkordblite]" httpx
export GRAPHITI_TELEMETRY_ENABLED=false   # PostHog is on by default
  • Best for: Teams that need facts with validity windows, such as account status, prices, or user preferences that change.
  • Pricing (October 2026): Free under Apache 2.0. You pay for the graph database and model calls, or move to Zep for a managed version.
  • Watch out for: Packaging gaps in the current release and a graph database to operate.

4. Letta: Best for Agents That Manage Their Own Memory

Letta docs pricing page describing plans for individuals, teams, and developers
Pricing page in the Letta docs, captured October 24, 2026. Image: Letta.

Letta treats memory as part of the agent, with editable memory blocks in the context window and an archival store the agent searches through tools. The project began as MemGPT, has 25,242 GitHub stars under Apache 2.0, and its Python client drew 161,915 PyPI downloads last month.

Expect a moving target. The Letta repository says source now lives in Letta Code, installed from npm, and that the V1 API server moved to an archive branch. In our test pip install letta installed a single 254 MB package with a bundled binary, while the Python client was 14 packages and 13 MB.

  • Best for: Long running assistants and coding agents that should rewrite their own memory over time.
  • Pricing (October 2026): Free with your own model keys and up to 3 stateful agents. Pro is $20 per month for up to 20 agents, and the API Plan is $20 per month plus $0.10 per active agent and $0.00015 per second of tool execution.
  • Watch out for: Architecture churn, so pin versions and read the migration notes before you build on the server.

5. Cognee: Best for Turning Documents Into Memory

Cognee GitHub repository page showing 32.7k stars, Apache 2.0 license, and topics such as agent memory and graph RAG
Cognee repository on GitHub, captured October 24, 2026. Image: Cognee.

Cognee fits teams whose memory starts as documents, because add plus cognify builds a knowledge graph and vector index that agents can query later. It is Apache 2.0 licensed with 32,718 GitHub stars and 86,048 PyPI downloads last month, and it runs fully on your own stack.

It was the heaviest and noisiest library we ran. The install pulled 174 packages and 1,230 MB, the first offline run failed until we pre-seeded a tiktoken file, and each run tried test.prometh.ai 23 times plus a LiteLLM price list 3 times. TELEMETRY_DISABLED=1 stopped the first, and LITELLM_LOCAL_MODEL_COST_MAP=True stops the second.

  • Best for: Knowledge heavy agents that answer from company documents, tickets, and notes.
  • Pricing (October 2026): Open source is free. Cloud starts free with 1M tokens and 1 workspace, Standard costs $1 per 1M tokens plus $5 per extra workspace, and Enterprise is a BYOC engagement.
  • Watch out for: Install weight and 41 pip-audit advisories, 37 of them in Pillow 12.3.0, fixed in 13.0.0.

6. Supermemory: Best for a Managed Memory API With Connectors

Supermemory pricing page stating pay for what you use with credits included on every plan, and the Pro plan at 19 dollars
Supermemory pricing page, captured October 24, 2026. Image: Supermemory.

Supermemory suits product teams that want memory as an API with connectors, so user content from tools such as Gmail flows in without custom ingestion code. It is MIT licensed with 31,370 GitHub stars, and its SDK installed in just 12 packages and 12 MB.

The vendor claims the top score on LongMemEval, LoCoMo, and ConvoMem, which we did not verify. Its README now documents a Docker self host path with Ollama, and telemetry turns off with SUPERMEMORY_DISABLE_TELEMETRY=1.

  • Best for: Consumer and SaaS apps that want hosted memory plus content connectors.
  • Pricing (October 2026): Free with $5 of credits per month, Pro at $19 per month with $20 of credits, Max at $100 with $130, Scale at $399 with $600, and custom Enterprise.
  • Watch out for: Vendor benchmark claims, so run your own recall test on real conversations.

7. LangMem: Best for LangGraph Agents

LangMem docs overview listing a core memory API, memory tools, a background manager, and LangGraph store integration
LangMem documentation overview, captured October 24, 2026. Image: LangChain.

LangMem is the natural memory layer for LangGraph agents, with tools the agent calls in the hot path and a background manager that consolidates memories later. It is MIT licensed with 1,722 GitHub stars, yet it drew 773,504 PyPI downloads last month, mostly through LangGraph projects.

It was the quietest library in our test, with 0 outside connection attempts in every run and the smallest first write at 3,404 bytes. The catch is pace: the latest release, 0.0.30, shipped on October 27, 2025, so check the repository activity before you commit.

from langmem import create_memory_store_manager

manager = create_memory_store_manager(
    llm, namespace=("memories", "{langgraph_user_id}"), store=store
)
manager.invoke({"messages": messages}, config={"configurable": {"langgraph_user_id": "maya"}})
  • Best for: Teams already on LangGraph that want memory in the same store and checkpointing model.
  • Pricing (October 2026): Free and open source. LangGraph Platform and LangSmith are optional paid products.
  • Watch out for: A pre 1.0 version and a year since the last release.

8. Memori: Best for Memory Inside Your Own Database

Memori GitHub repository page describing agent native memory infrastructure with 17.1k stars
Memori repository on GitHub, captured October 24, 2026. Image: Memori Labs.

Memori suits teams that want memory stored as structured records in a database they already run, rather than in another vendor service. It has 17,145 GitHub stars, drew 16,441 PyPI downloads last month, and the README describes managed cloud, single tenant cloud, VPC, and on premises deployments.

Its Python package installed in 25 packages and 213 MB with a clean pip-audit result. Adoption is the smallest here, and the latest release, 3.3.6, shipped on May 28, 2026, so treat it as a strong fit for SQL heavy teams rather than a default.

  • Best for: Teams with strict data residency that want memory in their own Postgres or other SQL database.
  • Pricing (October 2026): Open source is free to self host with your own database, a Cloud Free tier covers light workloads, and Team starts at $60K per year.
  • Watch out for: Small community and a steep jump from free to the first paid tier.

Install Footprint and Dependency Advisories

Cognee installed 1,230 MB across 174 packages, almost five times the next largest option, and it was the only pick with open advisories. The chart shows disk size and package count from clean Python 3.12 environments on October 24, 2026, and the table adds versions, stars, licenses, and downloads.

Bar chart of install size: Cognee 1,230 MB, Letta CLI 254 MB, Memori 213 MB, Mem0 135 MB, down to Supermemory at 12 MB
Disk space and package count after a clean pip install of each memory tool in Python 3.12, from an AgentStack install test on October 24, 2026. Image: AgentStack.
ToolVersion testedGitHub starsLicensePyPI downloads, last monthpip-audit findings
Mem02.2.167,731Apache 2.02,020,5160
Zep (SDK)4.0.14,969 (zep)SDK on PyPI292,1850
Graphiti0.31.232,176Apache 2.0619,1280
Letta (client)1.12.125,242Apache 2.0161,9150
Cognee1.6.532,718Apache 2.086,04841 in 3 packages
Supermemory (SDK)5.0.031,370MIT141,6580
LangMem0.0.301,722MIT773,5040
Memori3.3.617,145Apache 2.0 on PyPI16,4410
Versions, adoption, licenses, and pip-audit results for eight AI agent memory tools. Sources: PyPI, GitHub, pypistats, and an AgentStack install test on October 24, 2026.

Download counts favor libraries pulled in by bigger frameworks, so read them as reach rather than quality. Our LiteLLM supply chain report shows why a 174 package memory layer deserves the same review as any production dependency.

How to Run Agent Memory Without Outside Calls

Three of the four libraries we ran send data out by default, and each one stops with a single environment variable, so set them before the first import. Pin your model and embedding endpoints too, because memory libraries make far more model calls than a typical agent turn.

# Telemetry switches we verified on October 24, 2026
export MEM0_TELEMETRY=False
export GRAPHITI_TELEMETRY_ENABLED=false
export TELEMETRY_DISABLED=1                 # Cognee
export LITELLM_LOCAL_MODEL_COST_MAP=True    # stops the LiteLLM price list fetch
export SUPERMEMORY_DISABLE_TELEMETRY=1      # per the Supermemory README

# Air gapped hosts: pre-download the tiktoken file Cognee needs
export TIKTOKEN_CACHE_DIR=/opt/tiktoken
  • Route model calls through one gateway: the LLM gateways we reviewed keep every extraction and embedding call in one place for logging and budgets.
  • Scope memory by user from day one: pass a user or tenant id on every write and search, since retrofitting scopes means migrating stored facts.
  • Treat memory as sensitive data: it holds personal facts, so apply the retention and access rules in our AI agent governance guide.
  • Test recall before launch: score answers on real conversations with the AI agent evaluation tools we compared.

What Each Option Costs in October 2026

Five of the eight tools are free to self host, so cost comes from model calls, the database you run, and any managed tier you choose. Pricing below comes from each vendor’s pricing page on October 24, 2026, and every figure excludes the model tokens you pay your provider for.

  • Mem0: Hobby is free with 10,000 adds per month, Starter is $19 per month, Pro is $249 per month with graph memory, and Enterprise is custom.
  • Zep: a free tier with 10,000 credits, Flex at $125 per month, Flex Plus at $375 per month, and Enterprise with BYOC.
  • Letta: Free with your own keys, Pro at $20 per month, and the API Plan at $20 per month plus $0.10 per active agent.
  • Cognee: free cloud tier with 1M tokens, then $1 per 1M tokens plus $5 per extra workspace.
  • Supermemory: Free with $5 of credits, Pro $19, Max $100, Scale $399 per month.
  • Memori: free self host and Cloud Free tier, then Team from $60K per year.
  • Graphiti and LangMem: no fee, so you pay for models and your database.

The model bill often outgrows the license. At the request sizes we measured, an assistant that writes memory on every turn sends tens of kilobytes per turn to the model, so compare tools on your own transcripts and watch spend with the cost monitoring tools we cover.

When You Should Not Add a Memory Framework

Skip a memory framework when each session stands alone, when facts live in a system of record you can query directly, or when you cannot yet govern stored personal data. In those cases a longer context window, a database lookup tool, or plain RAG is cheaper and easier to audit.

  • Stateless tasks: one shot extraction, classification, or code review jobs gain nothing from long term memory.
  • Facts that already have an owner: if the CRM holds the customer’s plan, give the agent a tool or an MCP server to read it rather than copying it into memory.
  • No deletion path: if you cannot delete a user’s memories on request, wait until you can, and review the AI agent security tools that watch agent data flows.

Which AI Agent Memory Framework Should You Choose?

The right pick depends on whether facts change over time, where data may live, and which agent framework you already run. Match your team to a profile below, then rerun our two conversation test on your own transcripts with requests logged before you commit.

Teams adding memory to a chat assistant

  • Start with Mem0 open source and telemetry off, or its hosted Starter tier.
  • Scope every call by user id and test recall on 50 real conversations.
  • Version the extraction prompt with the prompt management tools we compared.

Teams whose facts change over time

  • Run Graphiti on Neo4j or FalkorDB if you can operate a graph database.
  • Buy Zep if you want the same model managed with SOC 2 Type II and HIPAA BAA.
  • Add httpx to your requirements and avoid the deprecated Kuzu backend.

Teams on LangGraph

  • Use LangMem with the LangGraph store you already run.
  • Watch release activity, since the latest version shipped a year ago.
  • Trace memory tool calls with the agent observability tools we cover.

Teams with strict data rules

  • Pick LangMem, Graphiti, or Memori on your own database, and set every telemetry variable above.
  • Mirror the proxy test from this page in CI so new versions cannot add outside calls unnoticed.
  • Cover memory stores in your agent security program.

Frequently Asked Questions

What is the best memory framework for AI agents?

Mem0 is the best starting point for most teams, because one add call and one search call give an assistant per user memory, and it led PyPI downloads in our October 2026 check. Choose Graphiti or Zep when facts change over time, Letta for self editing agents, and LangMem on LangGraph.

Is Mem0 free and open source?

Yes. The Mem0 library is open source under Apache 2.0 and free to self host with your own model and vector store. The hosted platform adds a free Hobby tier with 10,000 adds per month, Starter at $19 per month, Pro at $249 per month, and custom Enterprise plans.

What is the difference between Zep and Graphiti?

Graphiti is the open source temporal knowledge graph engine, licensed under Apache 2.0, that you run on Neo4j, FalkorDB, or Neptune. Zep is the managed service built on Graphiti, with credit based plans from $125 per month and self hosting only through its Enterprise bring your own cloud option.

Do AI agent memory frameworks send data to third parties?

Some do by default. In our October 24, 2026 test, Cognee made 26 outside connection attempts per run, Mem0 made 13, and Graphiti made 3, mostly telemetry, while LangMem made none. Each stopped with one environment variable, such as MEM0_TELEMETRY set to False or TELEMETRY_DISABLED set to 1.

Do I need a memory framework or just RAG?

Use RAG when answers come from a fixed set of documents. Use a memory framework when the agent must learn facts from conversations, update them as they change, and recall them across sessions. Many production agents use both, with memory for user facts and RAG for company knowledge.

Read the agent frameworks hub, 12 best AI agent frameworks, AgentOps hub, AI agent observability tools, open source LLM observability, AI agent evaluation tools, AI agent testing tools, prompt management tools, LLM cost monitoring tools, LLM gateways, AI agent governance guide, agent security hub, AI agent security tools, MCP explained, MCP servers, and MCP security tools. Notes on how we work sit on editorial standards, disclosure, and contact.

The Bottom Line

Choose Mem0 for fast user memory, Graphiti or Zep when time matters, Letta for self editing agents, and LangMem if you already run LangGraph. The biggest findings across these AI agent memory frameworks were prompt size per write and default telemetry, so log both before you ship memory to production.

All eight tools release often, so rerun a logged test after each upgrade and check this page for updates. Send corrections or your own results through our contact page.