1234-vvv2

Use when a user @-mentions the knowledge-base Q&A bot in Feishu and asks a question (or replies to a file). This skill queries the Viking RAG knowledge base at geomgr-bgm.smzdm.com, retrieves matching knowledge chunks, and produces a polished Chinese answer with explicit source citations.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "1234-vvv2" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9cc0e0a59b3b6308927bb5221eddd034e0bf378620158b57fd616ddd53e70dd6. Verify the upstream source and version against https://skillhub.cn/skills/user_ef2963ea/1234-vvv2 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Use when a user @-mentions the knowledge-base Q&A bot in Feishu and asks a question (or replies to a file). This skill queries the Viking RAG knowledge base at geomgr-bgm.smzdm.com, retrieves matching knowledge chunks, and produces a polished Chinese answer with explicit source citations.

0 Downloads

Introduction source: third_party · user_ef2963ea · 1.0.1 Reference

SkillPi interpretation

Tasks
This skill should be used when a user @-mentions the knowledge-base Q&A bot in Feishu and asks a question (or replies to a file). It queries the Viking RAG knowledge base at geomgr-bgm.smzdm.com, retrieves matching knowledge chunks, and produces a polished Chinese answer with explicit source citations.
Inputs and outputs
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: knowledge-search
description: "This skill should be used when a user @-mentions the knowledge-base Q&A bot in Feishu and asks a question (or replies to a file). It queries the Viking RAG knowledge base at geomgr-bgm.smzdm.com, retrieves matching knowledge chunks, and produces a polished Chinese answer with explicit source citations."
version: 0.0.1

Knowledge Search — 知识库问答

用途

当用户在飞书群里 @知识库问答机器人 提问(或回复/引用文件)时,本 skill 负责:

  1. 调用 Viking RAG 接口检索匹配的知识切片;
  2. 将检索结果润色成用户容易看懂的中文答案;
  3. 明确标注每条依据的来源文件和在文件中的位置,并附上原文摘录。

触发场景

  • 用户在飞书群里 @Bot 并附带问题文本(如 "@知识库问答机器人 es 索引怎么配置?")
  • 用户 @Bot 并回复/引用某个文件,可能没有打字(以文件名或文件摘要作为 query 兜底)
  • 用户 @Bot 同时提问和引用文件,需要结合文件上下文进行检索

输入参数

参数 来源 必填 说明
query 用户 @Bot 的问题文本 是 若用户只回复文件没打字,用文件名/文件摘要兜底
kb_base_url 配置 否 优先用内网地址 http://127.0.0.1:8082;公网 https://geomgr-bgm.smzdm.com 可能屏蔽鉴权头
username 环境变量 是 从 SENDER_USER_NAME 读取,为空则从 MINDPAD_USER_NAME 读取
api_key 环境变量 是 从 ZFILE_INTERNAL_API_KEY 读取(禁止明文打印)
limit agent 决定 否 返回切片数,默认 5(范围 1~1000)
dense_weight agent 决定 否 混合检索稠密向量权重,默认 0.5(范围 0.2~1.0)
collection_name agent/user 否 指定知识库 collection;不传则用服务端默认知识库
resource_id agent/user 否 指定知识库 resource;不传则用服务端默认知识库

鉴权前提

内部通道鉴权由服务端 InternalImpersonationInterceptor 处理:

  • 每个请求携带 X-Internal-Api-Key 和 X-Internal-Username 两个头,服务端自动代入指定用户身份。
  • 不需要 zfile-token,不再调用 /internal/zfile/token(该接口已删除)。
  • 鉴权失败时的处理(见下方错误处理)。

核心执行流程

步骤 1:运行检索脚本

调用 scripts/knowledge_search.py:

python3 scripts/knowledge_search.py \
  --query "{用户问题或文件摘要}" \
  --kb-base-url "http://127.0.0.1:8082" \
  --limit 5 \
  --dense-weight 0.5

可选参数:--collection-name、--resource-id、--timeout(默认 15s)、--username(命令行显式传入用户名)。

环境变量要求(脚本执行前确保已设置):

  • ZFILE_INTERNAL_API_KEY:内部 API 密钥
  • SENDER_USER_NAME 或 MINDPAD_USER_NAME:用户名

脚本成功时输出结构化 JSON 到 stdout:

{
  "query": "es 索引怎么配置",
  "rewriteQuery": "Elasticsearch 索引如何配置",
  "count": 3,
  "results": [
    {
      "file": "es索引配置指南.pdf",
      "docId": "doc_123",
      "location": "第3章 安装 · 片段#12",
      "score": 0.87,
      "rerankScore": 0.91,
      "text": "ES 索引需要先创建 mapping,定义字段类型..."
    }
  ]
}

如果脚本以非零退出码退出,按 stderr 输出的错误信息处理(见错误处理表)。

步骤 2:解析脚本输出

读取 stdout 的 JSON,提取:

  • query:原始查询
  • rewriteQuery:query 改写结果(可向用户展示)
  • count:命中切片数
  • results[].file:来源文件
  • results[].location:文件位置
  • results[].score / results[].rerankScore:相关度
  • results[].text:切片原文

步骤 3:润色与引用作答

根据检索结果向用户回复。严格遵循以下规范:

3.1 润色要求

  • 先给总结:用一段「人话」直接回应用户的问题,不堆砌术语,让非技术背景用户也能理解。
  • 再列依据:每条引用标注来源,格式为 来源:《{file}》· {location},并附上对应的 text 原文(可适当截断,但不得篡改原文内容)。
  • 只依据检索结果作答:不添加检索结果中没有的知识,不编造内容。
  • 多条命中同一文件时按位置聚合:同一文件的多个切片合并展示,避免重复列出文件名。

3.2 空结果/低相关度处理

当 count == 0 或所有结果的 score / rerankScore 过低(如均 < 0.3)时,明确告知用户:

知识库中未检索到相关内容,建议尝试换个说法提问或提供更多上下文。

不要编造答案。

3.3 示例回复格式

根据知识库中的资料,配置 ES 索引的步骤如下:

1. 首先创建 mapping,定义字段类型和分词器;
2. 设置分片数和副本数;
3. ...(根据检索内容总结)

**参考依据:**

- 来源:《es索引配置指南.pdf》· 第3章 安装 · 片段#12
  > ES 索引需要先创建 mapping,定义字段类型和分析器,然后设置 number_of_shards 和 number_of_replicas...

- 来源:《es索引配置指南.pdf》· 第5章 调优 · 片段#28
  > 索引调优建议将 refresh_interval 设置为 30s 以上以减少写入压力...

错误处理

错误类型 表现 处理方式
query 为空 脚本 stderr 输出 "query 为空" 提示用户给出问题或可检索的文件信息
API Key 缺失 脚本 stderr 输出 "ZFILE_INTERNAL_API_KEY 未设置" 告知运维配置环境变量,不继续检索
用户名为空 脚本 stderr 输出 "未找到用户名" 检查 SENDER_USER_NAME / MINDPAD_USER_NAME 环境变量
鉴权 401 脚本 stderr 输出 "密钥错误" 停止检索,检查 ZFILE_INTERNAL_API_KEY 是否正确
鉴权 400 脚本 stderr 输出 "缺少 X-Internal-Username" 停止检索,确认用户名环境变量已设置
鉴权 503 脚本 stderr 输出 "内部通道未启用" 停止检索,联系管理员配置服务端内部密钥
鉴权 403 脚本 stderr 输出 "权限不足" 停止检索,告知用户当前无权访问该知识库
业务非 0 脚本 stderr 输出 "业务错误" 按 message/msg 字段提示用户
网络超时 脚本 stderr 输出 "请求超时" 提示网络异常,建议稍后重试
连接失败 脚本 stderr 输出 "连接失败" 检查 kb_base_url 是否正确、服务是否运行

安全约束

  • 绝对禁止在日志、输出、或回复中打印 ZFILE_INTERNAL_API_KEY 的明文值。
  • 引用原文时必须忠于 originText,不得改写事实。
  • 只检索用户授权访问的知识库,不越权查询。

参考文档

  • API 请求/响应格式详见 references/rag-search-api.md

Current listing version

1.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决用户在飞书群中快速获取企业知识的核心需求
  • 具有明确的触发场景和广泛的实用价值
Trigger Precision95/100

Highlights

  • 触发词精准完整,覆盖多种变体(@提及、回复文件等)
  • 边界清晰,不易误触或漏触
Structure and Standards90/100

Highlights

  • 结构完整,包含用途、触发场景、输入参数、执行流程、错误处理、安全约束
  • 步骤清晰,有示例回复格式,frontmatter 完整
Execution Reliability88/100

Highlights

  • 工具来源明确,参数说明详细
  • 覆盖主要异常(鉴权、网络、业务错误等),可靠性良好
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • 127.0.0.1
  • geomgr-bgm.smzdm.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.