bailian-kb

bailian-kb is a skill for Claude Code, Codex from modelstudioai/cli. It costs 234 tokens per session (2,191 once invoked), scanned A, original, Apache-2.0.

A command-line manager for Alibaba Cloud Bailian knowledge bases, which are collections of documents prepared for search and question answering. It handles the stored documents, search services, text chunks, and data-centre files rather than everyday searches.

In plain words
What is it for?
Use it to create, update, inspect, or delete knowledge bases; upload documents from local storage or OSS; deploy search or question-answering services; manage text chunks; and organise data-centre files.
Why use it?
It separates the work of building and maintaining a knowledge base from using it to answer questions. This helps keep document uploads, parsing, service deployment, and chunk changes organised.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bl knowledge doc upload --file ./docs/ --workspace-id ws-xxx # 1. 上传本地文件/目录 → 得 fileId.

Good fit Use it to create, update, inspect, or delete knowledge bases; upload documents from local storage or OSS; deploy search or question-answering services; manage text chunks; and organise data-centre files.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/modelstudioai/cli
agentmods
npx agentmods add skills/modelstudioai/cli/bailian-kb

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bailian-kb

README.md
[![agentmods](https://agentmods.dev/badge/skills/modelstudioai/cli/bailian-kb/github.svg)](https://agentmods.dev/skills/modelstudioai/cli/bailian-kb)
Your own site
<a href="https://agentmods.dev/skills/modelstudioai/cli/bailian-kb"><img src="https://agentmods.dev/badge/skills/modelstudioai/cli/bailian-kb/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bailian-kb

Your own site · 80×15
<a href="https://agentmods.dev/skills/modelstudioai/cli/bailian-kb"><img src="https://agentmods.dev/badge/skills/modelstudioai/cli/bailian-kb.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 234 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,191 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 10
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00234 $0.02191
Opus 5.5 $0.00094 $0.00876
Sonnet 5.5 $0.00047 $0.00438
Haiku 4.5 $0.00023 $0.00219

Measured 1mo ago against content hash acb12b7763a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bailian-kb scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/bailian-kb-dsh/skills/bailian-kb/SKILL.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

百炼知识库管理(bl)

检索面与管理面的分工:查知识用 kb_search(取证据)/ kb_chat(成品问答)原生工具;本 skill 只覆盖管理长尾——知识库全生命周期、文档、检索服务、Chunk、数据中心。

本 skill 不负责判断何时该检索。可用检索服务的清单(含 agent_id)由插件自动注入到会话上下文里,kb_search / kb_chat 直接取用;不需要为了检索先加载本 skill。

检索服务清单的行为语义

  • 清单由插件从百炼 API 拉取后缓存,按会话周期性刷新(约 30 分钟),只含 deployed 状态的服务;
  • 刚用 bl 新建或部署的服务不会立刻出现在清单里。不用等刷新——命令输出里刚拿到的 agent_id 直接可用;
  • 服务很多时清单只列最近修改的若干条并标明总数。要找特定服务用 bl knowledge service list --scene search --name <关键词>;
  • 清单里确实没有能回答用户问题的服务时,如实告知用户,不要挑一个最像的 agent_id 去试。

前置检查

  1. 安装校验:运行 bl knowledge list --help。若报 Unknown command 或 bl 未安装,执行 npm install -g bailian-cli(需 Node.js ≥ 18.17);已安装但命令缺失时先 bl update 升级。 安装失败时把错误原样报告给用户,不要静默跳过。
  2. 鉴权:需要 DASHSCOPE_API_KEY(环境变量,或 bl auth login --api-key sk-xxx,或 bl config set --key api_key --value sk-xxx)。
  3. workspace 解析优先级:--workspace-id 参数 > 环境变量 BAILIAN_WORKSPACE_ID > bl config set --key workspace_id --value ws-xxx。

何时用哪个命令

用户意图 命令 备注
查知识 / 问答(日常检索) 原生工具 kb_search / kb_chat 不走 bl
建库 / 查看 / 改名 / 删库 / 监控 bl knowledge create/list/info/update/delete/stats bl knowledge create --help
上传本地文档、看解析状态、删文档、打标签 bl knowledge doc upload/list/status/delete/tag bl knowledge doc upload --help
从 OSS 批量导入 bl knowledge doc import-oss Bucket 需预先授权服务角色
创建 / 部署 / 调参检索(问答)服务 bl knowledge service create/update/deploy/… bl knowledge service --help
修正错误切片、屏蔽某段内容 bl knowledge chunk add/list/update/delete bl knowledge chunk --help
数据中心类目 / 文件 / 集合管理 bl knowledge category/file/collection … bl knowledge category --help
CLI 配置、升级 bl config show/set、bl update bl config --help
部署后验证、调试草稿版服务 bl knowledge search/chat --agent-version beta bl knowledge search --help

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 97 lines · 234 tokens per session scan A acb12b7763a3

Subscribe to this mod's changes

bailian-kb is a skill published in the GitHub repository modelstudioai/cli (476 stars, last pushed yesterday), licensed Apache-2.0. It adds 234 tokens to every session and 2,191 once invoked, about $0.0009 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kb-retriever

A retrieval and question-answering assistant for a local folder of documents, including Markdown, text, PDFs, and spreadsheets.

ConardLi/garden-skills · 105 tokens

rag-assistant

A local knowledge-base assistant for answering questions from indexed private documents. It searches the stored documents, checks whether the results are relevant, and cites the source files in its answers.

MerkyorLynn/Lynn · 41 tokens

vibeknow-doc

Upload documents to vectoria and check processing status. Use when: user wants to upload a document, check if a document is ready, or get a docid for use with vibeknow create.

vibeknow/cli · 46 tokens

dead-letter

Convert .eml email files (Gmail, Outlook, Apple Mail, Thunderbird exports, email archives) to Markdown with YAML front matter for reading, summarizing, RAG, or building a local email archive. Use when a task involves a .eml file or folder, exported email, or turning email into Markdown. Runs locally via uvx or the…

BigCactusLabs/dead-letter · 88 tokens

document-ai

Comprehensive patterns for AI-powered document understanding including PDF parsing, OCR, invoice/receipt extraction, table extraction, multimodal RAG with vision models, and structured data output. Use when "document parsing, PDF extraction, OCR, invoice processing, receipt extraction, document understanding…

omer-metin/skills-for-antigravity · 79 tokens

advogado-criminal

Advogado criminalista especializado em Maria da Penha, violencia domestica, feminicidio, direito penal brasileiro, medidas protetivas, inquerito policial e acao penal.

ranbot-ai/awesome-skills · 42 tokens