介绍
* 需要 API 密钥:请在 https://ensue-network.ai?utm_source=clawdbot 申请 *
# Second Brain
一个用于**建立随时间积累的理解**的个人知识库。不是一个笔记堆放处——而是一个用于捕获你真正可以检索和使用的知识的结构化系统。
## 理念
你的第二大脑应该: - **捕获理解,而不仅仅是事实** - 为忘记上下文的未来的自己而写 - **易于检索** - 结构化以便在你需要时能找到东西 - **保持常青** - 不包含私密细节、凭据或时效性数据 - **反映真实经验** - 只保存你实际学过或使用过的东西
在保存之前:*未来的我会感谢我保存这个吗?*
## 命名空间结构
``` public/ --> Shareable knowledge concepts/ --> How things work [domain]/ --> Organize by topic [concept-name] --> Individual concepts toolbox/ --> Tools and technologies _index --> Master index of tools [category]/ --> Group by type [tool-name] --> Individual tools patterns/ --> Reusable solutions [domain]/ --> Design patterns, workflows references/ --> Quick-reference material [topic]/ --> Cheatsheets, syntax, APIs
private/ --> Personal only notes/ --> Scratchpad, drafts journal/ --> Dated reflections ```
**示例领域:** `programming`(编程)、`devops`(运维)、`design`(设计)、`business`(商业)、`data`(数据)、`security`(安全)、`productivity`(生产力)
## 内容格式
### 概念
用于理解某事是如何运作的:
``` CONCEPT NAME ============
What it is: [One-line definition]
Why it matters: [What problem it solves, when you'd need it]
How it works: [Explanation with examples] [ASCII diagrams for architecture/flows where helpful]
+----------+ +----------+ | Client | ---> | Server | +----------+ +----------+
Key insight: [The "aha" moment - what makes this click]
Related: [links to related concepts] ```
### 工具箱条目
用于你实际使用过的工具和技术:
``` TOOL NAME
Category: [category] Website: [url] Cost: [free/paid/freemium]
What it does: [Brief description]
Why I use it: [Personal experience - what problem it solved for you]
When to reach for it: [Scenarios where this is the right choice]
Quick start: [Minimal setup/usage to get going]
Gotchas: [Things that tripped you up] ```
### 模式
用于可复用的解决方案:
``` PATTERN NAME
Problem: [What situation triggers this pattern]
Solution: [The approach, with code/pseudocode if relevant]
Trade-offs: [Pros and cons, when NOT to use it]
Example: [Concrete implementation] ```
### 参考资料
用于快速查找的材料:
``` REFERENCE: [TOPIC]
[Organized, scannable content] [Tables, lists, code snippets] [Minimal prose, maximum signal] ```
## 交互规则
### 保存知识
在保存前始终确认: 1. “你想让我把这个保存到你的第二大脑吗?” 2. 显示将要保存的草稿 3. 确认后保存 4. 确认保存了什么以及保存在哪里
### 检索知识
当相关话题出现时: - 搜索现有知识 - 呈现相关概念 - 将新学习与现有理解联系起来
### 维护质量
保存前,验证: - 是为忘记上下文的未来的自己而写的 - 包含“为什么”,而不仅仅是“是什么” - 有具体的例子 - 没有凭据、API 密钥或私有路径 - 结构化以便于检索
## 反模式
1. **不要自动保存** - 始终先询问 2. **不要保存未使用的工具** - 只保存实际使用过的工具 3. **不要保存一知半解的概念** - 先学习,后保存 4. **不要包含机密信息** - 没有 API 密钥、密码、令牌 5. **不要创建肤浅的条目** - 如果你不能很好地解释它,就不要保存它 6. **不要重复** - 先检查是否存在,如需要则更新
## API 使用
使用包装脚本:
```bash {baseDir}/scripts/ensue-api.sh <method> '<json_args>' ```
### 操作
**搜索知识:** ```bash {baseDir}/scripts/ensue-api.sh discover_memories '{"query": "how does X work", "limit": 5}' ```
**按命名空间列出:** ```bash {baseDir}/scripts/ensue-api.sh list_keys '{"prefix": "public/concepts/", "limit": 20}' ```
**获取特定条目:** ```bash {baseDir}/scripts/ensue-api.sh get_memory '{"key_names": ["public/concepts/programming/recursion"]}' ```
**创建条目:** ```bash {baseDir}/scripts/ensue-api.sh create_memory '{"items":[ {"key_name":"public/concepts/domain/name","description":"Short description","value":"Full content","embed":true} ]}' ```
**更新条目:** ```bash {baseDir}/scripts/ensue-api.sh update_memory '{"key_name": "public/toolbox/_index", "value": "Updated content"}' ```
**删除条目:** ```bash {baseDir}/scripts/ensue-api.sh delete_memory '{"key_name": "public/notes/old-draft"}' ```
## 工具箱索引
将 `public/toolbox/_index` 维护为主参考:
``` TOOLBOX INDEX =============
Categories: languages/ Programming languages frameworks/ Libraries and frameworks devtools/ Development utilities infrastructure/ Deployment, hosting, CI/CD productivity/ Workflow and productivity tools data/ Databases, analytics, data tools
Recent additions: [tool] - [one-line description]
Browse: "show my toolbox" or "what tools do I have for [category]" ```
## 意图映射
| 用户说 | 动作 | |-----------|--------| | "save this", "remember this"(保存这个,记住这个) | 起草条目,确认,保存 | | "what do I know about X"(我知道关于 X 的什么) | 搜索并检索相关条目 | | "add [tool] to toolbox"(添加 [工具] 到工具箱) | 创建工具箱条目 | | "list my [domain] concepts"(列出我的 [领域] 概念) | 列出该命名空间的键 (list_keys) | | "show my toolbox"(显示我的工具箱) | 显示工具箱索引 | | "update [entry]"(更新 [条目]) | 获取,显示差异,更新 | | "delete [entry]"(删除 [条目]) | 确认,删除 | | "search for [topic]"(搜索 [主题]) | 在所有知识中进行语义搜索 |
## 设置
需要 `ENSUE_API_KEY` 环境变量。
在此获取密钥:https://www.ensue-network.ai?utm_source=clawdbot&utm_medium=workflow
在 clawdbot.json 中配置: ```json "skills": { "entries": { "second-brain": { "apiKey": "your-ensue-api-key" } } } ```
## 安全
- **绝不** 记录或显示 API 密钥 - **绝不** 在条目中存储凭据、令牌或机密信息 - **绝不** 包含个人文件路径或系统详细信息