Brain Skill — 2nd Brain Knowledge Base
A personal knowledge management system for capturing and retrieving information about people, places, things, and ideas.
When to Use This Skill
Brain takes precedence over daily logs for named entities.
Trigger this skill when:
- - User asks you to remember someone, something, or somewhere
- User shares information about a person, place, game, tech, event, media, idea, or organization
- User expresses a preference about an entity ("I like X at Y restaurant" → update Y's file)
- User asks about something that might be in the brain ("Who was that guy from...", "What did I think about...")
- User updates existing knowledge ("Actually, he's 27 now", "I finished that game")
Keywords that trigger: "remember", "note that", "met this person", "visited", "played", "watched", "read", "idea:", "what do I know about", "who is", "where was"
⚠️ Do NOT put brain-eligible content in daily logs. If it's a named entity (person, place, restaurant, product, game, etc.), it belongs in brain/, not memory/YYYY-MM-DD.md. Daily logs are for session context and ephemeral notes only.
🚨 MEDIA FILES MUST BE SAVED. When user sends photos/audio/video/PDFs about a brain entry, you MUST save the actual file to attachments/. Transcribing content is NOT the same as saving the file. Do BOTH.
Data Location
All brain data lives in: INLINECODE3
CODEBLOCK0
Search & Retrieval
This skill uses OpenClaw's built-in memory_search and memory_get tools, which work out of the box with any configured memory backend.
Searching
Use memory_search for all brain lookups:
CODEBLOCK1
INLINECODE7 works transparently whether the backend is the built-in SQLite indexer or QMD. No direct CLI calls needed.
Reading a File
Use memory_get to read a specific brain file once you know its path:
CODEBLOCK2
Direct CLI (Optional / Advanced Only)
Only use the qmd CLI directly when searching a non-workspace collection (e.g., the skills collection). For all brain lookups, use memory_search.
CODEBLOCK3
Operational Rules
Creating a New Entry
- 1. Search first — Run
memory_search("<name or topic>") to check for existing entries - No match — Create new file using the appropriate template from INLINECODE13
- Possible clash — List all potential matches and ask user to confirm before creating
Updating an Existing Entry
- 1. Find the file — Use
memory_search or direct path if known - Surgical edit — Update only the relevant section, don't rewrite the whole file
- Log the date — Add timestamp to Notes or Interactions section
- Update frontmatter — Bump
last_updated field
Searching / Retrieving
- 1. Query memory_search —
memory_search("<natural language question>") for semantic search - Ambiguous results — Surface all candidates to user, ask which one
- No results — Tell user nothing found, offer to create entry
Disambiguation Protocol
When user references something ambiguous (e.g., "John"):
- 1. Search brain for all matches using INLINECODE17
- If multiple results: list them with context
Found 2 matches for "John":
1. John Smith (Symph colleague, met 2024)
2. John Doe (GeeksOnABeach speaker, met 2026)
Which one?
- 3. Wait for confirmation before updating
Templates
Templates live in skills/brain/templates/. Each has:
- - YAML frontmatter with structured fields
- Markdown body with standard sections
When creating a new entry:
- 1. Read the appropriate template
- Fill in known fields
- Leave unknown fields empty or with placeholder
- Write to INLINECODE19
Categories Reference
| Category | Folder | Use For |
|---|
| People | INLINECODE20 | Anyone user has met or wants to remember |
| Places |
brain/places/ | Restaurants, landmarks, venues, locations |
| Games |
brain/games/ | Video games — status, opinions, notes |
| Tech |
brain/tech/ | Devices, products, specs, quirks |
| Events |
brain/events/ | Conferences, meetups, gatherings |
| Media |
brain/media/ | Books, shows, films, podcasts |
| Ideas |
brain/ideas/ | Business ideas, concepts, random thoughts |
| Orgs |
brain/orgs/ | Companies, communities, groups |
Linking Entities
Use wikilink-style references to connect entities:
- -
[[people/raven-duran]] — link to a person - INLINECODE29 — link to an event
- INLINECODE30 — link to an org
This makes relationships explicit and searchable.
Example Workflow
User says: "Hey, I just met this guy called Raven Duran. He's positioning himself as an Agentic coder, met him at GeeksOnABeach PH last February."
Agent does:
- 1.
memory_search("Raven Duran") → no results - Read INLINECODE32
- Create
brain/people/raven-duran.md with filled template - Optionally check/create
brain/events/geeksonabeach-ph-2026.md and link
User says: "The Raven Duran guy, he's still 26 years old"
Agent does:
- 1.
memory_search("Raven Duran") → finds INLINECODE36 - Read file via
memory_get("brain/people/raven-duran.md"), update age: 26 in frontmatter - Add note: INLINECODE39
- Update
last_updated field
Attachments
Brain entries can have attachments: photos, PDFs, videos, audio, transcripts, etc.
🚨 MANDATORY: Save All Media Files
When user sends ANY media (photos, audio, video, PDF) related to a brain entry:
- 1. ALWAYS save the actual file to
attachments/ — this is NON-NEGOTIABLE - THEN analyze/transcribe the content into the profile
- NEVER skip saving the file just because you processed its content
"Saved" means the FILE exists in attachments/, not just that content was transcribed.
CODEBLOCK5
If you transcribed content but didn't save the file → YOU DID IT WRONG. Go back and save it.
Structure
Flat file (no attachments):
CODEBLOCK6
Folder structure (with attachments):
CODEBLOCK7
Attachments Index (attachments/index.md)
CODEBLOCK8
QMD (if enabled) indexes this file, making attachments searchable by description.
Adding Attachments
When user sends media about an entity (e.g., "Here's the menu for Mamou Prime"):
- 1. Find the entry —
memory_search("Mamou Prime") → INLINECODE45
- 2. Convert to folder structure (if flat file):
CODEBLOCK9
- 3. Save media to
attachments/ with descriptive filename
- 4. Update
attachments/index.md with file description
⚠️ Always Save Original Files
Do BOTH:
- 1. Analyze/transcribe the content → add processed text to the profile (e.g., menu tables, business card info, transcript)
- Save the original files → preserve in INLINECODE48
The text is searchable and processable. The originals are preserved artifacts.
Never discard attachments unless user explicitly says "cleanup", "remove", or "delete" the files.
Example: User sends menu photos
- - ✅ Transcribe menu into markdown tables in profile
- ✅ Save original photos to
attachments/menu-1.jpg, INLINECODE50 - ✅ Update INLINECODE51
Wrong: Only transcribing without saving originals
Naming Attachments
Be descriptive — the index provides context:
- -
menu-1.jpg, INLINECODE53 - INLINECODE54
- INLINECODE55
- INLINECODE56
- INLINECODE57
Example: Adding Menu Photos
User sends: 2 photos with message "Menu at Mamou Prime"
Agent does:
- 1. Find
brain/places/mamou-prime-sm-podium.md via INLINECODE59 - Convert to folder structure (if needed)
- Analyze photos → transcribe menu items, prices into markdown tables
- Update profile with transcribed menu section
- Save original photos as
attachments/menu-1.jpg, INLINECODE61 - Update
attachments/index.md:
# Attachments
| File | Description | Added |
|------|-------------|-------|
| menu-1.jpg | Menu page 1 (transcribed to profile) | 2026-02-21 |
| menu-2.jpg | Menu page 2 (transcribed to profile) | 2026-02-21 |
- 7. Confirm to user: "Transcribed menu and saved 2 photos to Mamou Prime"
大脑技能 — 第二大脑知识库
一个用于捕捉和检索关于人物、地点、事物和想法的个人知识管理系统。
何时使用此技能
对于命名实体,大脑技能优先于日常日志。
在以下情况触发此技能:
- - 用户要求你记住某人、某事或某地
- 用户分享关于人物、地点、游戏、科技、事件、媒体、想法或组织的信息
- 用户表达对某个实体的偏好(我喜欢Y餐厅的X → 更新Y的文件)
- 用户询问可能存在于大脑中的内容(那个来自...的家伙是谁,我对...的看法是什么)
- 用户更新已有知识(实际上,他现在27岁了,我通关了那个游戏)
触发关键词: 记住、记下、见过这个人、去过、玩过、看过、读过、想法:、我知道关于...的什么、谁是、哪里是
⚠️ 不要将适合大脑的内容放入日常日志。 如果是命名实体(人物、地点、餐厅、产品、游戏等),它属于 brain/,而不是 memory/YYYY-MM-DD.md。日常日志仅用于会话上下文和临时笔记。
🚨 必须保存媒体文件。 当用户发送与大脑条目相关的照片/音频/视频/PDF时,你必须将实际文件保存到 attachments/。转录内容不等于保存文件。两者都要做。
数据位置
所有大脑数据位于:~/.openclaw/workspace/brain/
brain/
people/ # 联系人,你见过的人
places/ # 餐厅、地标、场所
games/ # 电子游戏及互动
tech/ # 设备、产品、规格、注意事项
events/ # 会议、聚会、集会
media/ # 书籍、节目、电影、播客
ideas/ # 商业想法、概念、思考
orgs/ # 公司、社区、团体
搜索与检索
此技能使用 OpenClaw 内置的 memorysearch 和 memoryget 工具,这些工具可与任何配置的记忆后端直接使用。
搜索
使用 memory_search 进行所有大脑查找:
memory_search(Raven Duran) # 查找人物
memory_search(Mamou Prime 餐厅) # 查找地点
memory_search(Raven 玩过哪些游戏) # 自然语言
无论后端是内置的 SQLite 索引器还是 QMD,memory_search 都能透明工作。无需直接调用 CLI。
读取文件
一旦知道路径,使用 memory_get 读取特定的大脑文件:
memory_get(brain/people/raven-duran.md)
memory_get(brain/places/mamou-prime-sm-podium/mamou-prime-sm-podium.md)
直接 CLI(可选 / 仅限高级)
仅在搜索非工作区集合(例如 skills 集合)时直接使用 qmd CLI。对于所有大脑查找,请使用 memory_search。
bash
仅用于技能集合或非工作区路径:
export PATH=$HOME/.bun/bin:$PATH
qmd search 关键词 -c skills
操作规则
创建新条目
- 1. 先搜索 — 运行 memory_search(<名称或主题>) 检查是否存在已有条目
- 无匹配 — 使用 skills/brain/templates/ 中的相应模板创建新文件
- 可能存在冲突 — 列出所有可能的匹配项,在创建前请用户确认
更新已有条目
- 1. 找到文件 — 使用 memorysearch 或已知的直接路径
- 精准编辑 — 仅更新相关部分,不要重写整个文件
- 记录日期 — 在笔记或互动部分添加时间戳
- 更新前置元数据 — 更新 lastupdated 字段
搜索 / 检索
- 1. 查询 memorysearch — memorysearch(<自然语言问题>) 进行语义搜索
- 结果不明确 — 向用户展示所有候选结果,询问选择哪一个
- 无结果 — 告知用户未找到,提供创建条目的选项
消歧协议
当用户引用模糊内容时(例如John):
- 1. 使用 memory_search(John) 搜索大脑中的所有匹配项
- 如果多个结果:列出它们并提供上下文
找到 2 个匹配 John 的结果:
1. John Smith(Symph 同事,2024 年认识)
2. John Doe(GeeksOnABeach 演讲者,2026 年认识)
请问是哪一个?
- 3. 在更新前等待确认
模板
模板位于 skills/brain/templates/。每个模板包含:
- - 带有结构化字段的 YAML 前置元数据
- 带有标准部分的 Markdown 正文
创建新条目时:
- 1. 读取相应的模板
- 填写已知字段
- 未知字段留空或使用占位符
- 写入 brain/<类别>/<短名称>.md
类别参考
| 类别 | 文件夹 | 用途 |
|---|
| 人物 | brain/people/ | 用户见过或想记住的任何人 |
| 地点 |
brain/places/ | 餐厅、地标、场所、位置 |
| 游戏 | brain/games/ | 电子游戏 — 状态、观点、笔记 |
| 科技 | brain/tech/ | 设备、产品、规格、特性 |
| 事件 | brain/events/ | 会议、聚会、集会 |
| 媒体 | brain/media/ | 书籍、节目、电影、播客 |
| 想法 | brain/ideas/ | 商业想法、概念、随机思考 |
| 组织 | brain/orgs/ | 公司、社区、团体 |
链接实体
使用维基链接风格的引用连接实体:
- - [[people/raven-duran]] — 链接到人物
- [[events/geeksonabeach-2026]] — 链接到事件
- [[orgs/symph]] — 链接到组织
这使得关系明确且可搜索。
示例工作流程
用户说: 嘿,我刚认识了一个叫 Raven Duran 的家伙。他把自己定位为 Agentic 程序员,今年二月在菲律宾 GeeksOnABeach 上认识的。
智能体执行:
- 1. memory_search(Raven Duran) → 无结果
- 读取 skills/brain/templates/person.md
- 创建 brain/people/raven-duran.md 并填充模板
- 可选地检查/创建 brain/events/geeksonabeach-ph-2026.md 并建立链接
用户说: 那个 Raven Duran 的家伙,他还是 26 岁
智能体执行:
- 1. memorysearch(Raven Duran) → 找到 brain/people/raven-duran.md
- 通过 memoryget(brain/people/raven-duran.md) 读取文件,更新前置元数据中的 age: 26
- 添加笔记:- 2026-02-21: 确认仍为 26 岁
- 更新 last_updated 字段
附件
大脑条目可以有附件:照片、PDF、视频、音频、转录文本等。
🚨 强制要求:保存所有媒体文件
当用户发送与大脑条目相关的任何媒体(照片、音频、视频、PDF)时:
- 1. 始终保存实际文件 到 attachments/ — 这是不可协商的
- 然后分析/转录内容到档案中
- 绝不要因为处理了内容就跳过保存文件
保存意味着文件存在于 attachments/ 中,而不仅仅是内容被转录。
bash
必需:复制文件
cp /path/to/inbound/media.jpg brain/places/entry/attachments/descriptive-name.jpg
如果你转录了内容但没有保存文件 → 你做得不对。回去保存它。
结构
平面文件(无附件):
brain/places/manam.md
文件夹结构(有附件):
brain/places/mamou-prime-sm-podium/
mamou-prime-sm-podium.md # 档案(保留原名)
attachments/
index.md # 描述每个附件
menu-page-1.jpg
menu-page-2.jpg
receipt.pdf
storefront.mp4
附件索引(attachments/index.md)
markdown
附件
| 文件 | 描述 | 添加日期 |
|---|
| menu-page-1.jpg | 菜单第一页,主菜部分 | 2026-02-21 |
| menu-page-2