Brainy

io.github.memokarv0.1.0更新於 Oct 6, 2026

Shared knowledge base + task queue so Claude, ChatGPT and other agents can work together safely.

概覽

AI 產生的概覽

自託管的共享知識庫與任務佇列,讓多個 AI 代理讀取同一份 Markdown 知識並透過任務協作。

功能
Brainy 為代理提供一個受控的 MCP 端點,用於共享知識和任務。知識工具包括 list_documents、get_document、search_knowledge、write_document、append_document 和 propose_write,寫入會提交到 Git 儲存庫。任務工具包括 create_task、claim_task、renew_claim、complete_task、fail_task 和 release_task,支援原子認領、租約、相依性和審核。空間、角色、依空間的 ACL 以及僅追加的稽核日誌控制存取。
適用情境
當 Claude、ChatGPT 或自訂機器人等多個 AI 用戶端需要共享同一知識庫和任務清單,而不是各自在獨立聊天中工作時適用。也適合希望對代理提出的知識變更進行人工審核並保留代理操作稽核記錄的團隊。
執行需求
作為本機程序執行,通常使用已發佈的容器映像,或從原始碼執行,需要 Python 3.10 或更高版本和 SQLite。需要資料目錄和知識根目錄,以及透過 Authorization 標頭傳送的服務權杖;管理員權杖在首次啟動時列印一次。遠端連接器需要 HTTPS 和 OAuth 2.1 設定。
安裝前請注意
Authorization 標頭攜帶 Brainy 服務權杖,管理員權杖在首次啟動時僅顯示一次,請妥善保存。代理可以寫入和追加知識文件,並建立、認領、完成或標記任務失敗,提出的寫入可能需要人工批准。應為每個代理分配獨立主體,並只授予其所需的空間。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Brainy,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Brainy

[CI] [License: AGPL-3.0] [Dependencies: none]

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.

Features

AreaWhat you get
Knowledgelist_documents, get_document, search_knowledge, write_document (optimistic concurrency via Git commit), append_document, propose_write
Taskscreate_task, claim_task, renew_claim, complete_task, fail_task, release_task, dependencies, priorities, review/approve/reject
AccessSpaces (tenants/areas), roles ADMIN / EDITOR / AGENT / READER, per-space ACL, service tokens, OAuth 2.1 (for Claude/ChatGPT remote connectors)
OperationsWeb admin UI, audit log, agent registry + dispatcher framework, backup & verified restore scripts

Quickstart (Docker)

Prebuilt image (published on every release):

bash
docker run -d --name brainy -p 127.0.0.1:8765:8765 -v brainy-data:/data ghcr.io/memokar/brainy:latestdocker logs brainy   # prints your one-time ADMIN token on first start

Or build it yourself with Compose:

bash
git clone https://github.com/memokar/brainy.gitcd brainydocker compose up -ddocker compose logs brainy   # prints your one-time ADMIN token on first start

Brainy 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)

bash
export BRAINY_DB_PATH=$PWD/data/brainy.dbexport BRAINY_KNOWLEDGE_ROOT=$PWD/data/knowledgeexport 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 oncepython3 scripts/init_prod_db.py "$BRAINY_DB_PATH"             # seeds default spacespython3 scripts/serve.py

Connecting an AI

  • Claude Code:
    bash
    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:
    json
    {"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, header Authorization: Bearer <service token>.
  • Claude.ai / ChatGPT remote connectors: use the OAuth 2.1 flow (discovery at /.well-known/oauth-authorization-server). Set BRAINY_PUBLIC_BASE_URL to 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.

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

bash
for t in tests/test_*.py; do python3 "$t" || exit 1; done

Status & 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.

來源:README.md,提交 79e0ec7

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.0最新Oct 6, 2026