bettermemory
bettermemory is a local memory server for AI coding agents that stores durable facts and journal entries, automatically checking staleness against the filesystem and git to flag outdated or incorrect information. It requires intentional retrieval (no auto-injection) and stores each memory as a markdown file for git-syncability.
Core memory operations: Search (with relevance ranking, staleness verdicts, path/commit drift), view full content, list active memories, and get a scope overview with counts and curation pressure.
Writing & managing: Create memories with categories (fact, user-inference, ambient) and confidence; write gates reject transient state, secrets, near-duplicates, and ungrounded claims. Pending user-inference writes require explicit confirm or cancel. Update preserves ID and metadata; removal is tombstone-only (soft-delete) with a reason. Verify attests reality match. Record usage outcomes (ignored, contradicted, corrected) to improve retrieval.
Staleness & verification: Every retrieval includes a staleness verdict (fresh / spot_check_recommended / spot_check_required) based on age, file existence, and git commits since last verification. Audit turns silently detect missed memories.
Scope management: Temporarily disable/enable scopes per session.
Episodes: Journal-style entries (30-day TTL) for transient notes, handoff from prior sessions, cross-session search, and promotion to durable memory with full validation. Supports multi-agent swarm tagging.
The server is fully local, no cloud or account needed.
Uses Git to check stored memories against the working tree and commit history, providing staleness verdicts and detecting path/commit drift so outdated facts are flagged rather than trusted.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bettermemorywhat's stored about the checkout flow?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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@bettermemoryAnything else that speaks MCP:
uv tool install bettermemory
bettermemory init --client claude-desktop # or cursor / cline / claude-codeRestart 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.
Related MCP server: Ouso Code
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 still charge schema every turn: a serialized
tools/listof 33,960 bytes, 27,092 of it names and descriptions, measured 2026-07-31 at 3.32.0 (bench/toolcost). CI caps the descriptions.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 evalmeasures whether memory helped, against your own log. Ours is published — one store, one user, misses included.
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.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceMCP server that captures and recalls coding session memory (failures, decisions, diffs) for AI agents, enabling cross-agent continuity and preventing repeated mistakes.Last updated47MIT
- Flicense-qualityBmaintenanceA local, cross-editor MCP server that provides persistent memory for coding agents, capturing and recalling decisions, conventions, and fixes across sessions without API keys.Last updated
- Alicense-qualityDmaintenanceA local MCP memory server that gives AI assistants durable project memory across coding sessions, storing context, changes, and decisions.Last updated41MIT
- Flicense-qualityCmaintenanceA local-first MCP server that manages developer memory for coding agents, enabling shared project context, permissions, and audit trails across different agents.Last updated1
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Person-owned, portable AI memory as a remote MCP server, readable and writable by any MCP client.
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/0Mattias/bettermemory'
If you have feedback or need assistance with the MCP directory API, please join our Discord server