Repository avatar
Databases
v0.4.1
active

munin

io.github.alnovis/munin

Local memory for AI coding agents: an MCP server and a CLI over one SQLite file

Documentation

Munin

Munin is local memory for AI coding agents. An agent searches it before unfamiliar work and records what it learned afterwards: decisions, how the system is built, bugs and their fixes. Everything lives in one SQLite file on your machine, and every MCP client on it shares the same memory.

What it gives

  • Agents start from what earlier sessions learned. A search returns compact cards; the full entry is read only when a card looks relevant, so looking costs few tokens.
  • Old fixes fade, decisions stay. bugfix and note entries lose half their weight every 30 days; decision, architecture and howto (step-by-step procedures) never do. Age is applied to every match before the limit, so one old decision is not pushed out by a pile of stale fixes.
  • Nothing is overwritten. A new entry supersedes an outdated one and the chain is visible from both ends; a wrong entry is retracted with a reason. The database itself refuses edits and deletes.
  • One project, or a whole system. Memory is scoped to the project the agent works in. Projects can be grouped, for example the services of one microservice system: a project in a group searches the whole group, and decisions that span services are recorded on the group.
  • Errors an agent can act on. Bad input is rejected with the field and what is allowed, never silently turned into something else.
  • Local by construction. One binary and one file. No network access, no telemetry, nothing running in the background. Which entries get read is logged only into that same file, for munin stat and munin review.

How it works

Agents reach Munin through MCP, or through the CLI with a skill; people use the same binary from the shell. All of them work on one database file.

flowchart LR
    cc["Claude Code"] -->|"MCP, stdio"| serve["munin serve"]
    codex["Codex"] -->|"MCP, stdio"| serve
    cursor["Cursor"] -->|"MCP, stdio"| serve
    opencode["OpenCode"] -->|"MCP, stdio"| serve
    pi["pi"] -->|"MCP, stdio"| serve
    pi -->|"CLI, skill"| cli["munin CLI"]
    you["You"] -->|"munin search, add, show"| cli
    serve --> db[("~/.munin/munin.db<br/>SQLite + FTS5")]
    cli --> db

How to set up each of these agents is in docs/CONNECTING.md.

An entry is never edited. It stays active until a newer entry replaces it or someone marks it wrong; either way it remains readable with its history.

stateDiagram-v2
    [*] --> active: append
    active --> superseded: a new entry supersedes it
    active --> retracted: retracted with a reason

Quick start

Take the archive for your platform (Apple Silicon or x86_64 Linux) from Releases and put munin on your PATH (details), or install it with Cargo (the crate is munin-mcp, the binary munin):

cargo install --locked munin-mcp

Then connect it to the agent, for example Claude Code:

claude mcp add --scope user munin -- munin serve

The agent receives its instructions from Munin on connect. To make it use Munin without being asked, allow the tools and add the hooks described in docs/CONNECTING.md, which also covers Codex, Cursor, OpenCode and pi. To see what it has recorded:

munin search <words>
munin show <id>

Documentation

DocumentWhat it covers
InstallRelease archives, building from source, upgrading
Connecting an agentClaude Code, Codex, Cursor, OpenCode and pi: connection, permissions, instructions, hooks
UsageEntries and kinds, search, superseding, groups, command line, configuration, backups
SpecificationData model, ranking, tools and the decisions behind them
DevelopmentChecks, branches, CI
ReleasingWhat a version number promises, how a release is cut

MCP Registry name: mcp-name: io.github.alnovis/munin

Acknowledgements

Munin reimplements the ideas of larchanka/memo-mcp in Rust: the single SQLite file, two-stage retrieval, typed time decay and the shared tag vocabulary come from there.

License

MIT

CARGO
munin-mcp
Install Command
cargo install munin-mcp