Install
openclaw skills install @zhlhlf/qdrant-dbSearch and manage a Qdrant vector knowledge base via local CLI helper
openclaw skills install @zhlhlf/qdrant-dbOpenClaw 外部向量知识库(Qdrant)。不替代 memory_search:
memory_*示例配置(代码不内置默认值,模板见 env.example;本机 .env 当前指向内网 Qdrant 172.26.25.136):
http://127.0.0.1:6333,collection openclawQwen3-Embedding-0.6B(1024 维)脚本:
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py <cmd>
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py search "查询内容"
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py search "DPV2 升级" --top-k 8
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py search "队列名" --collection openclaw
# 单条文本
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py upsert --text "事实或段落" --source note
# 带元数据
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py upsert --text "..." --source manual --tags "dpv2,ops"
# 从文件入库(按段落/块切分)
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py upsert-file /path/to/doc.md --source doc.md
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py ensure # 确保 collection 存在
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py collections
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py info
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py delete --id <point_id>
# 复用 sqlite 里已有向量(默认,不重新 embed)
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py migrate-sqlite
# 指定库路径
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py migrate-sqlite \
--db /root/.openclaw/agents/main/agent/openclaw-agent.sqlite
# 强制按当前 embedding 接口重算向量
python3 /root/.openclaw/workspace/skills/qdrant-db/scripts/kb.py migrate-sqlite --reembed
迁移会写入 payload:path/start_line/end_line/origin=openclaw-sqlite/tags=[migrated,sqlite,memory]。
不会删除 原 sqlite;内置 memory_search 仍可用。
ensureupsert / upsert-filesearch,把命中的 text + source + score 整理进回复配置来源优先级:真实环境变量 > <skill根>/.env(代码不内置默认值;缺必填项会报错,按 env.example 补全 .env 即可)
所有配置统一从环境变量读取;.env 为 shell 风格 KEY=VALUE(支持 export 前缀、单/双引号、# 注释、空行,不支持变量展开)。
统一配置文件 <skill根目录>/.env(与 kb.py 同随 skill 走,权限 600);目录下附脱敏模板 env.example,复制即可开始:
cp env.example .env && chmod 600 .env
# --- Qdrant 向量库 ---
QDRANT_URL=http://172.26.25.136:6333
QDRANT_COLLECTION=openclaw
QDRANT_API_KEY=
# --- Embedding 服务(全量配置已在此,不再依赖 openclaw.json) ---
EMBEDDING_BASE_URL=http://apiproxy.jq.datagrand.cn/v1
EMBEDDING_API_KEY=<真实key>
EMBEDDING_MODEL=Qwen3-Embedding-0.6B
EMBEDDING_DIMS=1024
可覆盖的环境变量:QDRANT_URL / QDRANT_COLLECTION / QDRANT_API_KEY / EMBEDDING_BASE_URL / EMBEDDING_API_KEY / EMBEDDING_MODEL / EMBEDDING_DIMS。
注意:
openclaw.json(schema 白名单,额外字段会导致 gateway 拒绝启动)。agents.defaults.memorySearch 已清理,只剩 enabled:false(关闭内置 memory search),不再作为 embedding 配置来源。upsert-file,不要一次性把整本塞进单点| 内容 | 去哪 |
|---|---|
| 用户偏好、口头约定、日常笔记 | MEMORY.md / memory_search |
| 可复用文档、方案、手册、接口说明 | 本 Qdrant KB |
| 两者都要 | 先 KB 检索,重要结论再按需记 memory |