Skip to main content

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

bettermemory: memory that is checked before it is believed

PyPI CI Python 3.11-3.14 MIT

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

uv tool install bettermemory
bettermemory init --client claude-code   # or claude-desktop / cursor / cline

Restart the client. bettermemory doctor exits 0 when it's wired correctly and prints a one-line fix for anything that isn't.

Kick the tyres 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

  • Every hit carries a staleness verdict — calendar age, the paths it cites, commits landed since it was last confirmed.
  • Nothing is auto-injected; retrieval is a deliberate tool call. The 18 default tools do cost ~35 KB of schema per turn either way; the description half of that is capped in CI.
  • Write gates: transient state, secret-shaped tokens and near-duplicates bounce; claims about you stage for confirmation.
  • One markdown file per memory. Greppable, git-syncable. Markdown is canonical; the SQLite index next to it is a derived cache you can delete. No cloud, no account.
  • bettermemory eval measures whether memory actually helped, against your own log. Ours is published — a floor, from one user's store, caveats and misses included.

For agents

You were likely handed this link with "set this up." Steps are idempotent and safe to re-run:

  1. uv tool install bettermemory — or pipx install bettermemory, or pip install bettermemory into a venv. Python 3.11–3.14.
  2. bettermemory init --client claude-code — likewise claude-desktop, cursor, cline. For any other MCP host, plain bettermemory init prints the canonical mcpServers JSON snippet plus known config locations. (Continue needs a hand-written YAML entry — see docs/clients.md.)
  3. bettermemory doctor — exit 0 means correctly wired; every failed check prints a one-line fix.
  4. 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 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bettermemory-3.26.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bettermemory-3.26.0-py3-none-any.whl (795.1 kB view details)

Uploaded Python 3

File details

Details for the file bettermemory-3.26.0.tar.gz.

File metadata

  • Download URL: bettermemory-3.26.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bettermemory-3.26.0.tar.gz
Algorithm Hash digest
SHA256 00f83b6e097aaaa4cb75cc68ba478aaebda5c65a9ef905edc707c0d80c036ad2
MD5 86371b8d45d06d804dde0daa8d60417b
BLAKE2b-256 85c412272a8d8ecf552b8d5cc0d11574810e2311d74cc8bb005880f3284c376f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bettermemory-3.26.0.tar.gz:

Publisher: release.yml on 0Mattias/bettermemory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bettermemory-3.26.0-py3-none-any.whl.

File metadata

  • Download URL: bettermemory-3.26.0-py3-none-any.whl
  • Upload date:
  • Size: 795.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bettermemory-3.26.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a7b8681fd2c5f56a64d7c99fe3d7b4082de38e1178f87f6cb49c796b750261c
MD5 19de460ede278f1b45804d1c46287f09
BLAKE2b-256 1b438ad210452512076522d018460378b64fadc3b5332c87ccddd4148203a7ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for bettermemory-3.26.0-py3-none-any.whl:

Publisher: release.yml on 0Mattias/bettermemory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page