Ontology to ExpertPack Converter
Converts an OpenClaw Ontology skill's append-only knowledge graph into a fully compliant ExpertPack with multi-layer retrieval support.
How to Use
Run the converter script:
CODEBLOCK0
Optional flags:
- -
--schema memory/ontology/schema.yaml — uses type definitions and relation rules - INLINECODE1 — custom pack name (defaults to "Ontology Export")
- INLINECODE2 — override auto-detected pack type
What It Produces
A complete ExpertPack at the output directory:
- -
manifest.yaml — pack identity, type, context tiers, EK metadata placeholder - INLINECODE4 — summary of graph contents, entity/relation counts, navigation guide
- Content organized by mapped category (relationships/, workflows/, facts/, concepts/, operational/, governance/)
- INLINECODE5 in each content directory
- INLINECODE6 — typed entity relation graph (schema 2.3 compliant)
- INLINECODE7 — entity types and terms
- Lead summaries and
## section headers for optimal chunking
Filenames use kebab-case. Content files kept under 3KB.
Post-Conversion Steps
- 1.
cd into the generated ExpertPack directory - Verify content files are 400–800 tokens each (Schema 2.5 — no external chunker needed for correctly-sized files)
- Run EK evaluator to measure esoteric knowledge ratio
- Review and refine
manifest.yaml context tiers - Commit to git and share via expertpack.ai or ClawHub
See expertpack.ai and the expertpack ClawHub skill for full pack maintenance workflows.
Keep the output pack git-friendly and ready for iterative deepening.
本体到专家包转换器
将OpenClaw本体技能的仅追加知识图谱转换为完全兼容的专家包,支持多层检索。
使用方法
运行转换脚本:
bash
python3 {skill_dir}/scripts/convert.py \
--graph memory/ontology/graph.jsonl \
--output ~/expertpacks/my-knowledge-pack
可选参数:
- - --schema memory/ontology/schema.yaml — 使用类型定义和关系规则
- --name My Knowledge Pack — 自定义包名称(默认为本体导出)
- --type auto|person|product|process|composite — 覆盖自动检测的包类型
输出内容
输出目录中将生成完整的专家包:
- - manifest.yaml — 包标识、类型、上下文层级、EK元数据占位符
- overview.md — 图谱内容摘要、实体/关系计数、导航指南
- 按映射类别组织的内容(关系/、工作流/、事实/、概念/、操作/、治理/)
- 每个内容目录中的_index.md
- relations.yaml — 类型化实体关系图(符合schema 2.3标准)
- glossary.md — 实体类型和术语
- 引导摘要和##章节标题,实现最佳分块
文件名采用短横线命名法。内容文件保持在3KB以下。
转换后步骤
- 1. cd进入生成的专家包目录
- 验证每个内容文件为400–800个token(Schema 2.5 — 正确大小的文件无需外部分块器)
- 运行EK评估器测量深奥知识比例
- 审查并优化manifest.yaml中的上下文层级
- 提交到git并通过expertpack.ai或ClawHub分享
完整的包维护工作流程请参见expertpack.ai和expertpack ClawHub技能。
保持输出包对git友好,并准备好进行迭代深化。