Cc Agent Brainのロゴ

Cc Agent Brain

コミュニティ
syiibfs-hash

Local-first memory engine for coding agents (Claude Code/Cursor/Codex): SQLite+FTS5 retrieval, versioned bi-temporal memories, full-session capture, zero dependencies, MCP server

公開者syiibfs-hash
リポジトリcc-agent-brain
言語Python
フォーク
0
スター
94
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Cc Agent Brainは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには94件のスターと0件のフォークがあります。

CC Agent Brain

English | 中文

A local-first memory engine for coding agents. It captures what you and the agent actually do, distills it into versioned long-term memory, and recalls it automatically — fully offline, with zero third-party dependencies, and exposed to any tool through MCP. Installs as a namespaced add-on and never replaces your existing .claude/ directory.


English

What is CC Agent Brain

CC Agent Brain turns a stateless coding agent into one that remembers you across sessions and across tools — all locally, no cloud, no API key.

text
user prompts / assistant replies / tool actions
        ↓ automatic hooks
append-only event stream (SQLite + FTS5)  +  readable Wiki (Markdown)
        ↓ distill
versioned long-term memory (layered, bi-temporal, auditable)
        ↓ BM25 + RRF retrieval, project DB first / global DB fallback
automatic recall in future sessions
        ↓ MCP server
the same memory in Claude Code, Cursor, Codex, Gemini CLI, Claude Desktop…

Why it exists (2026 memory landscape)

Agent memory is becoming standard infrastructure, but existing choices force a trade-off: cloud memory APIs send your data away; heavy self-hosted stacks need vector/graph databases; plain Markdown memory does not actually search or version itself. CC Agent Brain occupies the middle:

  • Zero-dependency engine — Python stdlib sqlite3 + FTS5 (BM25), including CJK bigram tokenization, so Chinese and English retrieval both work offline.
  • Real capture loop — user prompts and assistant replies / tool calls are indexed (Stop hook reads the transcript; idempotent).
  • Versioned, trustworthy memory — facts are superseded/expired, never silently overwritten; a timeline shows what changed and when.
  • MCP-native, tool-agnostic — one memory store for every MCP client.
  • Human-readable projection — Markdown Wiki and generated indexes keep you in control; the DB is a single portable file.
  • Private by construction — common secret shapes are redacted at capture time; personal data is git-ignored.

Quick install

bash
git clone https://github.com/syiibfs-hash/cc-agent-brain.git
cd cc-agent-brain
python installer/install.py --target /path/to/your/project
# preview first:
python installer/install.py --target /path/to/your/project --dry-run

Or paste the install prompt from prompts/install-from-github.md into Claude Code.

What gets installed

text
my-project/
├── .claude/
│   ├── settings.json                         ← merged, not replaced (+ backup)
│   ├── skills/cc-agent-brain-*/              ← 6 skills
│   ├── agents/cc-agent-brain-*.md            ← 3 agents
│   └── hooks/cc-agent-brain/                 ← 6 hooks + engine + _utils
│       ├── brain_store.py                    ← SQLite/FTS5 engine + MCP server
│       ├── transcript_capture.py             ← indexes assistant/tool actions
│       └── …
├── .cc-agent-brain/brain.db                  ← local engine DB (git-ignored)
├── memory/     compressed long-term memory + generated index
├── wiki/       detailed human-readable context
├── private/    local sensitive notes
└── templates/  writing templates

The engine CLI

bash
BRAIN="python .claude/hooks/cc-agent-brain/brain_store.py"
$BRAIN init
$BRAIN search "deployment decision" --human
$BRAIN memory add --title "..." --body "..." --layer semantic --confidence high
$BRAIN memory add ... --supersedes <old-id>   # replace, keep history
$BRAIN audit / timeline / stats / candidates
$BRAIN sync-md                                # regenerate memory projection
$BRAIN serve-mcp                              # MCP server over stdio

Full reference: docs/memory-engine.md, MCP setup: docs/mcp.md.

Components

6 Hooks

HookEventPurpose
session_start.pySessionStartonboarding check, engine status
prompt_capture.pyUserPromptSubmitprompt → Wiki projection + event stream
wiki_context_hint.pyUserPromptSubmitreal FTS recall for the current prompt
transcript_capture.pyStopindex assistant replies & tool calls
pre_compact_save.pyPreCompactcheckpoint before compaction
memory_audit.pyStopSQL audit: duplicates, broken chains, stale entries

6 Skills — onboarding, wiki update/search, memory distill/audit, material distill. 3 Agents — memory curator, wiki compiler, material distiller.

Memory model

Four layers — working (current task), episodic (timestamped events), semantic (distilled facts/preferences), procedural (reusable workflows). Each memory has status (active/superseded/expired/archived), validity window, confidence, source and supersede chain. See docs/memory-design.md.

Uninstall

bash
python installer/uninstall.py --target /path/to/your/project

Only framework files tracked by the manifest are removed. Your memory/, wiki/, private/ and brain.db are preserved.

Roadmap

VersionThemeStatus
v0.1Local second-brain MVP (capture/wiki/distill hints)released
v0.2Local engine: SQLite+FTS5, full capture, versioned memory, audit, MCPcurrent
v0.3Recall quality: optional local embeddings + RRF, built-in recall eval setplanned
v0.4Portability: Marketplace packaging, one-line install, import/exportplanned
v0.5Optional E2E-encrypted private backup (local-first by default)planned

Privacy

Open-source framework, no personal data inside. Everything runs on your machine; there is no telemetry and no network call. memory/, wiki/, private/ and *.db are git-ignored. See docs/product-analysis.md for the product rationale.

License

MIT


中文

CC Agent Brain 是什么

给编码 Agent 用的本地记忆引擎:自动捕获你和 Agent 的真实工作过程,蒸馏成带版本的长期记忆,并在后续会话自动召回——全程离线、零第三方依赖,并通过 MCP 把同一份记忆提供给任意工具。以命名空间插件方式安装,绝不覆盖你已有的 .claude/。

text
用户提示 / 助手回复 / 工具动作
        ↓ 钩子自动捕获
只增事件流(SQLite + FTS5) + 可读 Wiki(Markdown)
        ↓ 蒸馏
带版本的长期记忆(分层、双时间、可审计)
        ↓ BM25 + RRF 检索,项目库优先 / 全局库兜底
后续会话自动召回
        ↓ MCP 服务
同一套记忆服务 Claude Code、Cursor、Codex、Gemini CLI、Claude Desktop…

为什么做它(2026 记忆赛道现状)

Agent 记忆正在成为基础设施,但现有方案都要你做取舍:云记忆 API 要上传数据;重型自建方案要装向量/图数据库;纯 Markdown 记忆既不能真正检索也没有版本。CC Agent Brain 取中间路线:

  • 零依赖引擎:仅用 Python 标准库 sqlite3 + FTS5(BM25),内置中文 bigram 分词,中英文检索全部离线可用。
  • 完整捕获闭环:不只存用户提问,Stop 钩子读取会话记录,把助手回复与工具调用一并索引(幂等)。
  • 可信的版本化记忆:事实变更走"取代/失效"而非静默覆盖,时间线可查"何时因为什么改了结论"。
  • MCP 原生、不绑工具:一套记忆,所有 MCP 客户端复用。
  • 人类可读投影:Markdown Wiki 与生成式索引让你始终掌控;数据库只是一个可拷贝的文件。
  • 隐私内建:常见密钥形态在捕获时即脱敏,个人数据默认 git 忽略。

快速安装

bash
git clone https://github.com/syiibfs-hash/cc-agent-brain.git
cd cc-agent-brain
python installer/install.py --target /path/to/your/project
# 先预览:
python installer/install.py --target /path/to/your/project --dry-run

也可以把 prompts/install-from-github.md 中的安装提示词粘贴给 Claude Code。

安装内容

text
my-project/
├── .claude/
│   ├── settings.json                         ← 增量合并(自动备份)
│   ├── skills/cc-agent-brain-*/              ← 6 个技能
│   ├── agents/cc-agent-brain-*.md            ← 3 个代理
│   └── hooks/cc-agent-brain/                 ← 6 个钩子 + 引擎 + 工具库
│       ├── brain_store.py                    ← SQLite/FTS5 引擎 + MCP 服务
│       ├── transcript_capture.py             ← 索引助手回复/工具动作
│       └── …
├── .cc-agent-brain/brain.db                  ← 本地引擎库(git 忽略)
├── memory/     压缩长期记忆 + 生成式索引
├── wiki/       详细的人类可读上下文
├── private/    本地敏感笔记
└── templates/  写作模板

引擎命令行

bash
BRAIN="python .claude/hooks/cc-agent-brain/brain_store.py"
$BRAIN init
$BRAIN search "部署方案的决策" --human
$BRAIN memory add --title "..." --body "..." --layer semantic --confidence high
$BRAIN memory add ... --supersedes <旧id>     # 取代并保留历史
$BRAIN audit / timeline / stats / candidates
$BRAIN sync-md                                # 重新生成记忆投影
$BRAIN serve-mcp                              # 以 stdio 启动 MCP 服务

完整说明见 docs/memory-engine.md,MCP 接入见 docs/mcp.md。

组件

6 个 Hooks

Hook触发点功能
session_start.pySessionStart初始化检查、引擎状态
prompt_capture.pyUserPromptSubmit提示写入 Wiki 投影与事件流
wiki_context_hint.pyUserPromptSubmit对当前问题做真实 FTS 召回
transcript_capture.pyStop索引助手回复与工具调用
pre_compact_save.pyPreCompact压缩前检查点
memory_audit.pyStopSQL 审计:重复、断链、过期、积压

6 个 Skills:初始化、Wiki 更新/检索、记忆蒸馏/审计、素材蒸馏。 3 个 Agents:记忆策展人、Wiki 编纂者、素材提炼者。

记忆模型

四层——working(当前任务)、episodic(带时间戳的事件)、semantic(蒸馏事实与偏好)、procedural(可复用流程)。每条记忆带状态(active/superseded/expired/archived)、有效期、置信度、来源与取代链。详见 docs/memory-design.md。

卸载

bash
python installer/uninstall.py --target /path/to/your/project

只删除清单中记录的框架文件;memory/、wiki/、private/ 与 brain.db 全部保留。

路线图

版本主题状态
v0.1本地第二大脑 MVP(捕获/Wiki/蒸馏提示)已发布
v0.2本地引擎:SQLite+FTS5、全量捕获、版本化记忆、审计、MCP当前
v0.3召回质量:可选本地向量 + RRF、内置召回评测集规划中
v0.4可移植:Marketplace 打包、一行安装、导入导出规划中
v0.5可选端到端加密私有备份(默认仍纯本地)规划中

隐私

开源框架,仓库内不含任何个人数据。所有计算在本机完成,无遥测、无网络请求。memory/、wiki/、private/ 与 *.db 均被 git 忽略。产品层面的完整分析见 docs/product-analysis.md。

协议

MIT

Cc Agent BrainのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Cc Agent Brainに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Cc Agent Brainをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Cc Agent BrainのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "cc-agent-brain": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてCc Agent BrainのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Cc Agent BrainのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Cc Agent Brainを使ってこのタスクを手伝ってもらえますか?
Cc Agent Brain
はい、読みました。
Cc Agent Brainで調べた結果をお伝えします。

よくある質問

Cc Agent Brain MCPサーバーは何に使いますか?

Cc Agent Brainは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでCc Agent Brain MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでCc Agent Brainを利用できます。

TypingMindでCc Agent Brain MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Cc Agent Brainを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Cc Agent Brain MCPをTypingMindに接続するにはどうすればよいですか?

Cc Agent BrainはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでCc Agent Brain MCPのどのようなツールを利用できますか?

Cc Agent BrainはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Cc Agent Brain MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Cc Agent Brainで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇