mnemosyne-oss/mnemosyne

Zero-cloud AI memory that works everywhere. SQLite-backed. One pure-Python dependency.

Mnemosyne – Local‑first AI Memory for Agents

What it is

Mnemosyne is an open‑source, SQLite‑backed memory layer that any LLM‑powered agent can use. It stores facts, embeddings, and temporal triples locally and can be accessed via:

  • a MCP server (a simple JSON‑over‑STDIO / SSE / HTTP protocol) that works with many existing agents (Claude Code, Cursor, Codex, OpenWebUI, etc.),
  • a Python SDK (remember, recall), or
  • a Hermes plugin for the Hermes agent framework.

All of this runs with a single pip install mnemosyne-memory and needs no external vector DB or cloud service – the only dependency is the SQLite database file.

Core ideas

Component Role
Working memory Hot context that is automatically injected before LLM calls; items expire after a TTL.
Episodic memory Long‑term storage using SQLite‑vec + FTS5 for hybrid vector‑keyword search.
TripleStore Temporal knowledge‑graph (subject‑predicate‑object) with versioning.
BEAM (Bilevel Episodic‑Associative Memory) The overall architecture that combines the three layers and scores results as 50 % vector similarity + 30 % FTS5 rank + 20 % importance.

Vectors are binary (MIB) – 384‑dim float embeddings are compressed to 48 bytes, giving a 32× size reduction and allowing Hamming‑distance search directly inside SQLite.

How you use it

CLI (quick start)

pip install mnemosyne-memory          # core
pip install "mnemosyne-memory[all]"   # full feature set

# start a MCP server (default stdio)
mnemosyne mcp

# store and retrieve facts
mnemosyne store "User prefers dark mode"
mnemosyne recall "preferences"

Python SDK (embed in any agent)

from mnemosyne import remember, recall

remember("User prefers dark mode", importance=0.9)
results = recall("dark mode", top_k=3)

You can also set scope, expiry, extract entities, or let an LLM extract facts (extract=True).

Integration examples

Platform Integration method
Cursor, Claude Code, Codex, Windsurf Add an MCP entry in the platform’s *.json config.
OpenWebUI Drop a one‑line bridge file into data/tools/.
OpenClaw Install mnemosyne-memory[openclaw] and reference the provider in the config.
Hermes Agent Install mnemosyne-hermes; the plugin registers a memory provider automatically.
Any Python agent import mnemosyne and call the SDK.

Full integration guides live under docs/integrations/.

Benchmarks (as reported)

  • BEAM end‑to‑end QA (100 K items): 65.2 % (v3.0.0, May 2026) – comparable to other open‑source memory systems.
  • BEAM pure recall: Recall@10 stays at ~20 % from 100 K up to 10 M items, while latency drops to 35 ms for 10 M and storage grows sub‑linearly (7.2 MB for 10 M entries).
  • LongMemEval: Previously claimed 98.9 % recall, but the run has been withdrawn pending a reproducible re‑run.

The key takeaway is that recall quality stays flat as the corpus grows, and the system uses episodic compression to keep storage tiny.

Security & privacy model

  • Local‑first: By default nothing leaves the machine.
  • Optional sync: Bidirectional delta sync between devices, with client‑side encryption (AES‑128‑CBC or XSalsa20‑Poly1305). The server only sees metadata.
  • No telemetry: No analytics or cloud calls unless you enable a remote embedding API.
  • Configurable TLS for any remote sync or embedding endpoint.

Configuration highlights

Variable Default What it controls
MNEMOSYNE_DATA_DIR ~/.hermes/mnemosyne/data Location of the SQLite file
MNEMOSYNE_VEC_TYPE int8 Vector compression format (float32, int8, bit)
MNEMOSYNE_EMBEDDING_API_URL OpenRouter endpoint Remote embedding service (if you don’t run local embeddings)
MNEMOSYNE_EMBEDDING_MODEL BAAI/bge-small-en-v1.5 Which embedding model to use
MNEMOSYNE_WM_MAX_ITEMS 10000 Size of the hot working‑memory cache

Environment variables let you tune weighting (MNEMOSYNE_VEC_WEIGHT, FTS_WEIGHT, IMPORTANCE_WEIGHT) and recency decay.

Who might use it?

  • Developers building custom LLM agents who want a persistent, searchable memory without running a separate vector DB.
  • Teams deploying on‑premise or edge devices (Raspberry Pi, low‑RAM VPS) because the whole stack fits in a few hundred MB.
  • Privacy‑conscious users who need encrypted sync across devices.

Where it stands

Mnemosyne is a real, actively maintained open‑source project (MIT license) that targets the same problem space as Mem0, Letta, Honcho, etc., but distinguishes itself by:

  • being pure‑Python with a single SQLite file,
  • offering a built‑in MCP server for plug‑and‑play with many existing agents, and
  • providing client‑side encrypted sync as a core feature.

All details above are taken directly from the repository’s README.

Related

  • Project
  • Project
  • Project
  • Project
  • Project