bailian-knowledge — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited bailian-knowledge (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
阿里云百炼知识库检索工具。编译好的二进制,零依赖运行,返回结构化 JSON。
config.json 包含阿里云 AK/SK 密钥。
config.json 已配置(skill 目录下):
{
"alibaba_cloud_access_key_id": "your_key",
"alibaba_cloud_access_key_secret": "your_secret",
"workspace_id": "your_workspace",
"knowledge_index_id": "your_index",
"endpoint": "bailian.cn-beijing.aliyuncs.com"
}根据操作系统选择二进制:
| OS | Binary |
|---|---|
| macOS | bailian-query-mac |
| Linux amd64 | bailian-query-linux |
| Windows amd64 | bailian-query-win64.exe |
SKILL_DIR=$(dirname "$0")
# macOS
$SKILL_DIR/bin/bailian-query-mac -config $SKILL_DIR/config.json "初诊患者怎么随访"
# Linux
$SKILL_DIR/bin/bailian-query-linux -config $SKILL_DIR/config.json "初诊患者怎么随访"| 参数 | 说明 | 必填 |
|---|---|---|
-config | config.json 路径 | 是(默认 config.json) |
<query> | 检索查询语句 | 是 |
[workspace_id] | 覆盖配置中的 workspace_id | 否 |
[index_id] | 覆盖配置中的 knowledge_index_id | 否 |
# 基本查询
bailian-query-mac -config config.json "初诊患者怎么随访"
# 覆盖 workspace 和 index
bailian-query-mac -config config.json "吸入过敏原" custom_workspace custom_index返回 JSON,核心字段:
{
"Code": "Success", // 状态码: Success / 错误码
"Data": {
"Nodes": [ // 匹配文档片段列表,按相关性降序
{
"Score": 0.854, // 相关性评分 (0-1),>0.7 为高相关
"Text": "...", // 匹配的文档内容片段
"Metadata": {
"doc_name": "...", // 来源文档名
"title": "...", // 文档层级标题
"hier_title": "...", // 层级路径 (如 "哮喘照护 > 初诊 > 随访")
"page_number": [1], // 来源页码
"doc_url": "..." // 文档下载链接 (带过期时间)
}
}
]
},
"RequestId": "...",
"Success": true
}核心原则:只返回高置信度结果,低置信度结果一律丢弃,绝不编造或推测。
| Score 范围 | 处理方式 |
|---|---|
| ≥ 0.7 | 高置信度 — 正常返回给用户,可放心引用 |
| 0.4 ~ 0.7 | 中置信度 — 仅作为辅助参考,需明确标注"相关性中等,仅供参考" |
| < 0.4 | 低置信度 — 必须丢弃,不返回给用户 |
执行流程:
Nodes 列表Nodes 为空或所有 Node 的 Score < 0.4 → 直接告诉用户:"知识库中未找到相关内容",不要猜测或编造向用户呈现检索结果时,必须在回答末尾标注信息来源:
---
**信息来源:**
- 《文档名1》
- 《文档名2》 (仅供参考)Metadata.doc_name 提取文档名page_number),附上页码,如:《文档名》第2页**信息来源:** 知识库中无匹配文档| Exit Code | Meaning | Fix |
|---|---|---|
| 1 | Missing query argument | Provide query string as first positional arg |
| 1 | Config file read error | Check -config path and file permissions |
| 1 | Config parse error | Validate JSON format in config.json |
| 1 | Client creation failed | Check AK/SK correctness |
| 1 | Retrieve API failed | Check workspace_id / knowledge_index_id validity |
如需重新编译:
cd scripts
go mod tidy
# macOS
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o ../bin/bailian-query-mac .
# Linux amd64 (交叉编译)
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o ../bin/bailian-query-linux .
# Windows amd64 (交叉编译)
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o ../bin/bailian-query-win64.exe .~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.