OneBrain is a setup layer that gives several AI agents — Claude Code, Codex, Grok, Cursor, a self-hosted gateway or bot, Claude Desktop, and others — one shared memory served from your own machine over the Model Context Protocol (MCP). An Obsidian vault of plain Markdown is the only durable store; edit a fact there once and every wired agent sees it. Embeddings and storage stay on-device, with no external API calls.
The intelligence layer is gbrain, a separate open-source local-brain project that indexes the vault into PGLite (embedded Postgres), builds a typed knowledge graph, and exposes roughly 80 tools over one HTTP MCP endpoint bound to 127.0.0.1 with bearer-token auth. OneBrain supplies the operational wrapping: macOS LaunchAgents, a five-minute vault sync loop that bounces the server around writes, offline nomic-embed-text embeddings via Ollama, secret hygiene, a sandboxed enrichment daemon, agent wiring scripts, and an installer that verifies each setup value rather than just collecting it. It pins a tested gbrain version (v0.42.65.0).
Optionally, one agent can act as an orchestrator that runs on a schedule, reads context from the brain, dispatches work to the others, and writes results back to the vault; OpenClaw and Hermes (Nous Research) are documented as MCP-native runtimes for this role. A nightly job scans agent transcripts read-only, uses a local gemma3:4b model to find claims that were later contradicted, and appends them to an Agent Lessons vault note whose Rules section is injected at every session start. Measured on a Mac mini M4 with 16 GB, gemma3:4b generated at 31.8 tokens per second while gemma4:12b-mlx thrashed at 0.8 tokens per second.
Features
- Shared memory over MCP: every agent queries the same gbrain endpoint, each configured in its own native format
- Obsidian vault as source of truth: plain Markdown under git, synced into the index every five minutes
- Fully local: PGLite storage plus Ollama embeddings, so nothing leaves the machine and queries cost nothing
- Agent wiring report: tools/onebrain-agents.sh detects installed agents, writes their mcpServers or [mcp_servers.*] config, backs it up first, and reports unverifiable schemas as MANUAL
- Verifying installer: checks that the vault is a git repo, gbrain is present, Ollama is reachable with the embed model pulled, and Telegram alerts actually deliver
- Daily sentinel: ai.gbrain.doctor compares server health against a baseline, alerts on regression, and holds the baseline until a clean run
- Off-machine backup: the vault git is mirrored to a second machine on every changed commit, non-fatal if unreachable
- Nightly lessons: a local model extracts contradicted claims from transcripts into a vault note with binding Rules and an append-only Log
- Heartbeat watchdog: the lessons pipeline ships in an alarmed state and only goes green once it writes a heartbeat, including on zero-lesson nights
- Notifications: Telegram, macOS notification, and log-file channels, each optional
- Orchestrator option: OpenClaw or Hermes connected as a remote HTTP MCP client to schedule and fan out work
- Multi-machine: the same install on a second Mac with the vault kept in sync via Obsidian Sync
Integrates with
Claude Code
Terminal-based agentic coding tool that reads your codebase and runs tasks through natural-language commands
Codex
Lightweight coding agent that runs in your terminal
Hermes
Self-improving AI agent with a learning loop that creates and refines skills, recalls past sessions, and runs across chat platforms
OpenClaw
Self-hosted single-operator assistant runtime that links models, tools, and messaging channels through one local Gateway
