|
|
3 hari lalu | |
|---|---|---|
| .. | ||
| IMPLEMENTATION.md | 3 hari lalu | |
| README.md | 3 hari lalu | |
| config-examples.md | 3 hari lalu | |
| index.test.ts | 4 hari lalu | |
| index.ts | 4 hari lalu | |
| openclaw.plugin.json | 3 hari lalu | |
| package.json | 4 hari lalu | |
| tsconfig.json | 4 hari lalu | |
KnowHub 知识管理插件,为 OpenClaw Agent 提供知识搜索、保存和自动提醒功能。
在 ~/.openclaw/config.json 中配置:
{
"plugins": {
"entries": {
"knowhub": {
"enabled": true,
"config": {
"apiUrl": "http://43.106.118.91:9999",
"submittedBy": "user@example.com",
"reminderMode": "normal",
"enableServerExtraction": true,
"privacyMode": "strict"
}
}
}
}
}
| 选项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
apiUrl |
string | http://43.106.118.91:9999 |
KnowHub Server 地址 |
submittedBy |
string | "" |
提交者标识(邮箱) |
reminderMode |
enum | normal |
提醒频率:off, minimal, normal, aggressive |
enableServerExtraction |
boolean | true |
启用服务端消息历史提取 |
privacyMode |
enum | strict |
隐私模式:strict, relaxed |
off: 关闭提醒minimal: 每 5 次 LLM 调用提醒一次normal: 每 3 次(默认)aggressive: 每 2 次strict: 自动脱敏敏感信息(路径、邮箱、API Key 等)relaxed: 不脱敏,完整上传kb_search({
query: "使用 Vitest 运行测试",
top_k: 5,
min_score: 3,
types: ["tool", "best-practice"]
})
kb_save({
task: "使用 Vitest 运行测试",
content: "使用 vitest --run 执行单次测试,避免 watch 模式阻塞 CI",
types: ["tool", "best-practice"],
score: 4,
source_name: "vitest",
source_urls: ["https://vitest.dev"]
})
kb_update({
knowledge_id: "knowledge-xxx",
is_helpful: true,
feedback: "这个方法确实有效"
})
user_profile: 用户偏好、习惯、背景strategy: 执行经验(从反思中获得)tool: 工具使用方法、优缺点、代码示例usecase: 用户背景、方案、步骤、效果definition: 概念定义、技术原理、应用场景plan: 流程步骤、决策点、方法论检查 KnowHub Server 是否运行:
curl "http://43.106.118.91:9999/api/knowledge/search?q=test"
检查配置中的 apiUrl 是否正确,确保 Server 可访问。
调整 reminderMode 为 minimal 或 off。
插件使用 TypeScript 编写,依赖:
@sinclair/typebox: 参数验证openclaw/plugin-sdk/core: OpenClaw 插件 APIMIT