v0.1 · free · source-availableGitHub →

How it works

A graph, not a guess.

Mneme is graph memory for your AI: one SQLite file on your machine that remembers what you tell it and finds the note that matters, even when it shares none of your words. This page explains how, and how to use it from the terminal, from Python, or from an agent. It is about a thousand lines of Python — when this page runs out, the source is the rest of the documentation.

01

Overview

Most memory tools either match keywords, which misses anything phrased differently, or embed everything with a model, which needs an API key, a download, and trust in a black box. Mneme takes a third path: it builds a graph of the entities in your notes — names, terms, numbers — and lets your question walk it.

The result is a memory that runs entirely on your machine with zero dependencies, answers in milliseconds, and can explain every answer: each result names the entities that carried it. The retrieval idea comes from HippoRAG 2, here over a co-occurrence graph instead of LLM-extracted triples.

02

Quickstart

pip install git+https://github.com/saranshahuja/mneme

mneme add "Northwind won't approve anything over 50k without a second signature. Budget owner is Dan Whitfield."
mneme add "Dan Whitfield is out the first week of October."

mneme ask "anything blocking us in October?"
1. Dan Whitfield is out the first week of October.
   score 1.00 · matched October
2. Northwind won't approve anything over 50k without a second signature. Budget owner is Dan Whitfield.
   score 0.58 · matched Dan Whitfield

That second result shares no word with the question except a stopword. It surfaces because Dan Whitfield links the two notes — which is the point of the graph. Everything lands in ~/.mneme/memory.db; point elsewhere with --db PATH or MNEME_DB=PATH.

The same four lines from Python: from mneme import Memory, then Memory().add("…") and .ask("…").

03

How answers work

Every note you add is scanned for entities with plain heuristics — capitalised spans, content words, numbers and dates. No model, no download, about a millisecond. Entities that appear in the same note get linked, and a link grows stronger each time the pair shows up together.

A question is scanned the same way, and its entities become the starting points of a Personalized PageRank walk over the graph. Notes rank by how much of the walk lands on their entities — so a note two hops away, sharing no words with your question, can still rank second because a person or a project bridges them.

Results are capped, not padded: -k is a maximum, and results scoring far below the top hit are dropped (tunable with --min-score, where 0 restores exact top-k). If nothing in the question is in the graph yet, recall falls back to SQLite full-text search and the result is labeled text match.

04

The CLI

mneme add
Remember text, a file (split on blank lines; short blocks are skipped and counted), or stdin via -.
mneme ask
Recall, best first. -k caps results, --min-score sets the relevance floor, --json for machines.
mneme stats
What is remembered: passages, entities, edges, and where the file lives.
mneme forget
Delete one passage by id — its entities and edges are cleaned up with it.
mneme mcp
Serve memory to an agent over MCP. Needs the [mcp] extra.

Every command accepts --db PATH before or after the subcommand, and respects MNEME_DB. Errors are one line on stderr, exit code 1 — pointing it at a PDF tells you so instead of printing a traceback.

05

For your agents

pip install 'mneme[mcp] @ git+https://github.com/saranshahuja/mneme'
claude mcp add mneme -- mneme mcp

Cursor and other MCP clients: add {"command": "mneme", "args": ["mcp"]} to your MCP config. The server is read-only — it exposes ask and stats, nothing that writes. You add memories from the terminal, and the agent sees them on its next call.

06

Privacy

Everything lives in one SQLite file on your disk. There is no server, no account, no telemetry, and no network code anywhere in the package — the base install has zero dependencies, so there is nothing to phone home with.

Delete a memory with mneme forget and its entities and links go with it. Move your memory by copying the file. The MCP server never sends your filesystem paths to the model it serves.

07

FAQ

Is it really free?

Yes. Licensed under the Functional Source License (FSL-1.1-ALv2): free for any use except building a competing product, and each version becomes Apache-2.0 two years after its release.

Why 'source-available' and not 'open source'?

Because words mean things. FSL is not an OSI-approved license, so we don't call it open source — but all of the code is public, about a thousand lines, and it turns into Apache-2.0 on a two-year fuse.

Why isn't it on PyPI?

The name 'mneme' belongs to an unrelated package last released in 2014, so pip install mneme gets you someone else's project. Install from GitHub until that resolves.

How much can it hold?

Thousands of passages, not millions — the graph is rebuilt in memory on each query, and the database runs several times the size of the source text. For a person's notes it's plenty; for a corpus it isn't the tool.

Does it work in other languages?

It leans English: the stopword list and light stemmer are English, though capitalised names and numbers work anywhere. Non-English recall degrades toward plain text search.

Where does my data live?

~/.mneme/memory.db, or wherever --db / MNEME_DB points. It's a normal SQLite file: copy it, back it up, open it with any SQLite tool.

A question this page didn't answer? The source is about a thousand lines — or open an issue on GitHub.

End of overview