Open source. Local first. CLI ready.

metaBrain

Local document memory for AI tools, coding agents, and the humans who work with them.

Give every agent one durable, searchable place for notes, source snippets, task context, metadata, tags, links, and version history.

Start small

Install `mb`, then give agents a shared memory.

The quickest path is the `mb` CLI: initialize a local store, write a note, search it, and keep moving. The optional server is there later when several tools need concurrent access.

Homebrew

Installs both `mb` and `mbd`.

brew tap OpenCow42/tap && brew install mb

Quick CLI tour

Try the CLI in a clean workspace.

Create a store, write a note, browse the tree, search it, and read the body back. That is enough to feel the shape of the tool.

Quickstart

mb init
mb put /notes/today "Remember the lexical store." --tag planning --meta source=agent
mb list /notes --recursive --dates
mb tree --max-depth 2
mb search "lexical store" --tag planning
mb get /notes/today

Made for AI and agents alike

A memory layer agents can actually use.

Agents do not need a private file convention for every task. metaBrain gives them a stable local store with predictable paths, searchable content, tags, metadata, references, and retained versions.

01

Write durable facts

Store summaries, decisions, and task state where the next agent can find them.

mb put /tasks/release-checklist \
  "Prepare first public release." \
  --tag release --meta status=active
02

Search workspace memory

Retrieve context by words, paths, tags, or metadata instead of hunting through scratch files.

mb search "public release" --tag release
03

Patch without rewriting

Apply focused unified diffs to stored documents and keep the old versions available.

mb patch /tasks/release-checklist --patch-file change.diff

Why try it

Small CLI. Useful memory model.

metaBrain keeps the interface plain enough for shell scripts and rich enough for long-running agent workflows.

Workspace local

The default store lives at `.metabrain/store.leveldb`, so tools can discover it without setup ceremony.

Searchable

Current document chunks are indexed for lexical search with tag, metadata, and path filters.

Structured

Documents carry metadata, tags, references, retained versions, and filesystem-like paths.

Versioned

Updates keep snapshots, and `patch` can apply unified diffs to stored document bodies.

Local server

Set up `mbd`, then regular `mb` commands get concurrent access for free: agents and humans share one endpoint instead of competing for the store lock.

Embeddable core

`MetaBrainCore` keeps shared behavior in a Swift library for future tools and interfaces.

Optional local server

Add `mbd` when many tools share memory.

You can use metaBrain directly through `mb` without running a server. When agents and humans need concurrent access, `mbd` owns the LevelDB lock, routes requests to the selected store, and keeps the same command flow available through one local endpoint.

Multi-store One daemon socket or loopback port can serve separate `.metabrain/store.leveldb` paths.
Auto-probed `mb` checks `http://127.0.0.1:6374` and falls back to direct LevelDB access when no daemon is running.
Local only Use Unix sockets on macOS and Linux, or loopback HTTP for integrations and Windows-friendly service setup.

Optional server mode

Default loopback endpoint: `127.0.0.1:6374`.

mbd serve --store .metabrain/store.leveldb --host 127.0.0.1
mb version
mb search "release checklist" --tag release
mb --no-server search "direct LevelDB access"

Open source

Built in the open for local-first agent work.

The project is BSD 3-Clause licensed, hosted on GitHub, and currently supports macOS, Linux, and Windows.