Open source · Apache-2.0 · MCP-native
Memry is the long-term memory system for AI agents. You install it
with one pip install and it keeps everything in one
SQLite file. Claude Code, Cursor, Codex, ChatGPT and any other MCP client
share the same memory.
Get started
pip install memry (or straight from source:
pip install git+https://github.com/cosmin-novac/memry.git).
Python 3.11+, no other services.
You need a text model that extracts facts from what you save:
OPENAI_API_KEY (or Anthropic, or Ollama). You also need a decision
model that returns a calibrated probability for questions like whether two names
belong to one thing: MEMRY_DECISION_PROVIDER=jev and a TypeSafe key
in MEMRY_DECISION_API_KEY. Memry doesn't start without both. With
MEMRY_DECISION_PROVIDER=llm, Memry sends those questions to the text
model, merges entities only by fixed rules, and you confirm the other merges yourself.
In Claude Code, run claude mcp add memry -e OPENAI_API_KEY=… -e
MEMRY_DECISION_PROVIDER=jev -e MEMRY_DECISION_API_KEY=… -- memry mcp.
In Claude Desktop, Cursor or Windsurf, add the memry mcp command with
the same variables to your MCP config.
Tell your agent something worth keeping, then ask about it in a fresh
session. Inspect anytime: memry list, memry entities
proposals, or the dashboard via memry serve.
How it works
Most "memory" is retrieval over raw chat logs. Memry keeps the raw episodes and distills them into reconciled, contradiction-aware facts, so your agent remembers what's true now without losing the history of how it got there.
A scratchpad or a MEMORY.md file is text
your agent rereads at the start of every session. You keep it short by hand, and a
line that is no longer true is still in the file until you delete it. Memry is a
database that holds every fact your agents have saved and returns the few that fit
the question.
Every message is stored immutably before anything is derived. Memories are an index; episodes are the source of truth.
An LLM distills self-contained facts with type, importance, and entities. No LLM key? Verbatim mode still works.
Duplicates are skipped, refinements merge, contradictions invalidate the old memory and link its successor. Bi-temporal, fully audited.
BM25 + vectors fused by reciprocal rank, boosted by recency and importance. Every result shows its score signals.
Features
Point Claude, ChatGPT, Cursor, Codex and other MCP clients at the same Memry server. Something learned in one is immediately available to the others.
When something changes, the old fact stays in its history and the new one takes over. Nothing silently disappears, so your agent can distinguish what's true now from what was true before.
Raw episodes stay in the store, so when extraction improves you can rerun it over years of history and recover memories earlier versions missed.
Episodes, memories, embeddings, topics and entities live in one local store. No external database, vector service or cloud account.
Every memory links back to the exact conversation it came from, and every change is preserved. You can always see where something came from and how it changed.
Similar names aren't merged just because they look alike. Memry waits until there's enough evidence to know they're the same person, or until you confirm it yourself.
Connect any MCP client over stdio or streamable HTTP. No client-specific memory integration to build or maintain.
Memry ranks each result by how well it matches your words, how close it is in meaning, how recent it is and how important it is, so you find a memory whether you use its words in your question or only its meaning.
Old trivia gradually matters less, so stale details stop crowding out what matters without being deleted from your history.
Use Anthropic, OpenAI or Ollama for extraction, and choose between hosted or local embeddings. Memry doesn't lock your memory to one model provider.
Working out whether two people with the same name are the same person means picking one of three answers. Memry sends those questions to TypeSafe Jev, a model built for this kind of question. Jev returns a calibrated probability for each answer, so Memry merges duplicates on its own.
A built-in eval harness (recall@k, MRR, latency) runs offline in CI. Format LoCoMo or LongMemEval into JSONL and compare configs honestly.
Two ways in
any MCP client
{
"mcpServers": {
"memry": {
"command": "memry",
"args": ["mcp"]
}
}
}
# or for Claude Code:
$ claude mcp add memry -- memry mcp
python
from memry import MemoryStore store = MemoryStore() store.add("I'm Ada. I moved to Amsterdam.", user_id="ada") hits = store.search("where does ada live?", user_id="ada") ctx = store.reconstruct_context( "plan my commute", user_id="ada", token_budget=1200).text # drop into any prompt
The memory map
The memory map gives you a view across everything Memry has learned, grouped by the people, projects and tools in your memories, and by tags when you turn them on. You can inspect any part of it and see the memories behind it.
Memories, entities, edit history, and the conversations they came from all stay together in one place.
Run it on your laptop or a VPS. There’s no Memry account to create, and the only data that leaves the machine is whatever you send to the model provider you configure. With the default hash embedder and no LLM key, nothing leaves the machine at all.
And if you want to get rid of it, you delete the file.
So if Claude Code learns something in the morning, ChatGPT already knows it that afternoon. And if you switch models or vendors later, your memory stays where it is. You don’t have to start over.
Your work, your projects, the people around you, and the things you care about all end up in there. That’s unusually personal data. It shouldn’t have to live inside whichever AI product you happen to be using today, under terms that may look different a year from now.
Memry gives you somewhere independent to keep it.
If two entries clearly refer to the same person, they get merged. If a tag has drifted into two spellings, Memry flags it for review instead of guessing. Old trivia gradually matters less in ranking, so it stops getting in the way without disappearing.
Anything ambiguous waits for you under Upkeep, and each maintenance task can be turned off individually.
Compare
| Memry | Mem0 OSS | Zep | Recall MCP | |
|---|---|---|---|---|
| LLM extraction + reconciliation | yes | yes | yes | - |
| Temporal invalidation (supersede, not delete) | yes | platform only | yes | - |
| Provenance: fact → source episode | yes | partial | yes | - |
| Hybrid retrieval (BM25 + vector + recency) | yes | yes | graph | yes |
| Memory decay / forgetting | yes | platform only | retention | yes |
| Runs without extra services | SQLite only | needs vector DB | BYOC | SQLite |
| Built-in eval harness | yes | - | - | - |
| License | Apache-2.0 | Apache-2.0 | proprietary | open source |
Feature availability as of July 2026, self-hosted/OSS editions; see docs/research/competitive-analysis.md in the repo for sources.
Self-host
Memory is the most personal data an agent touches. Memry keeps it in a file you own, on a machine you control, under a license that can't be revoked.
MEMRY_API_KEYmemry export; account servers also back up auth.dbMEMRY_DECISION_PROVIDER=llm# bare metal $ pip install memry $ export OPENAI_API_KEY=… MEMRY_DECISION_PROVIDER=jev MEMRY_DECISION_API_KEY=… $ memry serve --host 0.0.0.0 --port 8787 → dashboard http://localhost:8787/ → REST API http://localhost:8787/api/v1 → MCP http://localhost:8787/mcp # or docker $ docker compose up -d
Research-grade
Memry doubles as a memory-systems research codebase: raw episodes are never thrown away, so better extraction pipelines can be replayed over history; every ranking signal is exposed; and the eval harness compares providers, weights, and even competing backends (a Mem0 adapter ships in the box) under identical conditions. Hierarchical compression, belief revision, and memory-type routing are on the open roadmap - contributions welcome.