Install
openclaw skills install @myd2002/query-kbAnswer questions from personal and team knowledge bases with strict source grounding, no-answer behavior when the knowledge base lacks evidence, answer validation, and query logging.
openclaw skills install @myd2002/query-kb基于个人知识库、团队知识库、项目空间或跨库范围回答问题。所有回答必须依赖知识库来源;知识库没有答案时直接说明没有答案,不补通用知识。
Activate when:
Do NOT activate when:
ingest_documentbatch_compilekb_reviewOpenClaw 字段映射:
SenderId:发消息的人 open_idChatType:direct 或 groupGroupSubject:群聊 chat_id;私聊为空python3 scripts/resolve_scope.py \
--sender_id <SenderId> \
--chat_type <ChatType> \
--chat_id <GroupSubject> \
--question "<用户问题>"
范围规则:
SenderId -> users.json -> 个人库 / 用户所属团队GroupSubject -> chat_bindings.json -> team_id -> 团队库people/<姓名>.mdpython3 scripts/kb_list.py --owner <owner> --repo <repo> --kind all
优先级:
projects/<project>/index/timeline/decisions/open_questions/peoplepeople/<姓名>.mdconcepts/resources/summaries/python3 scripts/kb_read.py --owner <owner> --repo <repo> --path "<page path>"
回答只能基于精读内容。
必须包含:
来源:
1. 《页面名》(个人知识库/团队知识库/项目)链接
没有命中:
我在知识库中没有找到与「xxx」相关的资料,因此无法基于知识库回答。
来源:无
资料不足:
我找到了相关资料,但其中没有足够信息回答该问题,因此目前不能得出结论。
来源:
1. 《页面名》链接
发送给用户前必须调用:
python3 scripts/validate_answer.py --answer_file /tmp/paperkb/answer.md \
--allowed_sources_file /tmp/paperkb/read_pages.json
校验规则:
来源: 直接失败。来源:无。allowed_sources 或 allowed_sources_file,回答中的来源必须来自本次实际读取的页面。查了哪个库就写哪个库;跨库两个都写:
python3 scripts/log_query.py --owner <owner> --repo <repo> \
--open_id <SenderId> --question "<用户问题>" --scope "<scope>" --hits "<命中页面>"
resolve_scope.py:判断个人库/团队库/跨库范围chat_context.py:解析 OpenClaw 群聊上下文和群绑定kb_list.py:读取目录kb_read.py:读取具体页面validate_answer.py:机械校验回答是否满足来源约束log_query.py:记录查询日志