Open source · Apache-2.0 · MCP-native
The self-hostable memory layer for AI agents. One
pip install, one SQLite file, plugged into
Claude Code, Cursor, or any MCP client - extraction, reconciliation,
and an audit trail your agents can trust.
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.
Claude Code: claude mcp add memry -- memry mcp. Claude Desktop,
Cursor, Windsurf: add the memry mcp command to your MCP config.
Works with zero keys (verbatim + keyword search). Set
ANTHROPIC_API_KEY or OPENAI_API_KEY and extraction,
reconciliation, and entity resolution switch on by themselves.
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 recalls what's true now, with the receipts for how it got there.
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
Eight tools over stdio or streamable HTTP. Claude Code, Claude Desktop, Cursor, Windsurf, Codex - one server, every agent, shared memory.
Episodes, memories, FTS5 index, embeddings, and events in a single file. Back it up with cp. No vector DB, no Postgres, no cloud.
BM25 keyword search plus deterministic hash embeddings out of the box. Add ANTHROPIC_API_KEY or OPENAI_API_KEY and extraction upgrades itself.
valid_from · invalid_at · superseded_by on every fact. "Forgotten" means invalidated and auditable - never silently destroyed.
Every memory links to the exact episodes it came from, and every mutation is an event you can replay with history().
Importance decays on a half-life; a sweep soft-forgets stale trivia so ten-month-old noise stops crowding out what matters.
user / agent / run scoping, mem0-compatible. Point several agents at one server and they share what they learn.
Anthropic, OpenAI, or Ollama for extraction; OpenAI, Voyage, Ollama, or local hashing for embeddings; swappable storage backends - including a Mem0 adapter.
Three ambiguous "Jonas" mentions stay three entities. Merges happen only when identity is clear, or when you confirm a recorded merge proposal.
Optional HNSW vector index (memry[ann]) and a PostgreSQL + pgvector backend (memry[postgres]) for multi-writer fleets.
Per-tenant API keys with transparent namespacing and strict isolation, plus category filters on every search surface.
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) # drop into any prompt
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 |
| Works with zero API keys | yes | no | no | 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)# bare metal $ pip install memry $ 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.