MindGraph 🕸️🧠
A knowledge graph + learnable process engine for OpenClaw. Two core features:
- 1. Knowledge Graph — Obsidian-style
[[wikilinks]] across all workspace files - MindSkills — Learned, repeatable processes that save graph-connected results
Always-On Rules
Every time you write or edit a markdown file, use [[wikilinks]] for:
- - People:
[[Alice]], INLINECODE3 - Projects:
[[my-saas]], INLINECODE5 - Companies/tools:
[[Stripe]], [[Vercel]], INLINECODE8 - Concepts/frameworks:
[[Knockout Test]], INLINECODE10 - Other agents/models:
[[Claude Code]], INLINECODE12
This is not optional. Links are how knowledge connects. No links = isolated notes = useless.
NEVER use [[wikilinks]] in messages to the user (Telegram, Discord, etc.). Wikilinks are for workspace files only. In conversations, write names plain: "Alice", not "[[Alice]]".
After significant file changes, rebuild the index:
CODEBLOCK0
Graph Commands
CODEBLOCK1
MindSkills — Learned Processes
MindSkills are repeatable frameworks stored in skills/mindgraph/mindskills/. Each has a defined process and saves results as graph-connected markdown.
Using a MindSkill
CODEBLOCK2
When a user asks to run a process (e.g., "run the knockout test on X"), follow this flow:
- 1. Read the mindskill's
PROCESS.md for the process definition - Execute the process conversationally
- Save the result to INLINECODE16
- Use
[[wikilinks]] throughout the result file - Include YAML frontmatter with metadata
- Rebuild the graph index
Result file template:
CODEBLOCK3
Learning a New MindSkill
When a user says "learn a mindskill called X" or describes a repeatable process:
CODEBLOCK4
This creates the directory structure. Then write the PROCESS.md based on the user's description.
A good PROCESS.md contains:
- - Purpose: What this process does and when to use it
- Trigger phrases: What the user might say to invoke this
- Steps: The actual process to follow (numbered)
- Output format: What the result file should contain
- Verdict/scoring: How to summarize the outcome (if applicable)
Discovering MindSkills
When a user's request matches a learned mindskill, proactively suggest it:
- - "Want me to run the [[Knockout Test]] on that?"
- "I have an [[SEO Validator]] mindskill — should I audit that?"
- "This looks like a [[Competitor Analysis]] — want the full framework?"
Link Resolution
Links match (case-insensitive) against:
- 1. File basenames:
[[MEMORY]] → INLINECODE19 - Project dirs:
[[my-saas]] → INLINECODE21 - MindSkill results:
[[Pet Tracker KT]] → knockout test result - YAML aliases:
aliases: [AV-Check] → [[AV-Check]] resolves - Unresolved → concept node (still tracked for backlinks)
File Locations
- - Graph index:
mindgraph.json (workspace root) - MindSkills: INLINECODE26
- Script: INLINECODE27
MindGraph 🕸️🧠
一个面向OpenClaw的知识图谱+可学习流程引擎。两大核心功能:
- 1. 知识图谱 — 跨所有工作区文件的Obsidian风格[[wikilinks]]
- 心智技能 — 已学习的、可重复执行的流程,保存图谱关联的结果
常驻规则
每次编写或编辑Markdown文件时,必须使用[[wikilinks]]关联:
- - 人物:[[Alice]]、[[Bob]]
- 项目:[[my-saas]]、[[landing-page]]
- 公司/工具:[[Stripe]]、[[Vercel]]、[[GitHub]]
- 概念/框架:[[Knockout Test]]、[[B2B SaaS]]
- 其他智能体/模型:[[Claude Code]]、[[Sonnet]]
此为强制要求。链接是知识连接的方式。无链接 = 孤立笔记 = 无用。
切勿在发送给用户的消息中使用[[wikilinks]](Telegram、Discord等)。Wikilinks仅用于工作区文件。在对话中,直接使用名称原文:Alice,而非[[Alice]]。
在重要文件变更后,重建索引:
bash
python3 skills/mindgraph/scripts/mindgraph.py index
图谱命令
bash
构建/重建索引
python3 skills/mindgraph/scripts/mindgraph.py index
查询主题(反向链接 + 上下文 + 关联)
python3 skills/mindgraph/scripts/mindgraph.py query <名称>
仅反向链接(哪些引用了此内容?)
python3 skills/mindgraph/scripts/mindgraph.py backlinks <名称>
正向链接(此内容链接到哪些?)
python3 skills/mindgraph/scripts/mindgraph.py links <文件>
双向关联
python3 skills/mindgraph/scripts/mindgraph.py connections <名称>
ASCII树形可视化
python3 skills/mindgraph/scripts/mindgraph.py tree <名称> [深度]
查找孤立节点、死链接、无关联文件
python3 skills/mindgraph/scripts/mindgraph.py orphans
python3 skills/mindgraph/scripts/mindgraph.py deadlinks
python3 skills/mindgraph/scripts/mindgraph.py lonely
完整统计
python3 skills/mindgraph/scripts/mindgraph.py stats
心智技能 — 可学习流程
心智技能是存储在skills/mindgraph/mindskills/中的可重复框架。每个技能都有定义好的流程,并将结果保存为图谱关联的Markdown文件。
使用心智技能
bash
列出所有已学习的心智技能
python3 skills/mindgraph/scripts/mindgraph.py skills
显示某个心智技能的流程
python3 skills/mindgraph/scripts/mindgraph.py skill <名称>
列出某个心智技能的结果
python3 skills/mindgraph/scripts/mindgraph.py results <名称>
当用户要求执行某个流程时(例如对X运行knockout测试),请遵循以下流程:
- 1. 读取心智技能的PROCESS.md获取流程定义
- 以对话方式执行流程
- 将结果保存至skills/mindgraph/mindskills/<名称>/results/<主题>.md
- 在结果文件中全程使用[[wikilinks]]
- 包含带元数据的YAML前置信息
- 重建图谱索引
结果文件模板:
markdown
mindskill: <技能名称>
subject: <测试/分析的对象>
date:
verdict: <结论>
aliases: [<别名>]
[[<心智技能名称>]]: [[<主题>]]
<按照PROCESS.md定义的流程得出的结果>
关联
学习新的心智技能
当用户说学习一个名为X的心智技能或描述一个可重复流程时:
bash
创建新的心智技能
python3 skills/mindgraph/scripts/mindgraph.py learn <名称>
这将创建目录结构。然后根据用户描述编写PROCESS.md。
一个好的PROCESS.md应包含:
- - 目的:该流程的作用及使用时机
- 触发短语:用户可能用来调用该流程的表述
- 步骤:实际执行的流程(编号列表)
- 输出格式:结果文件应包含的内容
- 结论/评分:如何总结结果(如适用)
发现心智技能
当用户的请求匹配已学习的心智技能时,主动建议使用:
- - 需要我对那个运行[[Knockout Test]]吗?
- 我有一个[[SEO Validator]]心智技能——需要我审计一下吗?
- 这看起来像[[Competitor Analysis]]——需要完整的框架吗?
链接解析
链接(不区分大小写)匹配以下内容:
- 1. 文件基础名:[[MEMORY]] → MEMORY.md
- 项目目录:[[my-saas]] → projects/my-saas/
- 心智技能结果:[[Pet Tracker KT]] → knockout测试结果
- YAML别名:aliases: [AV-Check] → [[AV-Check]]可解析
- 未解析 → 概念节点(仍会追踪反向链接)
文件位置
- - 图谱索引:mindgraph.json(工作区根目录)
- 心智技能:skills/mindgraph/mindskills/
- 脚本:skills/mindgraph/scripts/mindgraph.py