Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

使用技能中的关系记忆

当你希望一个技能告诉代理何时以及如何使用 knowledge 工具捕获工作流、能力和 steward-role 关系时,请使用此模板。它会将图保持为面向操作员的工作流,而不仅仅是内部能力。

创建一个用于 relationship-memory skills 的 bundle,然后搭建该 skill:

sh

zeroclaw skills bundle add relationship-memory
zeroclaw skills add relationship-memory-capture \
  --bundle relationship-memory \
  --description "Capture and query durable workflow relationships with the knowledge graph" \
  --edit

skills add 命令会在你的编辑器中打开 SKILL.md。将生成的文件内容替换为此模板:

---
name: relationship-memory-capture
description: Capture and query durable workflow relationships with the knowledge graph
version: 0.1.0
author: zeroclaw_operator
tags: [knowledge, memory, relationships]
---

# Relationship memory capture

Use this skill when the operator asks to remember or inspect how workflows, skills, capabilities, decisions, lessons, or steward roles connect to each other.

Before writing graph memory:

1. Confirm the deployment has `[knowledge] enabled = true`.
2. Ask what relationship should be remembered and why it should be durable.
3. Ask whether the entry may include private workspace, account, client, or contact context.
4. Refuse to store secrets, tokens, personal email addresses, phone numbers, private URLs, account IDs, session IDs, or credential-like values.

Capture durable things as graph nodes with the `knowledge` tool:

- Use `pattern` for reusable workflows, practices, or skill-shaped procedures.
- Use `technology` for tools, protocols, providers, or capability surfaces.
- Use `expert` for steward roles, maintainer roles, or agent roles. Prefer role labels over real names.
- Use `decision` for design choices, policy calls, or accepted direction.
- Use `lesson` for something learned from an incident, review, or run.

Relate nodes after capture:

- Use `uses` from a workflow or skill to a capability it depends on.
- Use `authored_by` from a workflow or skill to the role that maintains it.
- Use `applies_to` from a lesson, decision, or pattern to the project or capability it affects.

When the operator asks what is connected to a workflow, capability, decision, lesson, or steward role, call `graph_neighbors`.

Keep entries short and factual. If a relationship is uncertain, capture the uncertainty in the content field or ask before writing it.

要使该技能可供某个代理使用,请将 relationship-memory bundle 附加到该代理。例如,在 config 中将 bundle 别名追加到 agents.<alias>.skill_bundles,或使用 dashboard 配置编辑器。

捕获工作流依赖项

这些示例展示了面向模型的 knowledge 工具参数。它们不是 CLI 子命令。

捕获工作流:

{
  action: "capture",
  "node_type": "pattern",
  "title": 发布检查工作流,
  "内容": 在发布签核前检查版本说明、验证证据、变更日志覆盖情况和回滚说明。,
  "tags": ["skill", release]
}

捕获它使用的功能:

{
  action: "capture",
  "node_type": "technology",
  "title": "文档校验能力",
  "内容": "对 mdBook 源更改运行文档质量检查和变更链接验证。",
  "tags": ["capability", docs]
}

将工作流与该能力关联:

{
  action: "relate",
  "from_id": "<release-check-workflow-node-id>",
  "to_id": "<docs-validation-capability-node-id>",
  "relation": "uses"
}

捕获 steward 角色并将其与工作流关联:

{
  action: "capture",
  "node_type": "expert",
  "title": "release-steward 角色",
  "内容": 负责维护发布就绪检查并决定证据何时充分的角色。,
  "tags": ["role", release]
}
{
  action: "relate",
  "from_id": "<release-check-workflow-node-id>",
  "to_id": "<release-steward-role-node-id>",
  "relation": "authored_by"
}

然后检查工作流:

{
  action: graph_neighbors,
  "node_id": "<release-check-workflow-node-id>",
  "limit": 10
}

项目关系

相同的技能模式可以覆盖项目或客户关系,但要将其作为显式扩展。只有在操作员希望进行项目关系跟踪且对该数据有隐私政策时,才添加 clientcontactinteraction 节点指南。 relationship memory 页面展示了该形状的 client_networkinteraction_log 操作。

验证已安装的技能

保存后审计该技能目录。在默认安装根目录下,生成的 bundle 技能位于 ~/.zeroclaw/shared/skills/<bundle>/<skill>/:

sh

zeroclaw skills audit ~/.zeroclaw/shared/skills/relationship-memory/relationship-memory-capture

如果你的安装根目录不是 ~/.zeroclaw,请检查 zeroclaw skills add 打印的路径。

skills audit 会检查技能包的结构。它不能证明你的部署已启用 knowledge 工具,也不能证明图中包含有用数据。为此,请使用占位数据运行一个小型手动会话,并确认代理能够为一个 workflow/capability 对调用 capturerelategraph_neighbors。如果你为项目扩展了模板,还请确认 client_networkinteraction_log 返回预期的占位条目。

另见