brain-ops
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBrain Operations — The Ambient Context Layer
Brain操作 — 环境上下文层
The brain is not an archive. It is a live context membrane that every interaction
flows through in both directions.
Convention: Seefor the 5-step lookup protocol. Convention: Seeskills/conventions/brain-first.mdfor citation and back-link rules.skills/conventions/quality.md
Brain并非一个存档库,而是一个动态的上下文膜,所有交互都会双向流经此处。
约定: 请查看了解5步查询协议。 约定: 请查看skills/conventions/brain-first.md了解引用和反向链接规则。skills/conventions/quality.md
Contract
契约
This skill guarantees:
- Brain is checked BEFORE any external API call (brain-first lookup)
- Every inbound signal triggers the READ → ENRICH → WRITE loop
- Every outbound response checks brain for relevant context
- Source attribution on every fact written (inline citations)
[Source: ...] - User's direct statements are highest-authority data
- Back-links maintained on every brain write (Iron Law)
本Skill保证:
- 在调用任何外部API前先检查Brain(优先查询Brain)
- 每个入站信号都会触发「读取 → 丰富 → 写入」循环
- 每个出站响应都会检查Brain以获取相关上下文
- 写入的每条事实都带有来源归因(行内引用格式)
[Source: ...] - 用户的直接陈述是最高权威数据
- 每次Brain写入都会维护反向链接(铁则)
Iron Law: Back-Linking (MANDATORY)
铁则:反向链接(强制性要求)
Every mention of a person or company with a brain page MUST create a back-link
FROM that entity's page TO the page mentioning them. An unlinked mention is a
broken brain. See for format.
skills/conventions/quality.md任何提及拥有Brain页面的个人或公司的内容,必须创建一条从该实体页面指向提及页面的反向链接。未链接的提及会导致Brain功能异常。格式请查看。
skills/conventions/quality.mdPhases
阶段
Phase 1: Brain-First Lookup (MANDATORY)
阶段1:优先查询Brain(强制性要求)
Before using ANY external API to research a person, company, or topic:
- — keyword search for existing pages
gbrain search "name" - — hybrid search for context
gbrain query "natural question about name" - — if you know the slug, read the full page
gbrain get <slug> - Check backlinks: who references this entity?
- Check timeline: recent events involving this entity
The brain almost always has something. External APIs fill gaps, not start from scratch.
在使用任何外部API研究个人、公司或主题之前:
- — 对现有页面进行关键词搜索
gbrain search "name" - — 混合搜索获取上下文
gbrain query "natural question about name" - — 若已知slug,读取完整页面
gbrain get <slug> - 检查反向链接:哪些实体引用了该对象?
- 检查时间线:涉及该实体的近期事件
Brain几乎总能提供相关信息。外部API仅用于填补空白,而非从零开始。
Phase 2: On Every Inbound Signal (READ → ENRICH → WRITE)
阶段2:处理每个入站信号(读取 → 丰富 → 写入)
Every message, meeting, email, or conversation that references a person or company:
- Detect entities — people, companies, deals mentioned
- Load brain pages — read existing pages for context before responding
- Identify new information — what does this signal tell us that the page doesn't know?
- Write it back — update the brain page with new info + timeline entry + source citation
- Create if missing — if notable and no page exists, create via enrich skill
User's direct statements are the highest-value data source. Write them to brain
pages immediately with attribution .
[Source: User, YYYY-MM-DD]每条提及个人或公司的消息、会议记录、邮件或对话:
- 识别实体 — 提取提及的人物、公司、交易
- 加载Brain页面 — 在回复前读取现有页面获取上下文
- 识别新信息 — 该信号包含哪些页面中没有的内容?
- 写回Brain — 更新Brain页面,添加新信息、时间线条目和来源引用
- 缺失则创建 — 若实体值得记录但无对应页面,通过enrich skill创建
用户的直接陈述是最高价值的数据源。 需立即写入Brain页面,并标注归因。
[Source: User, YYYY-MM-DD]Phase 2.5: Structured Graph Updates (automatic)
阶段2.5:结构化图谱更新(自动执行)
Every call automatically extracts entity references and writes them
to the graph ( table) with inferred relationship types. Stale links
(refs no longer in the page text) are removed in the same call. This is
"auto-link" reconciliation.
put_pagelinks- No manual calls needed for ordinary page writes.
add_link - Inferred link types: (meeting -> person),
attended,works_at,invested_in,founded,advises(frontmatter),source(default).mentions - The MCP response includes
put_pageso the agent can verify outcomes.auto_links: { created, removed, errors } - To disable: . Default is on.
gbrain config set auto_link false - Timeline entries with specific dates still need explicit (or batch via
gbrain timeline-add).gbrain extract timeline --source db
每次调用都会自动提取实体引用,并将其写入图谱(表),同时推断关系类型。页面文本中不再存在的陈旧链接会在同一调用中被移除。这就是「自动链接」协调机制。
put_pagelinks- 普通页面写入无需手动调用
add_link - 推断的链接类型:(会议→个人)、
attended、works_at、invested_in、founded、advises(前置元数据)、source(默认)mentions - 的MCP响应包含
put_page,以便Agent验证结果auto_links: { created, removed, errors } - 如需禁用:。默认开启。
gbrain config set auto_link false - 带有特定日期的时间线条目仍需显式调用(或通过
gbrain timeline-add批量处理)gbrain extract timeline --source db
Phase 3: On Every Outbound Response (READ → PULL → RESPOND)
阶段3:处理每个出站响应(读取 → 提取 → 回复)
Before answering any question about a person, company, or topic:
- Check the brain — read relevant pages
- Pull context — use compiled truth + recent timeline
- Respond with context — the brain makes every answer better
Don't answer from general knowledge when a brain page exists.
在回答任何关于个人、公司或主题的问题之前:
- 检查Brain — 读取相关页面
- 提取上下文 — 使用整合的事实数据+近期时间线
- 结合上下文回复 — Brain能让每个回答更精准
当存在对应Brain页面时,请勿仅凭通用知识作答。
Phase 4: Ambient Enrichment
阶段4:环境式丰富
This is not a special mode. This is the default. Everything the user says is an
ingest event.
- Person mentioned → check brain, create/enrich if needed (spawn background)
- Company mentioned → same
- Link shared → ingest it (delegate to idea-ingest)
- Data shared → delegate to appropriate skill
Rules:
- Never interrupt the conversation to do enrichment
- Spawn sub-agents for anything that would slow down the response
- Never announce "I'm enriching the brain" — just do it silently
这并非特殊模式,而是默认行为。用户所说的一切都是摄入事件。
- 提及个人 → 检查Brain,必要时创建/丰富页面(后台执行)
- 提及公司 → 同上
- 分享链接 → 摄入内容(委托给idea-ingest skill)
- 分享数据 → 委托给对应skill处理
规则:
- 绝不要为了执行丰富操作而打断对话
- 对于任何会拖慢响应速度的任务,启动子Agent处理
- 绝不要告知用户「我正在丰富Brain」—— 静默执行即可
Output Format
输出格式
No separate output. Brain-ops is an always-on behavior layer, not a report generator.
The output is updated brain pages and enriched responses.
无单独输出。Brain操作是一个始终运行的行为层,而非报告生成器。输出为更新后的Brain页面和经过丰富的响应内容。
Cross-source citation format (v0.18.0+)
跨来源引用格式(v0.18.0+)
When a brain has multiple sources (wiki, gstack, yc-media, etc.), every
citation MUST include the source id: . Example:
[source-id:slug]You told me about the retry budget approach — see [wiki:topics/resilience] and [gstack:plans/retry-policy] for where this came from.
Rules:
- The key is (immutable), never
sources.id(mutable display).sources.name - Single-source brains still write OR may omit the prefix for backward compat.
[default:slug] - Every page payload returned by ,
search,query,get_pagecarrieslist_pages— always use it when citing, never guess.source_id
If a search result has and ,
the citation is . That's the whole rule.
source_id: "gstack"slug: "plans/foo"[gstack:plans/foo]当Brain包含多个来源(wiki、gstack、yc-media等)时,每条引用必须包含来源ID:。示例:
[source-id:slug]您曾提及重试预算方案 — 详情请查看 [wiki:topics/resilience] 和 [gstack:plans/retry-policy]。
规则:
- 使用(不可变)作为标识,绝不使用
sources.id(可变显示名)sources.name - 单一来源的Brain仍可写为,或为兼容旧版本省略前缀
[default:slug] - 、
search、query、get_page返回的所有页面负载都带有list_pages— 引用时务必使用该值,切勿猜测source_id
若搜索结果的且,则引用格式为。这就是全部规则。
source_id: "gstack"slug: "plans/foo"[gstack:plans/foo]Anti-Patterns
反模式
- Answering questions about people/companies without checking the brain first
- Using external APIs before checking the brain
- Writing facts without inline citations
[Source: ...] - Blocking the response to do enrichment
- Overwriting user's direct statements with lower-authority sources
- Creating brain pages for non-notable entities
- 未先检查Brain就回答关于个人/公司的问题
- 未检查Brain就调用外部API
- 写入事实时未添加行内引用
[Source: ...] - 为执行丰富操作而阻塞响应
- 用低权威来源覆盖用户的直接陈述
- 为非重要实体创建Brain页面
Tools Used
使用的工具
- — keyword search
search - — hybrid vector+keyword search
query - — read a brain page
get_page - — create/update brain pages
put_page - — cross-reference entities
add_link - — record events
add_timeline_entry - — check who references an entity
get_backlinks - — sync changes to the index
sync_brain
- — 关键词搜索
search - — 向量+关键词混合搜索
query - — 读取Brain页面
get_page - — 创建/更新Brain页面
put_page - — 实体交叉引用
add_link - — 记录事件
add_timeline_entry - — 检查哪些实体引用了目标对象
get_backlinks - — 将变更同步到索引
sync_brain