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)
references/current-baseline.md(known-good baseline)references/baseline-profiles.md(balanced/precision/recall profiles)references/verification-playbook.md(acceptance checks)references/troubleshooting.md(if any mismatch/failure)
When the user asks about install/download/distribution options, also load:
references/install-channels.md
Reproducible rollout workflow
Phase 0 — Snapshot and schema guard
- Run
gateway.config.schema.lookupfor:plugins.entries.graph-memory.configplugins.entries.graph-memory.config.recallPolicy
- Run
gateway.config.getand store:- current config snapshot
baseHash
- 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:
thresholdis mem0-style alias; legacyminScoremay still exist.- If both appear, effective threshold = max(threshold, minScore) (stricter wins).
inferis deterministic inference/expansion; no extra LLM call.filters.memoryTypesupportsfact|preference|task|event|all.preferenceLexicon(versioned) has higher priority than legacypreferenceKeywords.
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:
plugins.entries.graph-memory.config.recallPolicy
Balanced target (canonical):
threshold: 0.62infer: truefilters.memoryType: allpreferenceLexicon.version: 2026-03-27.balance-v1preferenceLexicon.enabled: truepreferenceLexicon.keywords: 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:
- Effective config re-read matches intended patch.
gm_searchdebug details available (details.debugincludes threshold/infer/filter summary).- No schema/key regression (
memoryTypenot 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:
- Skip blocking local test path.
- Use controlled
gateway.config.patchrollout. - Run verification playbook.
- Keep explicit rollback entry.
B) PowerShell path / command failed
If errors indicate missing path or command failure:
- Validate path with
Test-Pathfirst. - 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:
- 当前状态: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:
- ClawHub registry install (online)
- Offline package install (
.skillas zip artifact) - Source-folder install (copy skill folder into workspace
skills/)
Always include:
- required folder layout check (
SKILL.mdat 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.