360 Secure SkillHub
360 安全技能中心

Knowledge Graph

通过自带 Python 脚本维护 life/areas/** 下的文件式知识图谱:为指定实体新增原子事实、用 supersede 将旧事实标记为被取代并生成新事实、依据活跃事实重写 summary.md 摘要。事实存于 items.json,ID 按实体自增,规则要求不删除事实。依赖本地 python3 与文件读写,无网络请求。

分类:知识
safatinaztepe
safatinaztepe
热度 58.94
最近更新 2026-05-11 15:54:29

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add safatinaztepe/knowledge-graph
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
knowledge-graph
description
Maintain Clawdbot's compounding knowledge graph under life/areas/** by adding/superseding atomic facts (items.json), regenerating entity summaries (summary.md), and keeping IDs consistent. Use when you need deterministic updates to the knowledge graph rather than manual JSON edits.

Knowledge Graph (file-based)

Use the bundled Python script to safely update life/areas/**.

Commands

Add a new fact:

python3 skills/knowledge-graph/scripts/kg.py add \
  --entity people/safa \
  --category status \
  --fact "Runs Clawdbot on a Raspberry Pi" \
  --source conversation

Supersede an old fact (mark old as superseded + create new fact):

python3 skills/knowledge-graph/scripts/kg.py supersede \
  --entity people/safa \
  --old safa-002 \
  --category status \
  --fact "Moved Clawdbot from Pi to a Mac mini"

Regenerate an entity summary from active facts:

python3 skills/knowledge-graph/scripts/kg.py summarize --entity people/safa

Notes

  • Entities live under: life/areas/<kind>/<slug>/
  • Facts live in items.json (array). Summaries live in summary.md.
  • IDs auto-increment per entity: <slug>-001, <slug>-002, ...
  • Never delete facts; supersede them.