ADHD 外脑系统,帮你把脑子里的杂念倒出来、收集、归类、整理,减少注意力碎片化。
- ACP 协议集成:通过 WebSocket 接收 OpenClaw 发送的 URL
- 自动抓取:将 URL 内容转换为 Markdown 保存
- LLM 编译:使用 MiniMax M2.7 将原始内容编译为结构化 wiki
- 语言保持:中文来源自动生成中文 wiki,英文来源生成英文 wiki
- Q&A 搜索:基于内容的智能问答
- 自动体检:定期检查知识库健康状态
OpenClaw → [ACP WebSocket] → raw/links/ → [fetcher] → raw/content/
↓
┌───────────┴───────────┐
↓ ↓
wiki/ [chunks.json]
(LLM编译) ↓
↓ ↓
┌──────┴──────┐ [search]
↓ ↓
concepts/ articles/
jibuxia/
├── acp-client/ # ACP 协议客户端(独立运行)
│ └── index.js # 接收 OpenClaw 发来的 URL
├── lib/
│ ├── fetcher.js # URL → Markdown 抓取
│ ├── compiler.js # 基础编译(非 LLM)
│ ├── indexer.js # JSON 索引存储
│ ├── search.js # Q&A 搜索
│ ├── lint.js # 本地健康检查
│ ├── llm-compiler.js # ★ LLM 驱动编译(核心)
│ ├── llm-lint.js # LLM 驱动的体检
│ └── output.js # Marp/图表输出
├── scripts/
│ ├── watch.js # 文件监控
│ ├── compile.js # 编译入口
│ ├── ask.js # 问答 CLI
│ ├── lint.js # 体检 CLI
│ └── orchestrate.js # 主编排器(启动所有服务)
├── raw/
│ ├── links/ # URL 文件(ACP 写入)
│ └── content/ # 抓取的完整内容(15个源文件)
├── wiki/
│ ├── index.md # 入口索引
│ ├── concepts/ # 概念页面(18个)
│ ├── articles/ # 主题文章(6个)
│ └── health-reports/ # 体检报告
├── data/ # 索引数据
├── config.json # 配置文件
└── package.json
编辑 config.json:
{
"gateway": {
"url": "ws://127.0.0.1:18789",
"token": ""
},
"session": {
"key": "agent:main:link-collector",
"label": "link-collector"
},
"llm": {
"provider": "minimax",
"model": "MiniMax-M2.7",
"apiKey": "your-api-key",
"baseUrl": "https://api.minimaxi.com/v1"
},
"compile": {
"debounceMs": 30000,
"batchSize": 10
}
}# 启动完整系统(ACP + 监控 + 自动编译)
npm start
# 或单独运行各模块
npm run watch # 文件监控
npm run compile:llm # LLM 编译
npm run ask "问题" # Q&A- 在 OpenClaw 中发送包含 URL 的消息到
agent:main:link-collectorsession - ACP client 接收 URL 并写入
raw/links/ - Fetcher 自动抓取内容到
raw/content/ - LLM 编译器自动编译到
wiki/
| 命令 | 说明 |
|---|---|
npm start |
启动完整系统 |
npm run watch |
启动文件监控 |
npm run fetch |
抓取 raw/links/ 中的 URL |
npm run index |
更新搜索索引 |
npm run compile |
基础编译 |
npm run compile:llm |
LLM 编译 |
npm run lint |
本地体检 |
npm run lint:llm |
LLM 体检 |
npm run ask "问题" |
搜索并显示结果 |
- 源文件:15 个已抓取的内容
- 概念:18 个 compiled concepts
- 文章:6 个 compiled articles
- 语言支持:已修复中文来源 → 中文 wiki 的问题
- Endpoint:
https://api.minimaxi.com/v1 - Model:
MiniMax-M2.7(注意大小写) - Temperature: 必须设置为 1.0(0.0 会报错)
- 思考标签:需移除
<thinking>等标签 - extra_body: 支持
reasoning_split: true
在 lib/llm-compiler.js 中实现:
function detectLanguage(text) {
const chineseRegex = /[\u4e00-\u9fff]/;
return chineseRegex.test(text) ? 'chinese' : 'english';
}每个源都会标注语言:
**[LANGUAGE: CHINESE]** - This source is in Chinese. You MUST write the wiki page in Chinese.
- Node.js 18+
- OpenClaw Gateway(用于 ACP 接收)
- LLM API(MiniMax M2.7)
- 轻量级:使用 JSON 文件存储,无需数据库
- 全自动化:文件监控 + 自动编译
- 语言感知:正确处理中英文内容的混合来源
- Wiki 风格:使用
[[page-name]]语法组织知识图谱 - 反向链接:自动追踪页面间的引用关系