Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

bettermemory

PyPI CI Python 3.11 to 3.14 MIT bettermemory MCP server

An MCP memory server for coding agents. Memories are checked against your files and git history on every read, and stale ones come back flagged.

Install

Claude Code, with uv installed:

/plugin marketplace add 0Mattias/bettermemory
/plugin install bettermemory@bettermemory

The plugin adds the server, the memory policy as a skill, and three hooks.

Anything else that speaks MCP:

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

Restart the client and ask the model what memory tools it has; nine tools, memory_search among them, mean the server is wired.

Coming from 8.x: run bettermemory migrate v8 once (uvx bettermemory migrate v8 if you use the plugin). Until then the server refuses to start beside the old files and says why.

What it does

  • Every search hit carries a staleness verdict: its age, whether the paths it cites still exist, and the commits since it was last checked. Declared claims (path, path::symbol, path::NAME=literal, !path) are re-checked against the working tree, and memory_verify will not stamp a memory fresh while one of its claims no longer holds.
  • The store is one SQLite file built from a hash-chained log, each row signed with a key kept outside the store. A record planted or forged outside the tool reads unaccounted on the next search; bettermemory log verify audits the whole chain.
  • Memory reaches the model through tool calls. On Claude Code the hooks add pointers, never bodies: up to eight fresh memories from the repository when a session opens, and up to three matching memories from the project on each prompt.
  • Writes pass gates for transient state, secret-shaped tokens and near-duplicates, then a review: the model sees the stored statements the write resembles and answers three questions before anything is written. Claims about you are stored labelled as inferences. No second model is involved.
  • Session capture is off by default. With [capture] stop_checkpoint = true in config.toml, the Stop hook asks the model in the session to save what each 12,000 tokens of conversation established. bettermemory capture review lists the batches and capture undo takes one back.
  • Search ranks by keyword and BM25, fused, with no embedding model and nothing to download; the same query gets the same ranking.
  • episode keeps per-session run-state out of durable search. bettermemory health reports what drifted, what went cold and what contradicts what.
  • One local daemon per store, on 127.0.0.1, serves every session and hook; bettermemory up, down and status manage it. bettermemory export writes the store as JSON or as the 8.x markdown directory.
  • The benchmarks and their result files, misses included, are in bench/.

For agents

You were likely handed this link with "Install bettermemory". On Claude Code, ask the user to type the two plugin commands above, then go to step 3. Everywhere else, every step is idempotent:

  1. uv tool install bettermemory, or pipx install bettermemory, or pip install bettermemory into a venv. Python 3.11 to 3.14.
  2. bettermemory init --client claude-code, or claude-desktop, cursor, cline, hermes. 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. Have the user restart the client so the server loads, then confirm by asking the model "what memory tools do you have?": nine tools, memory_search among them (under the mcp__bettermemory__ prefix on Claude Code).

With an 8.x store, run bettermemory migrate v8 (uvx bettermemory migrate v8 with the plugin) before step 3; until then the server refuses to start.

Your operating contract (tool signatures, retrieval discipline, write gates, the write review) 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.

Everything else

Mechanics, storage format, the full tool surface, CLI, configuration and limitations are in internals; per-client setup in clients and installation; eval methodology in eval; the threat model in SECURITY; postmortems in incidents; release history in CHANGELOG; dev setup and the compatibility contract in CONTRIBUTING.

MIT licensed. See LICENSE.

Metadata

Release files for bettermemory 9.0.0rc6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bettermemory 9.0.0rc6
File Size Uploaded Provenance
bettermemory-9.0.0rc6.tar.gz 16.9 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bettermemory 9.0.0rc6
File Interpreter ABI Platform
bettermemory-9.0.0rc6-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 MB

Release files / bettermemory-9.0.0rc6.tar.gz

Download URL bettermemory-9.0.0rc6.tar.gz
Size 16.9 MB
Tags Source
SHA-256 checksum
How to use checksums
b79f364e8fd0cb6d1b3872d38ba8eb1ae4e4c45378d9404049433a1b5525e525
BLAKE2b-256 checksum
How to use checksums
8d16b4be41a6f1496fe31382c78e1a6cabf35c3a87054f940f71ea43bfa525c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / bettermemory-9.0.0rc6-py3-none-any.whl

Download URL bettermemory-9.0.0rc6-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3701579b879f14b9409e2e5c80e9f4dada0bed34ead44b0914dc3680d76bc2bb
BLAKE2b-256 checksum
How to use checksums
c71aef5a7272dc767c564f7d824ff9fd1767f3854552750cc10e35b764c0d93c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for bettermemory 9.0.0rc6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bettermemory-9.0.0rc6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page