brainy
Brainy
A shared brain for your AI agents — and for the humans who work with them.
Brainy is a self-hosted knowledge and task backbone that Claude, ChatGPT and any other MCP-capable AI connect to through one controlled endpoint. Every agent reads the same knowledge, works on the same task list and leaves an audit trail — so your AIs can hand work to each other instead of living in separate chat silos.
ChatGPT ─┐ ┌─ Git-versioned knowledge (Markdown)
Claude ─┼──► MCP endpoint ──► Brainy ───┼─ Tasks with atomic claim/lease
Your bot ┘ (OAuth / tokens) ACL+Audit └─ Spaces, roles, append-only audit log
▲
Humans: web admin UI (+ optional Telegram approvals)Why Brainy?
AIs that collaborate. ChatGPT creates a task, Claude claims it, does the work and writes the result back; a human reviews. Coordination happens through tasks — no hidden agent-to-agent magic.
One source of truth. Knowledge lives as plain Markdown in a Git repository. Every write is a commit, so you get history, diffs and rollback for free.
Safe by default. No shell, no filesystem, no eval over MCP. Path allowlist, per-space ACLs, secret detection on writes, rate limits, hashed tokens and an append-only audit log.
No double work. Atomic task claims with leases and claim tokens guarantee that two agents never process the same task at the same time.
Human in the loop. Agents can propose knowledge changes; a human approves or rejects them (web UI or Telegram). Tasks can require review/approval before they count as done.
Zero dependencies. Pure Python standard library + SQLite. No pip install, tiny attack surface.
Related MCP server: auxly-memory-cli
Why not just a markdown file?
A shared notes file in a Git repo is a great knowledge store — and Brainy keeps that part on purpose: knowledge is plain Markdown in Git, with history, diff and rollback. The problem is everything a bare file doesn't do once more than one agent touches it:
Two agents overwrite each other. Nothing serializes concurrent writes to the same file. Brainy writes go through optimistic concurrency (
expected_git_commit) plus a server-side write lock: exactly one writer commits, the others get aConflictand re-read — no lost edits.No task hand-off. A file can list TODOs, but it can't stop two agents from grabbing the same one. Brainy tasks use an atomic claim (
UPDATE ... WHERE status='READY', one row): exactly one agent wins, the rest get a conflict and move on.No per-area permissions. A file is all-or-nothing. Brainy has Spaces with per-space ACLs, so an agent only reads/writes the areas you grant it.
No approval step. Agents can propose changes for a human to approve (web UI or Telegram) instead of writing straight to the source of truth.
"Who changed what?" beyond
git blame. Every action — reads of task state, claims, writes, rejections — lands in an append-only audit log enforced by a DB trigger.
Both guarantees above are covered by a concurrency test
(tests/test_concurrency.py): 20 threads racing on one task yield
exactly 1 winner and 19 conflicts, and 20 threads writing the same file yield exactly 1
commit and 19 conflicts, with the repo left clean.
How is Brainy different?
Honest comparison with the tools people mention most. Beads is closest to Brainy's task side, and Central Brain to its knowledge side; neither is a one-to-one match. Facts are from each project's own docs (links below); where something isn't documented, it says so rather than guessing.
Brainy | Beads beads | Central Brain cb | Shared notes file | |
What it is | Knowledge base + task queue | AI-agent issue/task tracker | AI memory layer | Markdown in a repo |
Knowledge store | Markdown in Git | — (issue tracker) | Plain files + local vector index | Markdown in Git |
Task queue with atomic claims | ✅ | ✅ | not documented | ❌ |
Per-area permissions (ACL) | ✅ Spaces/roles | ❌ | ❌ | ❌ |
Append-only audit log | ✅ (DB-enforced) | partial (Git/DB history) | ❌ |
|
Human approval for writes | ✅ (web/Telegram) | ❌ | ❌ | ❌ |
MCP server | ✅ | ✅ | ✅ | ❌ |
Multi-agent concurrency control | ✅ claims + write lock | ✅ claims + concurrent writers | not documented | ❌ |
Dependencies | none (stdlib + SQLite) | bundles Dolt (Go) | bundles embedding model | n/a |
Self-hosted | ✅ | ✅ | ✅ (cloud optional) | ✅ |
License | AGPL-3.0 (+ commercial) | MIT | proprietary | n/a |
version-controlled SQL database; earlier versions used SQLite + JSONL).
Apple-silicon macOS, MCP integration; pricing per the site at time of writing: $12/mo solo,
$35/mo for 4 licenses).Features
Area | What you get |
Knowledge |
|
Tasks |
|
Resource claims |
|
Access | Spaces (tenants/areas), roles |
Operations | Web admin UI, audit log, agent registry + dispatcher framework, backup & verified restore scripts |
Quickstart (Docker)
Try it in one command — no clone, no setup. Runs a throwaway demo (temporary database + example knowledge, deleted on exit) as an MCP stdio server:
docker run --rm -i ghcr.io/memokar/brainy:latest --demoFor a real install, run the server (prebuilt image, published on every release):
docker run -d --name brainy -p 127.0.0.1:8765:8765 -v brainy-data:/data ghcr.io/memokar/brainy:latest
docker logs brainy # prints your one-time ADMIN token on first startOr build it yourself with Compose:
git clone https://github.com/memokar/brainy.git
cd brainy
docker compose up -d
docker compose logs brainy # prints your one-time ADMIN token on first startBrainy now listens on http://127.0.0.1:8765 (MCP endpoint: /mcp, admin UI: /admin — log in
with the token). For remote AI connectors put it behind HTTPS (see
deploy/nginx-brainy.conf.example) and set BRAINY_PUBLIC_BASE_URL.
Quickstart (bare metal, Linux, Python ≥ 3.10)
export BRAINY_DB_PATH=$PWD/data/brainy.db
export BRAINY_KNOWLEDGE_ROOT=$PWD/data/knowledge
export BRAINY_WEB_SESSION_KEY=$PWD/data/web_session.key
cp -r examples/knowledge "$BRAINY_KNOWLEDGE_ROOT"
git -C "$BRAINY_KNOWLEDGE_ROOT" init -q && git -C "$BRAINY_KNOWLEDGE_ROOT" add -A \
&& git -C "$BRAINY_KNOWLEDGE_ROOT" commit -qm "initial knowledge"
python3 scripts/bootstrap.py "$BRAINY_DB_PATH" --with-token # prints ADMIN token once
python3 scripts/init_prod_db.py "$BRAINY_DB_PATH" # seeds default spaces
python3 scripts/serve.pyConnecting an AI
Claude Code:
claude mcp add --transport http brainy http://127.0.0.1:8765/mcp --header "Authorization: Bearer <token>"Local stdio clients (e.g. Claude Desktop): run Brainy as a subprocess:
{"mcpServers": {"brainy": {"command": "python3", "args": ["/opt/brainy/scripts/stdio.py"], "env": {"BRAINY_DB_PATH": "/var/lib/brainy/brainy.db", "BRAINY_KNOWLEDGE_ROOT": "/opt/brainy-knowledge", "BRAINY_TOKEN": "<token>"}}}}Try it without any setup:
python3 scripts/stdio.py --demo(temporary data, deleted on exit).Any other MCP client with custom headers: endpoint
https://<your-host>/mcp, headerAuthorization: Bearer <service token>.Claude.ai / ChatGPT remote connectors: use the OAuth 2.1 flow (discovery at
/.well-known/oauth-authorization-server). SetBRAINY_PUBLIC_BASE_URLto your HTTPS URL.
Brainy is listed in the official MCP Registry as
io.github.memokar/brainy.
Give each AI its own principal (e.g. claude, chatgpt) with role AGENT and only the spaces it
needs. Every action then shows up in the audit log under that name.
Example: two coding agents in one repo
Two agents working the same repository can step on each other's files. With resource claims each one reserves the area it's about to touch — a free-form key per space — and the other backs off until it's released or the lease expires:
// Agent A, before editing the auth code:
claim_resource { "space": "shared", "resource_key": "repo:app/src/auth/**", "lease_seconds": 1800 }
// -> { "claim_token": "…", "lease_until": "…" } A now owns that area
// Agent B, about to touch the same area:
claim_resource { "space": "shared", "resource_key": "repo:app/src/auth/**" }
// -> Conflict: already claimed → B picks a different area (e.g. "repo:app/src/api/**")
renew_resource { "space": "shared", "resource_key": "repo:app/src/auth/**", "claim_token": "…" } // A keeps working
release_resource { "space": "shared", "resource_key": "repo:app/src/auth/**", "claim_token": "…" } // A done → free again
list_resource_claims { "space": "shared" } // who holds what right nowSame guarantee as task claims — exactly one holder at a time, expired leases free up automatically
(see tests/test_resources.py). Resource claims reuse the task
permissions/scopes (can_claim_tasks / brainy:tasks:write), so any agent that can claim tasks can
claim resources.
Configuration
All configuration comes from environment variables — see .env.example.
Secrets (tokens, keys) are never stored in the repository or the knowledge base.
Extensions
The core ships a worker plugin interface and a deterministic MockWorker. Real workers that let
agents execute tasks autonomously (e.g. Claude Code, Codex) are separate extensions loaded via
BRAINY_WORKER_PLUGINS. See docs/extensions.md.
Running the tests
for t in tests/test_*.py; do python3 "$t" || exit 1; doneStatus & roadmap
Brainy runs in production for its author. Current limitations:
Code comments are still partly German; all user-facing text is English.
Single-node design (SQLite). PostgreSQL only if real multi-writer load appears.
License
Copyright (C) 2026 Mehmet Karakolcu
Brainy is dual-licensed:
Open source: GNU AGPL-3.0. Free for everyone, including companies — but if you modify Brainy and offer it to others (also as a network service), you must publish your changes under the AGPL.
Commercial license: for companies that want to use or embed Brainy without AGPL obligations. See COMMERCIAL.md.
Contributions require agreeing to the Contributor License Agreement.
Beads — https://github.com/steveyegge/beads (MIT, Go; stores issues in Dolt, a
↩Central Brain by NeuroAIgent — https://neuroaigent.ai (local-first AI memory, Windows +
↩
Available Tools
27 toolsappend_documentCDestructive
Append to an allowed target (e.g. shared/todo.md).
Inputs: path (required), text (required), commit_message (required), expected_git_commit.
approve_taskAIdempotent
Approve the approval gate (-> APPROVED). Requires approve permission; no self-approval.
Inputs: task_id (required), note.
claim_taskC
Claim a task atomically (lease + claim_token).
Inputs: task_id (required), lease_seconds.
complete_taskBIdempotent
Complete a task — governance-gated (AUTO->COMPLETED, REVIEW->AWAITING_REVIEW, APPROVAL->AWAITING_APPROVAL).
Inputs: task_id (required), claim_token (required), result, result_refs.
create_taskD
Create a task.
Inputs: space (required), title (required), type, status, +9 more.
disable_agentC
Disable an agent (ADMIN).
Inputs: agent_name (required).
enable_agentB
Enable an agent (ADMIN).
Inputs: agent_name (required).
fail_taskCIdempotent
Mark a task as failed (idempotent).
Inputs: task_id (required), claim_token (required), reason.
get_agent_statusCRead-onlyIdempotent
Status of an agent.
Inputs: agent_name (required).
get_documentBRead-onlyIdempotent
Read a knowledge document (path allowlist, ACL).
Inputs: path (required).
get_execution_jobBRead-onlyIdempotent
Read an execution job (without dispatch_token).
Inputs: job_id (required).
get_taskCRead-onlyIdempotent
Read a task.
Inputs: task_id (required).
list_agentsBRead-onlyIdempotent
List the agent registry (no secrets).
Inputs: no named parameters.
list_documentsCRead-onlyIdempotent
List canonical Markdown documents (optional space).
Inputs: space.
list_execution_jobsCRead-onlyIdempotent
List execution jobs (without dispatch_token).
Inputs: limit, status, task_id.
list_runnable_tasksBRead-onlyIdempotent
Tasks runnable by this principal (READY, deps satisfied, ACL, required_capabilities, preferred_agent).
Inputs: limit.
list_spacesBRead-onlyIdempotent
List visible knowledge spaces.
Inputs: no named parameters.
list_tasksCRead-onlyIdempotent
List tasks of a readable space.
Inputs: type, limit, space, status.
pause_dispatcherA
Pause the dispatcher globally (ADMIN, kill switch).
Inputs: no named parameters.
propose_writeA
PROPOSE a change to a knowledge document (no direct write). The owner approves via Telegram; only then is it committed. Use this when you do not have direct write permission.
Inputs: path (required), content (required), commit_message (required), expected_git_commit.
reject_taskAIdempotent
Reject at the approval gate (-> REJECTED). Requires approve permission.
Inputs: task_id (required), note.
release_taskCIdempotent
Release your own claim.
Inputs: task_id (required), claim_token (required).
renew_claimCIdempotent
Extend the lease.
Inputs: task_id (required), claim_token (required).
resume_dispatcherA
Resume the dispatcher globally (ADMIN).
Inputs: no named parameters.
review_taskBIdempotent
Decide the review gate (decision=accept|reject). Requires review permission; no self-review.
Inputs: task_id (required), decision (required), note, rework.
search_knowledgeCRead-onlyIdempotent
Search knowledge case-insensitively (ACL, optional space).
Inputs: query (required), limit, space.
write_documentCDestructive
Write a knowledge document (git commit; ACL/secret guard).
Inputs: path (required), content (required), commit_message (required), expected_git_commit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Each tool targets a distinct resource+action: the task lifecycle verbs (claim/complete/fail/approve/reject/review/release/renew) are well differentiated by their governance roles, and document tools (write/append/propose/search) are clearly separated. Only mild potential confusion exists between the various task gate tools, but descriptions clarify intent.
Every tool follows a strict verb_noun snake_case pattern (list_agents, create_task, claim_task, write_document, pause_dispatcher), with predictable verbs for read/list/create/mutate operations. No convention mixing is present.
27 tools is on the heavy side and exceeds the comfortable 3-15 range. However, the surface spans five legitimate subdomains (tasks, documents, agents, execution jobs, dispatcher), so the count is defensible rather than bloated.
Task and document lifecycles are well covered (create/claim/complete/fail/approve/reject/review plus read/write/append/search/propose). Execution jobs are read-only (get/list with no create or claim path) and no delete operations exist, which are minor workable gaps.
Maintenance
Related MCP Connectors
Self-hostable shared brain for you and your AI agents — docs, flows, meetings, decisions, rationale
Shared graph-based task tracker for agents, agents’ agents and people. Source-available, free cloud.
Git collaboration for AI agents and people: tasks, hand-offs, reviews, teams, shared memory.
A shared, governed brain for AI agents: versioned context with approvals, local or hosted.
Related MCP Servers
- AlicenseAqualityAmaintenanceThe infrastructure for AI teams: a self-hosted server that gives a fleet of agents shared semantic memory, tasks, direct messages, and session handoff. Any agent that speaks HTTP participates: Claude Code, AutoGen, raw API scripts, anything.479MIT
- AlicenseNot gradedqualityBmaintenanceLocal-first, file-based memory layer for AI agents — one shared Markdown vault across Claude, Codex, Gemini, Cursor and any MCP client. Provides read/write memory tools with an audit trail, per-agent trust levels, and Git sync; no cloud and no lock-in.2MIT
- AlicenseAqualityBmaintenanceGit-native long-term memory for AI agents: your markdown files are the source of truth, the search index is a disposable projection rebuilt from git, and every memory the agent writes is a reviewable git commit. Served over one OAuth-secured MCP endpoint with hybrid lexical+semantic recall and a gated, git-first commit_note write tool.79AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read and write a local-first knowledge base of plain markdown files in git, with governance gates for safe, hash-anchored edits.1Apache 2.0