Agent skill

Bailian Knowledge Base Manager

by modelstudioai in modelstudioai/cli

Manages Alibaba Cloud Bailian knowledge bases with the bl command line: create bases, upload documents, deploy search services, fix chunks and handle data center files.

Apache-2.0Auto-check passedAI & LLM Engineering

SKILL.md written in Chinese; this summary is our English description.

Install Bailian Knowledge Base Manager

skills CLI
$ npx skills add modelstudioai/cli --skill bailian-kb -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install modelstudioai/cli bailian-kb --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/modelstudioai/cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/bailian-kb-dsh/skills/bailian-kb .claude/skills/bailian-kb && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bailian-kb
GitHub stars
541
Token cost
~1.5k tokens
SKILL.md length
355 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

Manages Alibaba Cloud Bailian knowledge bases with the bl command line: create bases, upload documents, deploy search services, fix chunks and handle data center files.

  • Works in 3 steps: 安装校验:运行 bl knowledge list --help。若报… → 鉴权:需要 DASHSCOPE_API_KEY(环境变量,或 bl auth… → workspace 解析优先级:--workspace-id 参数 > 环境变量…
  • Creating or deleting a Bailian knowledge base from the command line
  • SKILL.md covers 检索服务清单的行为语义, 前置检查, 何时用哪个命令 and 核心工作流:建库到可检索, plus 4 more sections
  • Calls npm; needs DASHSCOPE_API_KEY

What it does

Bailian knowledge base management happens through the bl command from bailian-cli, and the skill is written in Chinese. Day-to-day lookups are not done here: the agent uses the native kb_search tool for evidence and kb_chat for finished answers, and bl search or chat is kept for debugging a service after deployment, for example against a beta draft version.

Commands are grouped by intent: creating, listing, renaming, deleting and monitoring knowledge bases; uploading local documents, checking parse status, tagging and deleting them; importing in bulk from OSS; creating, updating and deploying search or Q&A services; adding, editing and deleting chunks to correct or hide content; and managing data center categories, files and collections.

Setup comes first. bailian-cli is installed with npm and needs Node.js 18.17 or newer, authentication uses a DASHSCOPE_API_KEY, and the workspace ID comes from a flag, an environment variable or the CLI config. The list of deployed retrieval services is injected by a plugin and refreshed about every 30 minutes, so a service just created with bl may be missing from it. If no listed service fits the question, the agent says so instead of guessing an agent ID.

When your agent uses it

  • Creating or deleting a Bailian knowledge base from the command line
  • Uploading or importing documents from a local folder or OSS
  • Deploying or tuning a retrieval or Q&A service and then verifying it
  • Correcting wrong chunks or hiding a passage in a knowledge base

Example prompts

  • “Upload everything in ./docs to the product-faq knowledge base and show the parse status.”
  • “Import the documents from our OSS bucket into the support knowledge base.”
  • “Deploy a retrieval service for the HR policies knowledge base and test it with the beta version.”
  • “Delete the wrong chunk in the pricing knowledge base that quotes the old plan.”

Requirements

  • bl (bailian-cli), installed with npm, which needs Node.js 18.17 or newer
  • A DASHSCOPE_API_KEY
  • A Bailian workspace ID

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 安装校验:运行 bl knowledge list --help。若报 Unknown command 或 bl 未安装,执行
  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。

What it can do on your machine

Read from SKILL.md and the folder at commit 8bbbbc7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • DASHSCOPE_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bailian Knowledge Base Manager loads about 1.5k tokens when it runs. Until then it costs about 112 tokens; SKILL.md has 355 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~112
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from modelstudioai/cli at commit 8bbbbc7, republished under its Apache-2.0 licence (© modelstudioai). 355 words, ~1,508 tokens.

Download SKILL.mdSave it as .claude/skills/bailian-kb/SKILL.md (or your agent's skills folder).
name
bailian-kb
description
管理阿里云百炼知识库(建库、上传文档、部署检索服务、Chunk 运维、数据中心文件管理),命令行工具为 bl(bailian-cli)。 当用户要创建/更新/删除知识库、上传或导入文档(本地/OSS)、创建/部署/调参检索或问答服务、 增删改查 Chunk、管理数据中心类目/文件/集合时使用本 skill。 检索与问答不走本 skill——用原生工具 kb_search(取证据)/ kb_chat(成品问答); bl knowledge search / chat 仅用于部署后的验证调试(如 --agent-version beta 调试草稿版)。 kb_search / kb_chat 的凭据与工作空间由插件自动解析(~/.dsh/settings.yaml 的 bailian-kb 段、 ~/.dsh/.credentials.yaml 的 DASHSCOPE_API_KEY),不要自己去读或传。 普通问答、编程、写作、翻译、泛搜索不触发本 skill。

百炼知识库管理(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/statsbl knowledge create --help
上传本地文档、看解析状态、删文档、打标签bl knowledge doc upload/list/status/delete/tagbl knowledge doc upload --help
从 OSS 批量导入bl knowledge doc import-ossBucket 需预先授权服务角色
创建 / 部署 / 调参检索(问答)服务bl knowledge service create/update/deploy/…bl knowledge service --help
修正错误切片、屏蔽某段内容bl knowledge chunk add/list/update/deletebl knowledge chunk --help
数据中心类目 / 文件 / 集合管理bl knowledge category/file/collection …bl knowledge category --help
CLI 配置、升级bl config show/set、bl updatebl config --help
部署后验证、调试草稿版服务bl knowledge search/chat --agent-version betabl knowledge search --help

核心工作流:建库到可检索

bash
bl knowledge doc upload --file ./docs/ --workspace-id ws-xxx                # 1. 上传本地文件/目录 → 得 fileId
bl knowledge create --name my-kb --description '产品文档' --doc-id <fileId> --wait                # 2. 建库并导入 → 得 index-id (pipelineId)
bl knowledge service create --name my-search --scene search --index-id <index-id>   # 3. 建检索服务 → 得 agent-id(draft)
bl knowledge service deploy --agent-id <agent-id> --yes                     # 4. 发布服务(此后可被默认版本调用)
bl knowledge service list --scene search --status deployed                  # 5. 确认服务可见

部署完成后用原生工具 kb_search 带该 agent_id 验证检索;若要在部署前调试草稿配置,用 bl knowledge search --agent-id <id> --agent-version beta。

已有文件再入库的简写:bl knowledge doc upload --file ./a.md --index-id <index-id> --wait(上传+导入一步完成)。

Show full SKILL.md (154 more words)Show less

ID 速查(极易混淆)

ID来源用在哪
index-idknowledge create 返回的 pipelineId / knowledge list所有 knowledge/doc/chunk 命令的 --index-id
fileIddoc upload / doc import-oss 返回数据中心命令(file get/delete、knowledge create --doc-id、doc tag)
doc_id(库内文档 ID)doc list 输出doc delete、chunk add/update 的 --doc-id;可能带 workspace 后缀,≠ fileId
job-id导入命令返回的 ingestionIddoc status(必须同时给 --index-id 和 --job-id)
chunk idchunk list 输出的 metadata._idchunk update/delete 的 --chunk-id
agent-idservice create/listservice *、kb_search/kb_chat、bl knowledge search/chat

命令参考

执行不熟悉的命令前,跑 bl <命令> --help 查看完整 Usage / Flags / Notes / Examples。不要猜 flag。 全部命令支持 --output json(结构化输出)、--dry-run(预览请求)、--quiet、--verbose。

危险与不可逆操作

执行以下操作前须向用户确认,脚本化时才用 --yes 跳过交互确认:

  • knowledge delete:不可逆,库和全部索引内容永久删除(数据中心源文件保留)。
  • file delete:不可逆,且引用该文件的知识库文档索引会失效;只想从单个库移除用 doc delete。
  • chunk delete:不可逆。
  • service deploy:发布影响线上调用方;service delete 后 agent_id 不可再用(软删、幂等)。
  • collection create:没有删除 API,创建集合要慎重。
  • 索引配置(embedding 模型、chunk size 等)建库后不可改,只能重建。

最佳实践

  • 建服务时必须把名字写清楚:service create --name 的名称是模型判断"这个服务能查什么"的主要依据(服务描述暂未随列表接口返回)。检索服务1 这类无语义的名字会让后续检索无法路由;写成 产品文档检索、HR制度问答 这种能看出覆盖内容的名字。同时填 --description(≤1000 字符),列表接口返回该字段后即可自动生效。
  • 服务有 draft/deployed 两种状态:只有 deployed 可被默认版本调用,也只有 deployed 会进入模型看到的服务清单;draft 调试用 --agent-version beta。改已发布版本的配置:先改 beta 草稿(service update),验证后 service deploy 发新版本。
  • 导入类命令(knowledge create、doc upload --index-id、doc status)优先带 --wait 轮询到终态,避免手工轮询;文档解析失败(如 PARSE_FAILED)会以非零退出码透传错误。
  • chunk add 有 10 QPS 限流,批量脚本注意节流;响应不带 chunk id,需要 chunk list 反查。
  • service list 必须带 --scene chat|search,两个场景要分别查询。

© modelstudioai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/bailian-kb-dsh/skills/bailian-kb of modelstudioai/cli.

Open the folder on GitHubat commit 8bbbbc7

Compare with similar skills

Bailian Knowledge Base Manager next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bailian Knowledge Base Manager compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bailian Knowledge Base Manager this skillmodelstudioai/cli541—~1.5kAutomated safety check: PassApache-2.0
Aliyun Bailian AI Experttheneoai/awesome-skills183—~3.8kAutomated safety check: PassMIT
Cortexdb Memory Openclawliliang-cn/cortexdb273—~1.6kAutomated safety check: PassMIT
TeamAI Team SyncTencent/teamai-cli5.1k—~632Automated safety check: PassCustom licence
AWS Cloudformation Bedrockgiuseppe-trisciuoglio/developer-kit355—~3.2kAutomated safety check: NotesMIT
Knowledge Queryevolution-foundation/evo-nexus544—~804Automated safety check: NotesCustom licence

Similar skills

  • Aliyun Bailian AI Expert

    theneoai/awesome-skills

    阿里云百炼Model Studio:可视化RAG搭建、企业知识库问答、AI应用开发。Use when building RAG applications, enterprise knowledge bases, or AI chatbots.

    183 GitHub stars~3.8k tokensUpdated 4 mo ago
    AI & LLM EngineeringAuto-check passed
  • Cortexdb Memory Openclaw

    liliang-cn/cortexdb

    Give a Node.js agent (such as OpenClaw) durable, local-first memory plus a queryable SPARQL knowledge graph, backed by CortexDB through its gRPC sidecar and the cortexdb-client npm package.

    273 GitHub stars~1.6k tokensUpdated today
    Knowledge ManagementAuto-check passed
  • TeamAI Team Sync

    Tencent/teamai-cli

    Make every team AI native — TeamAI syncs a team's AI skills, rules, docs and env across AI coding tools. Use when the task operates on team-shared AI…

    5.1k GitHub stars~632 tokensUpdated yesterday
    Knowledge ManagementAuto-check passed
  • AWS Cloudformation Bedrock

    giuseppe-trisciuoglio/developer-kit

    Provides AWS CloudFormation patterns for Amazon Bedrock resources including agents, knowledge bases, data sources, guardrails, prompts, flows, and inference profiles.

    355 GitHub stars~3.2k tokensUpdated 27 days ago
    AI & LLM EngineeringAuto-check: notes
  • Knowledge Query

    evolution-foundation/evo-nexus

    Hybrid search (vector + BM25 via RRF + metadata boost) against the pgvector Knowledge base, with optional RAG synthesis.

    544 GitHub stars~804 tokensUpdated 4 mo ago
    AI & LLM EngineeringAuto-check: notes
  • Tavily Search API Integration

    andrewyng/context-hub

    Guides building Tavily integrations for web search, URL extraction, site crawling and AI-assisted research in Python or JavaScript agent and RAG projects.

    14k GitHub stars~1.1k tokensUpdated 4 mo ago
    AI & LLM EngineeringAuto-check passed

More from modelstudioai/cli

All 8 skills in this repo
  • Bailian Media Generation

    modelstudioai/cli

    Chinese-language entry point into Alibaba Cloud Bailian's image, video and speech generation and understanding, routed through separate image, video, speech and vision commands.

    541 GitHub stars~2k tokensUpdated 7 days ago
    Auto-check passed
  • Bailian Shared Protocol

    modelstudioai/cli

    Shared execution protocol for the Alibaba Cloud Bailian bl skill family, covering consent, version checks, authentication and install, issue reporting and output conventions.

    541 GitHub stars~2.9k tokensUpdated 7 days ago
    Auto-check passed
  • Aliyun Model Studio CLI

    modelstudioai/cli

    Hub for the bl CLI of Alibaba Cloud Model Studio (Bailian): app calls, knowledge bases, model catalog, usage and quota, workspaces, MCP market, auth and skill installs.

    541 GitHub stars~4.2k tokensUpdated 7 days ago
    Auto-check passed
  • Drives fine-tuning on Alibaba Cloud Model Studio with the bl CLI: validate and upload data, create a job, watch it, export results and deploy the model.

    541 GitHub stars~1.8k tokensUpdated 7 days ago
    Auto-check passed
  • Bailian Managed Agent CLI

    modelstudioai/cli

    Manages Alibaba Cloud Bailian managed agents as infrastructure as code with the bl managed-agent command, previewing every change before apply or destroy.

    541 GitHub stars~3.5k tokensUpdated 7 days ago
    Auto-check: notes
  • Decides whether a web search in Alibaba Cloud Bailian (Model Studio) workflows uses the model's built-in search or the Bailian MCP, based on the connection type.

    541 GitHub stars~1.8k tokensUpdated 7 days ago
    Auto-check passed

Questions about Bailian Knowledge Base Manager

What does Bailian Knowledge Base Manager do?

Manages Alibaba Cloud Bailian knowledge bases with the bl command line: create bases, upload documents, deploy search services, fix chunks and handle data center files. Bailian knowledge base management happens through the bl command from bailian-cli, and the skill is written in Chinese. Day-to-day lookups are not done here: the agent uses the native kb_search tool for evidence and kb_chat for finished answers, and bl search or chat is kept for debugging a service after deployment, for example against a beta draft version.

When should I use Bailian Knowledge Base Manager?

Bailian Knowledge Base Manager fits situations like: creating or deleting a Bailian knowledge base from the command line; uploading or importing documents from a local folder or OSS; deploying or tuning a retrieval or Q&A service and then verifying it; correcting wrong chunks or hiding a passage in a knowledge base.

How do I install Bailian Knowledge Base Manager in Claude Code?

Run `npx skills add modelstudioai/cli --skill bailian-kb -a claude-code`. Or copy the skill folder (packages/bailian-kb-dsh/skills/bailian-kb in modelstudioai/cli) into .claude/skills/bailian-kb in your project. Claude Code loads it when a task matches its description.

How do I install Bailian Knowledge Base Manager in Codex?

Run `npx skills add modelstudioai/cli --skill bailian-kb -a codex`. Or copy the skill folder (packages/bailian-kb-dsh/skills/bailian-kb in modelstudioai/cli) into .agents/skills/bailian-kb in your project. Codex loads it when a task matches its description.

Can I use Bailian Knowledge Base Manager in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add modelstudioai/cli --skill bailian-kb -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bailian-kb, .gemini/skills/bailian-kb, .github/skills/bailian-kb and .opencode/skills/bailian-kb in your project.

What does Bailian Knowledge Base Manager need to run?

Going by SKILL.md and its folder, Bailian Knowledge Base Manager needs the command-line tools its instructions call (npm) and credentials named DASHSCOPE_API_KEY. Our summary lists: bl (bailian-cli), installed with npm, which needs Node.js 18.17 or newer; A DASHSCOPE_API_KEY; A Bailian workspace ID.

Does Bailian Knowledge Base Manager access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Bailian Knowledge Base Manager safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bailian Knowledge Base Manager use?

Bailian Knowledge Base Manager is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bailian Knowledge Base Manager use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bailian Knowledge Base Manager?

Skills that share tags, products or a category with Bailian Knowledge Base Manager: Aliyun Bailian AI Expert (theneoai/awesome-skills, 183 stars), Cortexdb Memory Openclaw (liliang-cn/cortexdb, 273 stars), TeamAI Team Sync (Tencent/teamai-cli, 5.1k stars) and AWS Cloudformation Bedrock (giuseppe-trisciuoglio/developer-kit, 355 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bailian Knowledge Base Manager?

modelstudioai (a GitHub organization) maintains it in modelstudioai/cli, which has 541 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 30, 2026.

Source: modelstudioai/cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.