BRAIN
March 27, 2026 ยท View on GitHub
Persistent memory MCP server for Codex sessions.
BRAIN stores structured decisions, outcomes, tasks, and preferences in SQLite, then exposes retrieval and synchronization tools through an MCP server.
Project Status
- Maturity: beta
- Runtime: production-capable for local/operator workflows
- Quality model: benchmark and done-state gated
Why BRAIN
Most memory systems stop at storage. BRAIN is built for operational follow-through:
- retrieve relevant policy and context at turn start,
- track decisions and close them with outcomes,
- enforce measurable memory quality gates,
- keep a human-readable
MEMORY.mdmirror synced from structured data.
Core Capabilities
Project memory tools:
get_contextprepare_turnrecallcleanup_stale_decisionsprovider_healthjust_works_statusrecord_eventupsert_preferencerecord_decisionrecord_outcomesync_memory
Project continuity tools:
upsert_project_profilerecord_taskupdate_tasklist_taskssuggest_next
Repository Layout
mcp/brain/: MCP runtime and evaluation modulesbin/: install and quality-gate scriptsdocs/: evaluation, done-state, and release docsskills/brain/: skill instructions for memory workflow
Quick Start
1) Clone
git clone <repository-url> brain
cd brain
2) Install
bash ./bin/install.sh
Installer behavior:
- links the
brainskill into~/.codex/skills, - writes or refreshes
mcp_servers.brainin~/.codex/config.toml, - points MCP runtime at
python3 -m brainwithPYTHONPATH=<repo>/mcp, - initializes
~/.codex/brain/brain.envwith secure permissions (chmod 600).
3) Restart Codex
Restart is required so the MCP server is loaded in the current session.
Verify Installation
Deterministic fixture check:
bash ./bin/check_ci_fixture.sh
Expected outcome includes:
just_works_status=healthygate=passdone_state=pass
Optional real-dataset check:
bash ./bin/run_memory_eval.sh --report-done-state --enforce-gate --enforce-done-state
Local State And Privacy
BRAIN writes local operational state that should not be committed:
MEMORY.md- SQLite runtime files (
brain.db,*.db-wal,*.db-shm)
MEMORY.example.md documents the expected shape for memory mirrors.
Uninstall
bash ./bin/uninstall.sh
By default, uninstall keeps local DB files. Set REMOVE_DB=1 to remove them.
Public Release Standard
Before shipping:
python3 -m compileall mcp
bash ./bin/check_ci_fixture.sh
bash ./bin/run_memory_eval.sh --report-done-state --enforce-gate --enforce-done-state
See docs/release-checklist.md for full checklist.
License
MIT. See LICENSE.