An MCP memory server for coding agents. Stored facts get checked against the filesystem and git before the model relies on them, so a memory that has rotted is flagged instead of quoted back at you.
Install
Claude Code — two slash commands, zero config:
/plugin marketplace add 0Mattias/bettermemory
/plugin install bettermemory@bettermemory
Anything else that speaks MCP:
uv tool install bettermemory
bettermemory init --client claude-desktop # or cursor / cline / claude-code
Restart the client. bettermemory doctor exits 0 when it's wired
correctly and prints a one-line fix for anything that isn't.
Try it without installing: uvx bettermemory try writes a memory
citing a file, deletes the file, and shows the next search flagging it.
Offline, throwaway store.
What it does
- Checks memory before believing it. Every hit carries a staleness
verdict: calendar age, whether the paths it cites still exist, and
the commits landed since it was last confirmed. Declared claims
(
path,path::symbol,path::NAME=literal) are re-checked against the working tree; a claim that stops being true blocks the stamp instead of riding along. - Retrieval is deliberate. Memory is a tool call, not an injection. Write gates bounce transient state, secret-shaped tokens and near-duplicates; claims about you stage for confirmation.
- The code is the model. Search is deterministic lexical ranking — keyword + BM25, fused — over your own vocabulary. No embedding models, no downloads, nothing to warm up, same answer every time.
- Plain files. One markdown file per memory. Greppable,
git-syncable, no cloud, no account. The SQLite index beside the
files is a derived cache you can delete;
bettermemory reindexrebuilds it. - Rot gets acted on, not accumulated. Episodes journal per-session run-state without polluting durable search; health telemetry and curation tools surface what drifted, what went cold, and what contradicts what.
- Receipts, not adjectives. The claims above are measured by
preregistered benchmarks with published artifacts — misses included
— in bench/, and
bettermemory evalscores whether memory actually helped against your own log (ours is published).
For agents
You were likely handed this link with "set this up." On Claude Code, the two plugin commands above are the whole install — skip to step 3. Everywhere else, steps are idempotent and safe to re-run:
uv tool install bettermemory— orpipx install bettermemory, orpip install bettermemoryinto a venv. Python 3.11–3.14.bettermemory init --client claude-code— likewiseclaude-desktop,cursor,cline. For any other MCP host, plainbettermemory initprints the canonicalmcpServersJSON snippet plus known config locations. (Continue needs a hand-written YAML entry — see docs/clients.md.)bettermemory doctor— exit 0 means correctly wired; every failed check prints a one-line fix.- Have the user restart the client so the server loads, then confirm by asking the model "what memory tools do you have?"
Your operating contract — tool signatures, retrieval discipline,
write gates — is docs/api.md; the server's
instructions block delivers the core policy automatically. For the
long-form policy in your system prompt: bettermemory init --with-addendum. Migrating from Claude Code's built-in auto-memory:
bettermemory ingest imports those files once.
Everything else
The rest is written down: mechanics, storage format, the full tool surface, CLI, configuration and limitations in internals; per-client setup in clients and installation; eval methodology in eval; postmortems in incidents; release history in CHANGELOG; dev setup and the compatibility contract in CONTRIBUTING.
MIT licensed — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bettermemory-5.1.0.tar.gz.
File metadata
- Download URL: bettermemory-5.1.0.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0da14bec22c420c617b129c43dd1c74ab52f89b5e203a3872dc22346258fe81b
|
|
| MD5 |
1a6a149d293498a6788aba9831066d60
|
|
| BLAKE2b-256 |
c411912cf96574328b4374a40e6ed15e39f18011f1fef9828b56d8990f50d40a
|
Provenance
The following attestation bundles were made for bettermemory-5.1.0.tar.gz:
Publisher:
release.yml on 0Mattias/bettermemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bettermemory-5.1.0.tar.gz -
Subject digest:
0da14bec22c420c617b129c43dd1c74ab52f89b5e203a3872dc22346258fe81b - Sigstore transparency entry: 2400949549
- Sigstore integration time:
-
Permalink:
0Mattias/bettermemory@b5d6ccd54b9ba144a1e502addb596c70c06c65c6 -
Branch / Tag:
refs/tags/v5.1.0 - Owner: https://github.com/0Mattias
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b5d6ccd54b9ba144a1e502addb596c70c06c65c6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bettermemory-5.1.0-py3-none-any.whl.
File metadata
- Download URL: bettermemory-5.1.0-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c8be97601dda99af89d883c3e880ddf4e820b2a95b75e9e3c6029349cc0d664
|
|
| MD5 |
06ef6e9a621b1f8751abb32eee326166
|
|
| BLAKE2b-256 |
f566d525cb563907dffee1073b210546966c24f3fb707af6899bba00faabab4d
|
Provenance
The following attestation bundles were made for bettermemory-5.1.0-py3-none-any.whl:
Publisher:
release.yml on 0Mattias/bettermemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bettermemory-5.1.0-py3-none-any.whl -
Subject digest:
3c8be97601dda99af89d883c3e880ddf4e820b2a95b75e9e3c6029349cc0d664 - Sigstore transparency entry: 2400949717
- Sigstore integration time:
-
Permalink:
0Mattias/bettermemory@b5d6ccd54b9ba144a1e502addb596c70c06c65c6 -
Branch / Tag:
refs/tags/v5.1.0 - Owner: https://github.com/0Mattias
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b5d6ccd54b9ba144a1e502addb596c70c06c65c6 -
Trigger Event:
push
-
Statement type: