alibabacloud-bailian-rag-knowledgebase — Claude Code skill: query
This skill lets an agent list Alibaba Cloud Bailian knowledge bases and pull document chunks from one over the HTTPS API.
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a claude-codeWhat alibabacloud-bailian-rag-knowledgebase does
The skill talks to Bailian over the HTTPS API. scripts/list_indices.py returns the available knowledge bases with their IDs and descriptions, then scripts/retrieve.py pulls chunks from a chosen base for a given query. The agent picks the base that fits the task.
Keys come from scripts/api_key.py, which checks the current profile in ~/.aliyun/config.json first and the DASHSCOPE_API_KEY environment variable second. With the Alibaba Cloud CLI configured, the script can create a key for you. Keys in the sk-sp-xxx format are rejected because they are Coding Plan keys and do not cover knowledge base services. Anything starting with sk- must stay out of scripts, logs and terminal output, and the skill asks for a grep -rn "sk-" <output_directory>/ sweep over output files before the task is done.
Two things have to be in place beforehand: the knowledge base service activated in the Bailian console, and the ModelStudio plugin for the Alibaba Cloud CLI. Every aliyun call and HTTPS request carries a User-Agent of AlibabaCloud-Agent-Skills/alibabacloud-bailian-rag-knowledgebase/{session-id}, with the session ID generated once per session.
What it helps with
- list Bailian knowledge bases with their IDs
- pull document chunks from one base for a query
- answer a question from knowledge base content
- page through the base list when the first page is short
- check output files for leaked
sk-keys
Example prompts for the agent
- list my Bailian knowledge bases
- retrieve chunks from base qf91w6402d about refunds
- search the knowledge base for API rate limit docs
How to install alibabacloud-bailian-rag-knowledgebase
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a claude-code2Manually: put the files in place
~/.claude/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/alibabacloud-bailian-rag-knowledgebase/
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a codex2Manually: put the files in place
.agents/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a cursor2Manually: put the files in place
.cursor/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aliyun/alibabacloud-aiops-skills alibabacloud-bailian-rag-knowledgebase2Manually: put the files in place
.github/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.md1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a gemini-cli2Platform CLI
gemini skills install https://github.com/aliyun/alibabacloud-aiops-skills --path skills/aiml/sfm/alibabacloud-bailian-rag-knowledgebaseManually: put the files in place
.devin/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about alibabacloud-bailian-rag-knowledgebase
How do I install Anthropic-bailian-rag-knowledgebase in Claude?
Run npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a claude-code. The skill then sits at ~/.claude/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.md.
What does alibabacloud-bailian-rag-knowledgebase do?
It gives an agent two steps for Bailian knowledge bases: list them, then retrieve chunks from the one you pick. Both go through the HTTPS API.
What do I need before the first run?
A Anthropic API key and the knowledge base service activated in the Bailian console. Auto-creating a key also needs the Alibaba Cloud CLI with the ModelStudio plugin.