Install
openclaw skills install @thomasliu/kb-miniStore, search, and automatically manage a personal or shared knowledge base integrated with OpenClaw through before/after hooks.
openclaw skills install @thomasliu/kb-miniVersion: v1.2.0 Repository: https://github.com/ThomasLiu/knowledge-base-skill
当用户提到以下关键词时触发:
kb store --title "标题" --content "内容" --source "manual"
kb search --query "关键词"
kb retrieve --topic-key "entry-key"
在 before_agent_start hook 中自动调用,检索与当前对话相关的知识。
在 after_turn hook 中自动调用,判断并存储重要内容。
用户: 把这个配置加入知识库
Agent: 使用 kb store 命令存储
用户: 查一下知识库里关于 OpenClaw 的内容
Agent: 使用 kb search 查询并返回结果
| 脚本 | 功能 |
|---|---|
scripts/storage.sh | 核心存储 API |
scripts/retriever.sh | 检索 + recall/capture |
scripts/hooks.sh | OpenClaw Hooks 集成 |
scripts/lifecycle.sh | 生命周期管理 |
Skill 安装后默认使用自身目录存储,无需任何配置:
~/.openclaw/workspace/skills/kb-mini/data/knowledge.db
多个 Agent 共用同一个知识库:
# 在调用 skill 前设置
export KNOWLEDGE_SHARED_NAME="coding-kb"
# 实际路径: ~/.openclaw/shared/knowledge-bases/coding-kb/knowledge.db
指定任意路径作为 KB:
export KNOWLEDGE_DB="/path/to/your/knowledge.db"
| 优先级 | 变量 | 说明 |
|---|---|---|
| 1 | KNOWLEDGE_DB | 显式指定路径 |
| 2 | KNOWLEDGE_SHARED_NAME | 共享 KB 名称 |
| 3 | Skill 内部目录 | 默认,安装即用 |
kb-mini/
├── data/
│ └── knowledge.db # 默认 KB 路径
├── scripts/
│ ├── storage.sh # 存储 API
│ ├── retriever.sh # 检索 API
│ ├── hooks.sh # Hooks 集成
│ └── lifecycle.sh # 生命周期
└── SKILL.md