brain
Personal agent infrastructure. A multi-scope memory and task system that AI agents can depend on, with markdown exfiltration so the same content is also human-readable and grep-friendly.
brain is a Go fork of beads. It keeps beads' versioned Dolt substrate and graph-shaped issue model, then layers a federation model on top: one binary, many named stores, one shared database, unified search.
The model
brain is a graph of beads. It is an arbitrary collection of data beads (facts, learnings, decisions, ideas — kind: knowledge) and task beads (actionable work — kind: task), connected by interlocking dependency edges (brain link, brain related; e.g. informs, extends, learned-from, blocks/parent-child). A bead can be both (kind: both). The beads and the dependencies between them are what brain is; neither a particular database product nor a fixed set of stores defines it. Stores are a way of grouping beads, and one underlying database can hold the whole flexible model — including dependencies that cross stores.
brain is one Dolt database (brain_unified) holding a family of stores, each with a focused purpose and its own CLI wrapper. A store is a namespace of that database, not a database of its own: its beads are the rows whose ids carry the store's prefix, and ownership of the prefix is recorded in the database. Every wrapper is a thin shell script that sets BEADS_DIR and BD_NAME (and the shared server address) before dispatching to the brain binary; BEADS_DIR names the store's directory, whose .beads/metadata.json points at the shared database, and BD_NAME selects the store's namespace. See engdocs/design/brain-single-database.md.
| CLI | Store directory | Prefix | Purpose |
|---|
brain | ~/data/knowledge/.beads/ | brain- | Facts, learnings, concepts — the default hub |
task | ~/data/tasks/.beads/ | task- | Actionable work items (global, cross-project) |
project | ~/data/projects/.beads/ | project- | Active initiatives; links tasks + decisions |
inbox | ~/data/inbox/.beads/ | inbox- | Frictionless capture — classify later |
decide | ~/data/decisions/.beads/ | decide- | Decisions with rationale, dated |
idea | ~/data/ideas/.beads/ | idea- | Greenfield, exploratory, not yet actionable |
question | ~/data/questions/.beads/ | question- | Open questions pending research or answer |
assert | ~/data/assertions/.beads/ | assert- | AI assertion claims + verdicts |
life | ~/data/life/.beads/ | life- | Personal context (health, habits, goals) |
One database, many namespaces. Reads through a wrapper are narrow by default — they see only that store's namespace. Pass --wide to read every store's beads in the one database. Creates mint ids under the wrapper's own prefix, and a command with no store namespace pinned (no BD_NAME) refuses to create rather than guess.
brain is the search hub. brain search X finds entries across all registered stores (one wide read of the shared database, bucketed per store with --federated). Writes always go to the specific store via its wrapper — brain is never the write target for task/project/idea etc.
Capture first, classify later. Drop anything into inbox with zero classification overhead. Promote it to the right store when you have 30 seconds: brain transfer inbox-abc task.
Per-project task tracking stays in the repo. Each code repo has its own local bd store (.beads/ in the repo), separate from the shared brain database. The task store is for global, cross-project work items that don't belong to a single codebase.
Store registry
Stores are registered in ~/.config/brain/stores.yaml. The registry drives both
the binary (for brain search federation and brain transfer) and shell wrappers (via
~/.config/brain/stores.env, generated with brain stores env).
brain stores env exports BRAIN_STORE_* / BRAIN_STORES_LIST variables.
brain stores create recipes # provision new store end-to-end (namespace in the shared database, entries/, wrapper, registry, env)
brain stores add task ~/data/tasks/.beads # register an existing store directory without creating files
brain stores list
brain stores env # regenerate ~/.config/brain/stores.env
brain stores remove recipes # unregister (does NOT delete files)
brain stores doctor # assert every registered store answers a read