Memory you can verify — a trust layer between an AI coding agent and its own past: per-hit staleness verdicts, claim-level use attribution, measured effectiveness, episodic run-state. MCP-native, local-first, MIT, no cloud.
Project description
Claude forgets you. Every session starts from zero: the stack you explained yesterday, the deploy quirk you debugged last week, the "we use uv, not pip" you have now said eleven times.
bettermemory gives Claude Code — or any MCP client — memory that survives the session and distrusts itself on your behalf. Every stored fact is a claim that has to keep earning belief: checked against the filesystem and git before the model relies on it, tracked when it shapes an answer, curated when the evidence says it rotted. You operate none of it. The agent does.
Install
Paste this into your agent:
Install bettermemory as my memory server: read https://github.com/0Mattias/bettermemory and follow the "For agents" section of the README.
That's the whole install. Prefer to do it yourself? Two commands:
uv tool install bettermemory
bettermemory init --client claude-code # or claude-desktop / cursor / continue / cline
Restart the client and you're done. Want proof before wiring anything
up? uvx bettermemory try runs a 60-second offline demo in a
throwaway store: it writes a memory citing a file, deletes the file,
and shows the next search flag the memory as stale.
What that feels like
Three weeks ago, mid-session:
> for the record: staging deploys go through Fly now, the Render
setup is dead
⏺ Stored: "Staging deploys via fly deploy --config fly.staging.toml;
the old Render service is decommissioned." (projects:acme)
Today, brand-new session, no context given:
> staging is 404ing after every deploy. ideas?
⏺ You have a stored note that staging deploys through Fly and Render
is gone — last verified 3 weeks and 41 commits ago, so checking it
before relying on it… fly.staging.toml still exists, but its
internal_port changed on Monday. That's the 404: the app listens
on 8080, the config still says 3000.
> fix it
⏺ Fixed. Re-verified the memory too, so the next session inherits it
fresh instead of re-checking.
(Illustrative transcript.) Two things happened that a raw session cannot do: it remembered across a three-week gap, and it distrusted itself exactly enough to catch that the world had moved since.
Why this one
- It knows when it might be wrong. Every hit carries a staleness verdict built from calendar age, the file paths it cites, and the commits landed since it was last confirmed.
- It stays out of your context. Nothing is auto-injected; retrieval is a deliberate tool call, announced when it shapes an answer.
- It refuses to hoard. Transient state, secret-shaped tokens, and near-duplicates bounce at write time; claims about you stage for your confirmation.
- It's your data, on your disk. One markdown file per memory — greppable, hand-editable, git-syncable. No database, no cloud, no account. MIT.
- It proves it's helping. A built-in eval reports how often memory actually shaped a reply. Numbers, not vibes — published.
For agents
You were likely handed this link with "set this up." 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,continue,cline. For any other MCP host, plainbettermemory initprints the canonicalmcpServersJSON snippet plus known config locations.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
You shouldn't need it, but it's all written down: mechanics, storage format, the full tool surface, CLI, configuration, and limitations in docs/internals.md; per-client setup in docs/clients.md and docs/installation.md; eval methodology in docs/eval.md; postmortems in docs/incidents/; release history in CHANGELOG.md; dev setup and the compatibility contract in CONTRIBUTING.md.
MIT licensed — see LICENSE.
Project details
Release history Release notifications | RSS feed
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-3.25.0.tar.gz.
File metadata
- Download URL: bettermemory-3.25.0.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae333ac8cb74867168b46cb0626792b59f32c5c5012040427a94d755f3dbd00c
|
|
| MD5 |
70e6a54d2407ac5a397604e7cea78d89
|
|
| BLAKE2b-256 |
28caaa8ff607a1377822093a8400f66db17d02c4b8f28015ae34eaa73a03becd
|
Provenance
The following attestation bundles were made for bettermemory-3.25.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-3.25.0.tar.gz -
Subject digest:
ae333ac8cb74867168b46cb0626792b59f32c5c5012040427a94d755f3dbd00c - Sigstore transparency entry: 2195685714
- Sigstore integration time:
-
Permalink:
0Mattias/bettermemory@62a1d75a4cf7eadd1a6c214f8a2afab0567b5225 -
Branch / Tag:
refs/tags/v3.25.0 - Owner: https://github.com/0Mattias
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@62a1d75a4cf7eadd1a6c214f8a2afab0567b5225 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bettermemory-3.25.0-py3-none-any.whl.
File metadata
- Download URL: bettermemory-3.25.0-py3-none-any.whl
- Upload date:
- Size: 749.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b7c64ff4fc9d0ba6916027801f7c64e0508b4aaafcd34429ea9b18ad0d9eeed
|
|
| MD5 |
027646633441131688cfe73cbbc77a7d
|
|
| BLAKE2b-256 |
f1dee17950c1eb68acedd0355158f9115589f34c5da28eca6e1e9b8268b3b268
|
Provenance
The following attestation bundles were made for bettermemory-3.25.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-3.25.0-py3-none-any.whl -
Subject digest:
8b7c64ff4fc9d0ba6916027801f7c64e0508b4aaafcd34429ea9b18ad0d9eeed - Sigstore transparency entry: 2195685725
- Sigstore integration time:
-
Permalink:
0Mattias/bettermemory@62a1d75a4cf7eadd1a6c214f8a2afab0567b5225 -
Branch / Tag:
refs/tags/v3.25.0 - Owner: https://github.com/0Mattias
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@62a1d75a4cf7eadd1a6c214f8a2afab0567b5225 -
Trigger Event:
push
-
Statement type: