Skills librag-knowledge-recall-zh
使用 LibRAG 本地 `/api/v1/librag/knowbase/recall` 接口做知识库数据召回。适用于中文场景下的知识库检索、资料召回、证据段落提取、出处定位、基于知识库的问答取证,以及用户用“知识库查询”“数据召回”“从文档里找答案”等表达发起的任务。
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/7010g/librag-knowledge-recall" ~/.claude/skills/openclaw-skills-librag-knowledge-recall-zh && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/7010g/librag-knowledge-recall" ~/.openclaw/skills/openclaw-skills-librag-knowledge-recall-zh && rm -rf "$T"
manifest:
skills/7010g/librag-knowledge-recall/SKILL.mdsource content
LibRAG 中文知识库召回
优先使用附带脚本调用 LibRAG,不要手写 HTTP 请求。
触发语义
遇到下列表达时优先使用本 Skill:
- “去知识库里查一下”
- “做一下数据召回”
- “从 LibRAG 找相关段落”
- “把出处和原文召回出来”
- “根据知识库检索证据”
- “从文档中找到答案”
输入
必需输入:
:用户要检索的问题或条件。question
配置文件
config.json:
:LibRAG 服务地址。base_url
:与目标知识库绑定的 API Key。api_key
:默认知识库 ID。kb_id
:默认召回模式。recall_mode
:向量召回 top-k。vector_top_k
:全文召回 top-k。fulltext_top_k
:是否返回树形结构。return_tree
:是否包含原文。has_source_text
:是否保留分数字段。has_score
:是否过滤无效结果。filter_effective
:是否启用推理增强。reasoning_enhance
:打分过滤阈值。score_threshold
可选覆盖:命令行参数优先于
config.json:
:覆盖kb_id
里的默认知识库 ID。config.json
:recall_mode
、reasoning
、hybrid
,默认vector
。hybrid
:默认vector_top_k
。20
:默认fulltext_top_k
。20
:默认return_tree
。true
:默认has_source_text
。true
:默认has_score
。true
:默认score_threshold
,作为打分过滤的分数阈值。0
:默认filter_effective
。true
:默认reasoning_enhance
。true
执行
默认使用
config.json 中的知识库:
python {baseDir}/scripts/recall.py --config {baseDir}/config.json --question "<问题>"
需要覆盖知识库时:
python {baseDir}/scripts/recall.py --config {baseDir}/config.json --kb-id 12 --question "这个产品的违约金标准是什么?"
输出
默认直接返回脚本输出 JSON。
关键字段:
requestresponse.msgresponse.datasummary.item_countsummary.result_shape
约束
- 缺少
,或其中的config.json
、base_url
、api_key
,或缺少kb_id
时直接失败。question - 默认使用非流式调用。
- 默认使用
,只有明确要求平铺段落结果时才改成return_tree=true
。false - 不要输出完整 API Key。
- 若返回
或401
,明确提示密钥无效或没有该知识库权限。403 - 若返回
,明确提示知识库不存在。404