Graph Memory Zero
Mission
Deliver a reproducible graph-memory optimization outcome (not just a config diff):
- - stable recall behavior
- explainable filtering semantics
- safe rollout + rollback
- observable runtime state
If user asks “达到你这套效果”, execute the full playbook below.
Load order (mandatory)
- 1.
references/current-baseline.md (known-good baseline) - INLINECODE1 (balanced/precision/recall profiles)
- INLINECODE2 (acceptance checks)
- INLINECODE3 (if any mismatch/failure)
When the user asks about install/download/distribution options, also load:
Reproducible rollout workflow
Phase 0 — Snapshot and schema guard
- 1. Run
gateway.config.schema.lookup for:
-
plugins.entries.graph-memory.config
-
plugins.entries.graph-memory.config.recallPolicy
- 2. Run
gateway.config.get and store:
- current config snapshot
-
baseHash
- 3. Report: plugin enabled state, llm/embedding model, recall policy keys present.
Do not patch before confirming schema path exists.
Phase 1 — Normalize semantics (mem0-compatible)
Ensure these compatibility rules are explicitly explained in summary:
- -
threshold is mem0-style alias; legacy minScore may still exist. - If both appear, effective threshold = max(threshold, minScore) (stricter wins).
- INLINECODE12 is deterministic inference/expansion; no extra LLM call.
- INLINECODE13 supports
fact|preference|task|event|all. - INLINECODE15 (versioned) has higher priority than legacy
preferenceKeywords.
If any rule is not represented in runtime config, patch minimal fields only.
Phase 2 — Apply profile patch (minimal mutation)
Default profile is balanced unless user requests otherwise.
Use gateway.config.patch with smallest scoped patch under:
Balanced target (canonical):
- - INLINECODE19
- INLINECODE20
- INLINECODE21
- INLINECODE22
- INLINECODE23
- INLINECODE24 : include EN+ZH preference words
If user asks for stronger precision or stronger recall, choose profile from references/baseline-profiles.md.
Phase 3 — Post-restart verification
After patch + restart, verify all below:
- 1. Effective config re-read matches intended patch.
- INLINECODE26 debug details available (
details.debug includes threshold/infer/filter summary). - No schema/key regression (
memoryType not dropped, lexicon keys intact). - Query spot-checks pass (from verification playbook).
If any check fails, enter troubleshooting flow.
Phase 4 — Quality validation (must do before claiming success)
Run the query set in references/verification-playbook.md and compare:
- - preference-sensitive queries
- task/event retrieval queries
- mixed-language (CN/EN) preference terms
Success criteria (minimum):
- - relevant top hits improve or stay stable
- off-topic hits do not increase materially
- preference-related queries show better intent alignment
Do not claim “优化完成” without this phase.
Phase 5 — Rollback safety
Always keep rollback notes in output:
- - previous values (
before) - target values (
after) - one-step revert patch path
If regression is observed, rollback immediately to previous stable profile.
Failure handling
A) Local test execution fails
If extension tests fail locally but config intent is clear:
- 1. Skip blocking local test path.
- Use controlled
gateway.config.patch rollout. - Run verification playbook.
- Keep explicit rollback entry.
B) PowerShell path / command failed
If errors indicate missing path or command failure:
- 1. Validate path with
Test-Path first. - Confirm script/CLI location and permissions.
- Retry minimal command only after path is confirmed.
C) Version mismatch signals
If extension folder version and runtime installed version differ:
- - treat as metadata mismatch
- continue config-level rollout, but report mismatch as release check item
Output contract (default reply structure)
Use this structure for user-facing summary:
- 1. 当前状态:enabled / model / embedding / recallPolicy
- mem0 对齐语义:threshold-minScore、infer、memoryType、lexicon
- 本次变更:before → after(只列关键键)
- 验证结果:通过项 / 风险项 / 观测数据
- 下一步建议:继续调优或保持当前
- 回滚信息:可直接执行的 revert 说明
Keep answers concise-first, but never omit verification and rollback details.
Distribution guidance (when requested)
If user asks "how can others install this", provide at least 3 channels:
- 1. ClawHub registry install (online)
- Offline package install (
.skill as zip artifact) - Source-folder install (copy skill folder into workspace
skills/)
Always include:
- - required folder layout check (
SKILL.md at skill root) - post-install reload step (
openclaw gateway restart) - quick verification (
skill appears in available skills and can be triggered)
Anti-patterns (forbid)
- - Large full-config overwrite when only recallPolicy needs change.
- Declaring success without post-restart validation.
- Ignoring threshold/minScore conflict resolution.
- Omitting lexicon version in production summary.
- Hiding test/verification gaps.
Graph Memory Zero
使命
交付一个可复现的图记忆优化成果(不仅仅是配置差异):
- - 稳定的召回行为
- 可解释的过滤语义
- 安全的发布与回滚
- 可观测的运行时状态
如果用户询问“达到你这套效果”,执行以下完整操作手册。
加载顺序(必须遵守)
- 1. references/current-baseline.md(已知良好基线)
- references/baseline-profiles.md(平衡/精确/召回配置)
- references/verification-playbook.md(验收检查)
- references/troubleshooting.md(如有任何不匹配/失败)
当用户询问安装/下载/分发选项时,还需加载:
- - references/install-channels.md
可复现的发布工作流
阶段 0 — 快照与模式保护
- 1. 运行 gateway.config.schema.lookup 检查:
- plugins.entries.graph-memory.config
- plugins.entries.graph-memory.config.recallPolicy
- 2. 运行 gateway.config.get 并存储:
- 当前配置快照
- baseHash
- 3. 报告:插件启用状态、LLM/嵌入模型、召回策略键是否存在。
在确认模式路径存在之前,不要进行修补。
阶段 1 — 规范化语义(mem0 兼容)
确保在摘要中明确解释以下兼容性规则:
- - threshold 是 mem0 风格的别名;旧版 minScore 可能仍然存在。
- 如果两者同时出现,有效阈值 = max(threshold, minScore)(取更严格的值)。
- infer 是确定性推理/扩展;不额外调用 LLM。
- filters.memoryType 支持 fact|preference|task|event|all。
- preferenceLexicon(带版本号)优先级高于旧版 preferenceKeywords。
如果任何规则未在运行时配置中体现,仅修补最小必要字段。
阶段 2 — 应用配置修补(最小变更)
默认配置为平衡,除非用户另有要求。
使用 gateway.config.patch 在以下路径下进行最小范围的修补:
- - plugins.entries.graph-memory.config.recallPolicy
平衡目标(标准配置):
- - threshold: 0.62
- infer: true
- filters.memoryType: all
- preferenceLexicon.version: 2026-03-27.balance-v1
- preferenceLexicon.enabled: true
- preferenceLexicon.keywords:包含中英文偏好词
如果用户要求更强的精确度或更强的召回,从 references/baseline-profiles.md 中选择配置。
阶段 3 — 重启后验证
修补并重启后,验证以下所有项目:
- 1. 生效配置重新读取结果与预期修补一致。
- gm_search 调试详情可用(details.debug 包含阈值/推理/过滤摘要)。
- 无模式/键回归(memoryType 未被删除,词典键完整)。
- 查询抽查通过(来自验证操作手册)。
如果任何检查失败,进入故障排除流程。
阶段 4 — 质量验证(声明成功前必须执行)
运行 references/verification-playbook.md 中的查询集并比较:
- - 偏好敏感查询
- 任务/事件检索查询
- 混合语言(中/英)偏好词
成功标准(最低要求):
- - 相关结果提升或保持稳定
- 无关结果未显著增加
- 偏好相关查询显示更好的意图对齐
未完成此阶段前,不得声称“优化完成”。
阶段 5 — 回滚安全
始终在输出中保留回滚说明:
- - 先前值(before)
- 目标值(after)
- 一步回滚修补路径
如果观察到回归,立即回滚到之前稳定的配置。
故障处理
A) 本地测试执行失败
如果扩展测试在本地失败但配置意图明确:
- 1. 跳过阻塞的本地测试路径。
- 使用受控的 gateway.config.patch 发布。
- 运行验证操作手册。
- 保留明确的回滚条目。
B) PowerShell 路径/命令失败
如果错误指示路径缺失或命令失败:
- 1. 首先使用 Test-Path 验证路径。
- 确认脚本/CLI 位置和权限。
- 仅在路径确认后重试最小命令。
C) 版本不匹配信号
如果扩展文件夹版本与运行时安装版本不同:
- - 视为元数据不匹配
- 继续配置层面的发布,但将不匹配作为发布检查项报告
输出约定(默认回复结构)
使用以下结构进行面向用户的摘要:
- 1. 当前状态:启用状态 / 模型 / 嵌入 / 召回策略
- mem0 对齐语义:阈值-minScore、推理、内存类型、词典
- 本次变更:变更前 → 变更后(仅列出关键键)
- 验证结果:通过项 / 风险项 / 观测数据
- 下一步建议:继续调优或保持当前
- 回滚信息:可直接执行的回滚说明
保持回答简洁优先,但绝不省略验证和回滚细节。
分发指南(当被要求时)
如果用户询问“其他人如何安装这个”,至少提供 3 种渠道:
- 1. ClawHub 注册表安装(在线)
- 离线包安装(.skill 作为 zip 制品)
- 源文件夹安装(将技能文件夹复制到工作区 skills/ 目录)
始终包含:
- - 必需的文件夹布局检查(技能根目录下的 SKILL.md)
- 安装后重新加载步骤(openclaw gateway restart)
- 快速验证(技能出现在可用技能中并可被触发)
反模式(禁止)
- - 仅需修改召回策略时进行大规模全配置覆盖。
- 未进行重启后验证就声明成功。
- 忽略阈值/minScore 冲突解决。
- 在生产摘要中省略词典版本。
- 隐藏测试/验证差距。