# alibabacloud-bailian-rag-knowledgebase

This skill lets an agent list Alibaba Cloud Bailian knowledge bases and pull document chunks from one over the HTTPS API.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 442 installs · ★ 275
- Author: aliyun
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/aliyun/alibabacloud-aiops-skills/tree/HEAD/skills/aiml/sfm/alibabacloud-bailian-rag-knowledgebase/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/alibabacloud-bailian-rag-knowledgebase

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/alibabacloud-bailian-rag-knowledgebase/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install aliyun/alibabacloud-aiops-skills alibabacloud-bailian-rag-knowledgebase
```

2. **Manually: put the files in place**
- File: `.github/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/aliyun/alibabacloud-aiops-skills --path skills/aiml/sfm/alibabacloud-bailian-rag-knowledgebase
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/alibabacloud-bailian-rag-knowledgebase/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-bailian-rag-knowledgebase -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/aliyun/alibabacloud-aiops-skills/tree/HEAD/skills/aiml/sfm/alibabacloud-bailian-rag-knowledgebase/SKILL.md

## When to use it
- 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
- list my Bailian knowledge bases
- retrieve chunks from base qf91w6402d about refunds
- search the knowledge base for API rate limit docs

## Similar
- [bailian-cli](https://affpapa.org/en/nevibecode/skills/bailian-cli.md) — skill · 18800 installs
- [bailian-protocol](https://affpapa.org/en/nevibecode/skills/bailian-protocol.md) — skill · 9200 installs
- [langchain-rag](https://affpapa.org/en/nevibecode/skills/langchain-rag.md) — skill · 17500 installs
- [rag](https://affpapa.org/en/nevibecode/skills/rag.md) — skill · 3700 installs
- [rag-blueprint](https://affpapa.org/en/nevibecode/skills/rag-blueprint.md) — skill · 3300 installs
- [rag-retrieval](https://affpapa.org/en/nevibecode/skills/rag-retrieval.md) — skill · 1500 installs

From the same set: [aliyun/alibabacloud-aiops-skills](https://affpapa.org/en/nevibecode/by/aliyun/alibabacloud-aiops-skills.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
