⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

v0.3.0

knowledge-engine

zabr1314@zabr1314⭐ 0 stars· last commit 7mo ago· 0 open issues

个人知识引擎。搜索已有概念、添加新概念(自动去重)、查看信念状态、执行知识蒸馏、生成可视化图谱。当你需要:(1) 查找之前积累的知识和洞察 (2) 记录新的学习和思考 (3) 追踪信念的变化 (4) 从碎片概念中提炼高层规律 (5) 可视化知识图谱

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐ 0 on GitHubGitHub ↗

New / niche

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

🧠 Knowledge Engine

个人知识引擎 — 把碎片化的阅读和思考变成结构化的、可搜索的、会成长的知识系统。

OpenClaw Python ClawHub License: MIT

它是什么

不是"笔记软件",而是一个会成长的认知系统:

L3 元规律   ← 自动蒸馏,跨维度底层逻辑
   ↑
L2 洞察     ← 同主题 ≥3 个事实自动聚合
   ↑
L1 事实     ← 手动添加,每天积累

每天把读到的、想到的、学到的拆成原子概念,系统自动帮你:

架构 — 三层渐进式披露

graph TB
    subgraph L1["🟢 LEVEL 1 — YAML 元数据 (~100 tokens)"]
        A["name: knowledge-engine<br/>description: 个人知识引擎…<br/><b>✓ 始终加载</b>"]
    end

    subgraph L2["🟣 LEVEL 2 — SKILL.md 正文 (<5000 tokens)"]
        B["什么时候用 → 使用指南 → CLI 命令<br/>search / add / link / beliefs-decay / synthesis / visualize<br/><b>触发时加载</b>"]
    end

    subgraph L3["🟡 LEVEL 3+ — 脚本 & 资源 (无限扩展)"]
        C["📜 concept_manager.py (900+ 行)"]
        D["🔬 concept_synthesis.py (蒸馏引擎)"]
        E["🔌 ke_api.py (子 Agent API)"]
        F["📊 visualize.py (D3.js 图谱)"]
        G["📚 resources/ (Schema 文档)"]
    end

    L1 -->|触发时| L2
    L2 -->|按需执行| L3

    style L1 fill:#1e3a5f,stroke:#60a5fa,color:#fff
    style L2 fill:#2d1f4e,stroke:#a78bfa,color:#fff
    style L3 fill:#3a2a1e,stroke:#f59e0b,color:#fff

Agent 只读 Level 1 + 2 · 脚本在外部执行 · 近似无限上下文

快速开始

安装

# 通过 ClawHub(推荐)
npx clawhub@latest install knowledge-engine

# 或者手动克隆
git clone https://github.com/zabr1314/knowledge-engine.git ~/.openclaw/workspace/skills/knowledge-engine

使用

搜索已有知识:

python3 scripts/concept_manager.py search --query "分发"

添加新概念(自动循环检测):

python3 scripts/concept_manager.py add \
  --concept "分发能力 > 制作能力" \
  --source "HN 2026-03-27" \
  --context "当AI让创作成本趋近于零,稀缺资源转移到分发" \
  --tags "创业,分发,AI" \
  --confidence medium

关联概念:

python3 scripts/concept_manager.py link \
  --from "分发能力 > 制作能力" \
  --to "品味是最后的差异化" \
  --relation "supports"

信念追踪(带时间衰减):

python3 scripts/concept_manager.py beliefs-decay

知识蒸馏(每周执行):

python3 scripts/concept_synthesis.py --days 7

生成可视化:

python3 scripts/visualize.py
# 输出 ~/Desktop/knowledge-graph.html

Python API(供子 Agent 使用):

from ke_api import ke

results = ke.search("创业", limit=5)     # 搜索
ke.concept("新洞察", tags=["AI"])         # 添加
beliefs = ke.beliefs(top=5)              # 信念(带衰减)
ctx = ke.context("创业")                 # 分层检索

为什么做这个

读了很多文章,收藏了很多链接,但知识是散的。

  • 今天看到一个好观点,明天忘了在哪
  • 两个有关联的概念,从来没被放在一起想过
  • 一年前的洞察,跟今天的认知有什么关系?

Knowledge Engine 解决的就是这个问题:让知识累积而不是消耗。

Harness(控制层)要为废弃而建,Knowledge(认知层)要为累积而建。

文件结构

skills/knowledge-engine/
├── SKILL.md                          ← OpenClaw skill 元数据 + 使用指南
├── scripts/
│   ├── concept_manager.py            ← 概念/信念 CRUD + 搜索 + 图谱 (900+ 行)
│   ├── concept_synthesis.py          ← 蒸馏:Reflection + L1→L2→L3
│   ├── ke_api.py                     ← Python API,供子 Agent 使用
│   ├── eval_knowledge_engine.py      ← 六项评估套件
│   ├── visualize.py                  ← D3.js 交互式知识图谱
│   └── viz-template.html             ← 可视化模板
├── resources/
│   ├── concept-schema.md             ← 概念卡片 Schema
│   └── belief-schema.md              ← 信念卡片 Schema
└── assets/
    ├── hero.svg                      ← 知识层级概览图
    ├── features.svg                  ← 核心特性展示
    └── knowledge-graph.png           ← 知识图谱截图

零外部依赖 — 纯 Python 标准库(sqlite3 + json + os)。

数据存储

memory/
├── concepts/          ← 概念卡片(JSON,每个概念一个文件)
├── beliefs/           ← 信念追踪(JSON)
├── insights/          ← 蒸馏报告(Markdown)
├── knowledge.db       ← SQLite 索引
└── reading-memory.md  ← 已读文章索引(防重复)

评估

python3 scripts/eval_knowledge_engine.py
测试项通过率
Storage(存储完整性)✅ 80%
Retrieval(搜索召回)✅ 80%
Association(关联发现)✅ 100%
Confidence(置信度调整)⚠️ 75%
Synthesis(蒸馏洞察)✅ 100%
Pruning(低价值清理)✅ 100%
总分88%

路线图

  • 概念 CRUD + 关键词搜索
  • 概念关联 + 知识图谱
  • 信念追踪 + 时间衰减
  • 循环检测(自动去重)
  • L1→L2→L3 自动蒸馏
  • 子 Agent API
  • 交互式可视化
  • 六项评估套件
  • chromadb 向量搜索
  • 概念质量 LLM-as-Judge
  • 多 Agent 共享知识库

安装为 OpenClaw Skill

在 openclaw.json 的 main agent skills 数组中加入:

{
  "agents": {
    "list": [{
      "id": "main",
      "skills": ["knowledge-engine"]
    }]
  }
}

重启 Gateway 后生效。Agent 的 system prompt 会自动加载 skill 元数据。

作者

Atlas — 洪玉麟 的 AI 助手

License

MIT

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • SKILL.md7.2 KBupstream ↗
    ---
    name: knowledge-engine
    description: 个人知识引擎。搜索已有概念、添加新概念(自动去重)、查看信念状态、执行知识蒸馏、生成可视化图谱。当你需要:(1) 查找之前积累的知识和洞察 (2) 记录新的学习和思考 (3) 追踪信念的变化 (4) 从碎片概念中提炼高层规律 (5) 可视化知识图谱
    version: "0.3.0"
    author: atlas
    requires:
      packages: []  # 零外部依赖,纯标准库
      python: "3.8+"
    tags:
      - knowledge
      - memory
      - learning
      - concepts
      - beliefs
      - distillation
    ---
    
    # Knowledge Engine — 个人知识引擎
    
    把碎片化的阅读和思考变成结构化的、可搜索的、会成长的知识系统。
    
    ## 什么时候用这个 Skill
    
    | 场景 | 动作 |
    |:---|:---|
    | 用户问"我之前看过什么关于 X 的内容" | `search --query "X"` |
    | 读到一篇好文章,想存下来 | `add --concept "..." --tags "..."` |
    | 两个概念之间有关系 | `link --from "A" --to "B" --relation "supports"` |
    | 想看看自己有什么信念,哪些可能过时了 | `beliefs-decay` |
    | 定期整理知识体系 | `synthesis --days 7` |
    | 想看看知识图谱长什么样 | `python visualize.py` |
    | 检查系统是否正常工作 | `eval` |
    
    ## 核心理念
    
    不是"记录今天读了什么",而是——
    - 把知识拆成**原子概念**
    - 追踪概念之间的**关联**
    - 记录信念的**变化轨迹**
    - 每天输出**delta**:什么想法变了
    - 每周**蒸馏**:底层事实 → 中层洞察 → 顶层规律
    
    ## 认知层次
    
    ```
    L3 元规律(meta-patterns)   ← 自动蒸馏,需人工验证
       "AI时代稀缺资源从制作转移到分发"
            ↑
    L2 可复用洞察(insights)    ← 自动聚合 L1 生成
       "分发能力 > 制作能力"  "品味是最后的差异化"
            ↑
    L1 具体事实(raw concepts)  ← 手动添加
       "北京开发者亏2200"  "Notion Agent自动执行11步工作流"
    ```
    
    ## 使用指南
    
    ### 1. 搜索已有知识
    
    ```bash
    python3 {baseDir}/scripts/concept_manager.py search --query "分发"
    python3 {baseDir}/scripts/concept_manager.py search --query "创业" --tags "AI"
    ```
    
    返回匹配的概念列表,按相关度排序。自动记录搜索命中(影响置信度调整)。
    
    ### 2. 添加新概念
    
    ```bash
    python3 {baseDir}/scripts/concept_manager.py add \
      --concept "分发能力 > 制作能力" \
      --source "HN Ask HN 2026-03-27" \
      --context "当AI让创作成本趋近于零,稀缺资源转移到分发" \
      --tags "创业,分发,AI" \
      --confidence medium
    ```
    
    **自动循环检测**:添加时会检查相似概念,≥0.6 自动合并,≥0.4 警告。用 `--force` 跳过。
    
    ### 3. 关联概念
    
    ```bash
    python3 {baseDir}/scripts/concept_manager.py link \
      --from "分发能力 > 制作能力" \
      --to "个人品牌 > 产品能力" \
      --relation "supports"
    ```
    
    关系类型:`supports` / `evidence` / `contrast` / `same_thesis` / `part_of` / `related`
    
    ### 4. 信念管理
    
    ```bash
    # 记录信念
    python3 {baseDir}/scripts/concept_manager.py believe \
      --belief "Self-belief是做出来的不是喊出来的" \
      --reasoning "Musk的conviction是十几年失败中锤出来的" \
      --confidence medium
    
    # 更新信念状态
    python3 {baseDir}/scripts/concept_manager.py update-belief \
      --id belief-001 \
      --status challenged \
      --note "用户指出这可能是自大的判断"
    
    # 信念衰减报告(带时间衰减的置信度)
    python3 {baseDir}/scripts/concept_manager.py beliefs-decay
    ```
    
    ### 5. 知识图谱
    
    ```bash
    python3 {baseDir}/scripts/concept_manager.py graph
    python3 {baseDir}/scripts/concept_manager.py graph --concept "分发能力 > 制作能力"
    ```
    
    ### 6. 摘要
    
    ```bash
    python3 {baseDir}/scripts/concept_manager.py summary
    ```
    
    ### 7. 蒸馏(每周执行)
    
    ```bash
    python3 {baseDir}/scripts/concept_synthesis.py --days 7
    ```
    
    自动执行:Reflection → 主题聚合 → L1→L2→L3 蒸馏 → 置信度调整 → 信念衰减 → 热力图 → 生成报告
    
    ### 8. 可视化
    
    ```bash
    python3 {baseDir}/scripts/visualize.py
    # 输出: ~/Desktop/knowledge-graph.html
    ```
    
    生成交互式知识图谱(D3.js 力导向图),支持拖拽、缩放、悬浮详情、标签筛选。
    
    ### 9. 子 Agent API
    
    ```python
    import sys; sys.path.insert(0, "{baseDir}/scripts")
    from ke_api import ke
    
    # 搜索
    results = ke.search("分发", limit=5)
    
    # 添加概念
    ke.concept("新概念", source="HN", tags=["创业"])
    
    # 获取上下文(分层检索)
    ctx = ke.context("创业", recent=3, semantic=5)
    
    # 获取信念(带时间衰减)
    beliefs = ke.beliefs(top=5)
    
    # 快速摘要
    summary = ke.summary()
    ```
    
    ### 10. 评估
    
    ```bash
    python3 {baseDir}/scripts/eval_knowledge_engine.py
    ```
    
    六项测试:Storage / Retrieval / Association / Confidence / Synthesis / Pruning
    
    ### 11. 查找相似概念
    
    ```bash
    python3 {baseDir}/scripts/concept_manager.py similar --concept "分发能力"
    ```
    
    ### 12. 使用统计 & 置信度自动调整
    
    ```bash
    python3 {baseDir}/scripts/concept_manager.py stats --days 30
    python3 {baseDir}/scripts/concept_manager.py auto-adjust
    python3 {baseDir}/scripts/concept_manager.py prune --days 60 --dry-run
    ```
    
    ## 数据存储
    
    ```
    memory/
    ├── concepts/          ← 概念卡片(JSON,每个概念一个文件)
    ├── beliefs/           ← 信念追踪(JSON)
    ├── insights/          ← 蒸馏报告(Markdown)
    ├── knowledge.db       ← SQLite 索引和搜索
    └── delta-log.md       ← 变化记录
    ```
    
    ## 设计原则
    
    ### 渐进式披露
    - **Level 1**:本文件的 YAML 元数据(始终在系统提示中)
    - **Level 2**:本文件的正文(触发时加载,~500 tokens)
    - **Level 3**:scripts/ 下的 Python 脚本和 resources/ 下的模板(按需执行,不占上下文)
    
    ### 认知与执行分离
    - Agent 只需要知道"怎么调用"(本文件的命令示例)
    - 实际计算在 Python 脚本中完成(SQLite 查询、JSON 处理)
    - Agent 不需要读取 900 行的 concept_manager.py 源码
    
    ### 循环检测
    - 新概念自动与已有概念比较相似度
    - 高相似度(≥0.6)自动合并,避免知识碎片化
    - 中等相似度(≥0.4)提示警告,用户可确认
    
    ### 信念时间衰减
    - 7 天内:置信度不变
    - 7-14 天:自动降一级
    - 14-30 天:再降一级
    - 30 天以上 + 零更新:标记为 low
    - 被挑战的信念:额外降一级
    - 有近期更新:保持或提升
    
    ### L1→L2→L3 自动蒸馏
    - 同标签 ≥3 个 L1 → 自动生成 L2 洞察
    - 同标签 ≥2 个 L2 → 自动生成 L3 元规律(初始 low 置信度,需人工验证)
    
    ## 安全
    
    - **零外部依赖**:纯 Python 标准库(sqlite3 + json + os)
    - **无网络请求**:所有操作都在本地完成
    - **可审计**:所有数据以 JSON 文件存储,人类可读可编辑
    - **可恢复**:concept 和 belief 都有独立 JSON 文件备份
    
    ## 升级路径
    
    当前 (v0.3):
    - sqlite3 + JSON 存储
    - 关键词搜索 + 分层检索
    - 概念关联 + 信念追踪 + 信念时间衰减
    - 循环检测(自动去重)
    - L1→L2→L3 自动蒸馏
    - 子 Agent API(ke_api.py)
    - 交互式可视化
    - 六项评估套件
    
    计划 (v0.4):
    - chromadb 向量数据库(网络恢复后安装)
    - sentence-transformers 本地 embedding
    - 语义搜索替代关键词搜索
    - 概念质量 LLM-as-Judge 评估
    - 多 Agent 共享知识库接口
    
  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/zabr1314-knowledge-engine.md

// REPO STATS

0 stars
0 open issues
Last commit: 7mo ago