volcengine-knowledge-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesevolcengine-knowledge-search 火山引擎文档检索
volcengine-knowledge-search Volcengine Documentation Retrieval
通过 检索官方文档,通过 获取正文。请求、响应解析、正文清洗和分页由 CLI 处理;本 skill 负责场景判断、query 改写、二次检索和来源引用。
ve docs searchve docs fetchSearch official documentation with and retrieve body text with . The CLI handles requests, response parsing, body-text cleaning, and pagination; this skill handles scenario selection, query rewriting, secondary searches, and source citations.
ve docs searchve docs fetchCLI 调用约定
CLI Invocation Conventions
执行 前,遵循 的 调用方标识规则。每次调用都必须在进程环境中携带:
vevolcengine-cli- 。
VE_CALLER_TYPE=ai_agent - :由 Agent 根据当前实际宿主环境确定,不使用固定默认值。
VE_CALLER_NAME - :取当前执行操作的 skill 的 frontmatter
VE_SKILL_NAME。本 skill 执行文档检索或正文读取时,该值为name;引用 CLI 的调用规则不改变操作所属 skill。volcengine-knowledge-search
该要求覆盖 检查、首次检索、改写后的检索、正文读取、分页续读及重试。每次工具调用可能启动新的 shell,必须重新传入三项变量,不依赖上一次的 。下面示例中的 与 均由 Agent 根据当前环境和 skill 元数据替换,不得原样传入。这些变量仅用于调用来源标识,不改变公开文档命令无需登录的约定。
--helpexport<agent-id><current-volcengine-skill>Before running , follow the caller identification rules in (Caller Identification Rules). Every invocation must carry the following in the process environment:
vevolcengine-cli- .
VE_CALLER_TYPE=ai_agent - : Determined by the Agent based on the actual current host environment; do not use a fixed default.
VE_CALLER_NAME - : Use the
VE_SKILL_NAMEfrom the frontmatter of the skill currently performing the operation. When this skill performs documentation retrieval or body-text reading, the value isname; referencing the CLI invocation rules does not change the skill to which the operation belongs.volcengine-knowledge-search
This requirement applies to checks, the initial search, rewritten searches, body-text retrieval, paginated continuation, and retries. Each tool invocation may start a new shell, so all three variables must be passed again rather than relying on a previous . In the following examples, the Agent must replace and based on the current environment and skill metadata; they must not be passed literally. These variables are used only to identify the invocation source and do not alter the convention that public documentation commands require no login.
--helpexport<agent-id><current-volcengine-skill>准备
Preparation
首次使用时确认本机具备两个子命令:
bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search --help
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch --help若 未安装或缺少子命令,加载 skill,按其「Install or upgrade the ve CLI」章节安装最新版,再检查能力。文档命令访问公开服务,无需登录、AK/SK、profile 或地域配置;安装后直接使用,无需执行资源管理的身份初始化流程。
vevolcengine-cliOn first use, confirm that the local machine has both subcommands:
bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search --help
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch --helpIf is not installed or the subcommands are unavailable, load the skill, install the latest version according to its “Install or upgrade the ve CLI” section, and then check the capabilities again. Documentation commands access public services and require no login, AK/SK, profile, or region configuration; use them directly after installation without running the resource-management identity initialization process.
vevolcengine-cli选择流程
Decision Flow
- 用户提供具体文章链接:直接 ,读取与问题相关的正文。
fetch - 用户提出问题:补全产品名和具体方向后 ,首次检索不带产品过滤。根据标题、摘要和产品编码判断相关性。
search - 结果过宽或不相关:改写 query;只有结果中已确认目标产品的 时,才使用该编码二次检索。不要把无关命中的编码用作过滤条件。
ServiceCodes - 需要完整步骤、限制条件、精确计费规则或全文总结:对相关结果的 URL 执行 ,按需续读;用户要求全文时,读到没有续读提示或
fetch。has_more=false
- The user provides a specific article link: Directly it and read the body text relevant to the question.
fetch - The user asks a question: Complete the product name and specific area of interest, then . Do not apply a product filter to the initial search. Determine relevance from the title, snippet, and product code.
search - The results are too broad or irrelevant: Rewrite the query. Use a value for a secondary search only after the target product has been confirmed in the results. Never use a code from an irrelevant match as a filter.
ServiceCodes - Complete steps, constraints, exact billing rules, or a full-text summary are required: Run on the URLs of relevant results and continue reading as needed. When the user requests the full text, keep reading until there is no continuation prompt or
fetch.has_more=false
search:检索文档
search: Search Documentation
bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "对象存储 TOS 如何计费" --limit 3 --output text搜索文本是位置参数,用引号包住完整问题。用 获取可直接阅读的 Markdown:每条包含标题、纯净 URL、 和正文摘要。CLI 默认输出 JSON;需要程序化处理时显式用 ,结果在 数组中,字段为 、、、。
--output textServiceCodes--output jsondocumentstitleurlservice_codessnippet| 参数 | 用途 |
|---|---|
| 返回文档数,正整数;一般先取 3 条 |
| 限定产品,编码取自已确认相关的结果;多个产品重复传此选项 |
| 每条摘要的最大 Unicode 字符数,正整数;用它控制上下文体积 |
bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "对象存储 TOS 如何计费" --limit 3 --output textThe search text is a positional argument; enclose the complete question in quotation marks. Use to obtain directly readable Markdown: each result includes the title, clean URL, , and body-text snippet. The CLI outputs JSON by default; explicitly use when programmatic processing is required. Results are placed in the array, with the fields , , , and .
--output textServiceCodes--output jsondocumentstitleurlservice_codessnippet| Parameter | Purpose |
|---|---|
| Number of documents to return; must be a positive integer. Generally, start with 3. |
| Restricts results to a product. Use a code confirmed from relevant results; repeat this option for multiple products. |
| Maximum number of Unicode characters in each snippet; must be a positive integer. Use it to control context size. |
改写 query
Query Rewriting
语义检索需要贴近文档表述。将口语、简称或营销名补成产品全称 + 能力描述 + 具体问题,例如把「Coding Plan 多少钱」改写为「火山方舟 Coding Plan AI 编程订阅套餐如何计费」。首搜跑偏时,换全称、近义描述或功能描述再搜。
bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "火山方舟 Coding Plan AI 编程订阅套餐如何计费" --limit 3 --output text先宽搜,确认相关结果的 为 后,按产品精搜:
ServiceCodestosbash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "跨区域复制如何配置" --limit 5 --snippet-length 300 --output text
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "对象存储 TOS 跨区域复制如何配置" --limit 3 --service-code tos --output text多个产品编码使用 ,每个编码单独传递。
--service-code <code-a> --service-code <code-b>Semantic retrieval should closely match the documentation's wording. Expand colloquial terms, abbreviations, or marketing names into a full product name + capability description + specific question. For example, rewrite “How much does Coding Plan cost?” as “How is the Volcengine Ark Coding Plan AI programming subscription package priced?” If the initial search misses the target, try the full name, a synonymous description, or a functional description.
bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "火山方舟 Coding Plan AI 编程订阅套餐如何计费" --limit 3 --output textFirst run a broad search. After confirming that the value of a relevant result is , run a product-specific search:
ServiceCodestosbash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "跨区域复制如何配置" --limit 5 --snippet-length 300 --output text
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs search "对象存储 TOS 跨区域复制如何配置" --limit 3 --service-code tos --output textFor multiple product codes, use , passing each code separately.
--service-code <code-a> --service-code <code-b>fetch:获取正文
fetch: Retrieve Body Text
支持 和 。CLI 会去掉 URL 的 query 和 fragment,text 输出依次为标题、纯净 URL、当前页正文及续读提示。
https://www.volcengine.com/docs/...https://docs.volcengine.com/docs/...bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch "https://www.volcengine.com/docs/6349/162514?lang=zh" --output text| 参数 | 用途 |
|---|---|
| 从第 N 个 Unicode 字符开始,索引从 0 起 |
| 当前页最多返回的 Unicode 字符数,正整数;默认 5000 |
长文末尾会提示下一页的 。用同一个 URL 和返回的索引继续读,避免漏读或重复。以下示例先取 300 字,若续读提示为 ,再读取下一页:
--start-index--start-index 300bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch "https://www.volcengine.com/docs/6349/162514" --max-length 300 --output text
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch "https://www.volcengine.com/docs/6349/162514" --start-index 300 --max-length 300 --output text程序化分页使用 ,读取 、、、、 和 。 时用 续读;结束时该字段为 。
--output jsoncontentstart_indexnext_start_indexremaining_charactershas_morehas_contenthas_more=truenext_start_indexnullBoth and are supported. The CLI removes the query string and fragment from the URL. In text output mode, the title, clean URL, current page body text, and continuation prompt are returned in that order.
https://www.volcengine.com/docs/...https://docs.volcengine.com/docs/...bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch "https://www.volcengine.com/docs/6349/162514?lang=zh" --output text| Parameter | Purpose |
|---|---|
| Starts at the Nth Unicode character; the index begins at 0. |
| Maximum number of Unicode characters returned for the current page; must be a positive integer. The default is 5000. |
At the end of a long document, the CLI indicates the next page's . Continue reading with the same URL and returned index to avoid omissions or duplicates. The following example first retrieves 300 characters. If the continuation prompt says , retrieve the next page:
--start-index--start-index 300bash
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch "https://www.volcengine.com/docs/6349/162514" --max-length 300 --output text
VE_CALLER_TYPE=ai_agent VE_CALLER_NAME="<agent-id>" VE_SKILL_NAME="<current-volcengine-skill>" \
ve docs fetch "https://www.volcengine.com/docs/6349/162514" --start-index 300 --max-length 300 --output textFor programmatic pagination, use and read , , , , , and . When , continue reading with . At the end, this field is .
--output jsoncontentstart_indexnext_start_indexremaining_charactershas_morehas_contenthas_more=truenext_start_indexnull导航页与空正文
Navigation Pages and Empty Body Text
- 是具体文章路径。
/docs/{产品编号}/{文档ID} - 是产品文档导航页,没有单篇文章正文。识别到这种链接时,按产品名和用户关心的方向
/docs/{产品编号},从结果定位具体文章再search,并向用户说明链接类型。fetch - 表示没有取得正文,不能据此编造内容。检查链接是否为导航页、过期或错误地址,再用
has_content=false定位替代文档。search
- is a specific article path.
/docs/{product-id}/{document-id} - is a product documentation navigation page and has no body text for a single article. When this type of link is detected, use
/docs/{product-id}with the product name and the user's area of interest, locate a specific article in the results, thensearchit. Explain the link type to the user.fetch - means that no body text was retrieved; do not fabricate content based on it. Check whether the link is a navigation page, an expired address, or an incorrect URL, and then use
has_content=falseto locate an alternative document.search
结果与错误处理
Results and Error Handling
- 按证据回答:摘要足以支撑的概念问题可以直接回答;精确规则和完整步骤先取正文。部分页面不能表述为已读完整篇。
- 引用来源:使用 CLI 返回的纯净 URL,格式为 。优先展示最多 3 条最相关来源,每个结论都能对应到已读取的内容。
[文档标题](URL) - 控制输出:search 用 和
--limit,fetch 用--snippet-length和--max-length。CLI 不提供旧脚本的临时文件预览机制,续读依赖分页参数。--start-index - 正常空结果:退出码为 0 且 为空时,改写 query 或放宽产品过滤;这不代表服务故障。
documents - 参数错误:按对应子命令的 修正参数;数量和长度必须为正数,起始索引非负。
--help - 请求失败:非零退出时读取 stderr,区分网络问题和上游业务错误。超时或 等暂时性故障可重试一两次;持续失败时说明失败原因,不把失败当成无结果。公开文档请求失败无需补充云账号凭据。
DownstreamError
- Answer based on evidence: Conceptual questions sufficiently supported by a snippet can be answered directly. Retrieve the body text first when exact rules or complete steps are needed. Do not describe a partially read page as having been read in full.
- Cite sources: Use the clean URL returned by the CLI in the format . Prefer displaying at most 3 of the most relevant sources, and ensure that every conclusion corresponds to content that has been read.
[Document Title](URL) - Control output: Use and
--limitfor--snippet-length, and usesearchand--max-lengthfor--start-index. The CLI does not provide the temporary-file preview mechanism used by older scripts; continuation depends on pagination parameters.fetch - Normal empty result: If the exit code is 0 and is empty, rewrite the query or relax the product filter. This does not indicate a service failure.
documents - Argument error: Correct the arguments according to the corresponding subcommand's . Counts and lengths must be positive, and the starting index must be non-negative.
--help - Request failure: When the exit code is non-zero, read stderr and distinguish network issues from upstream business errors. Temporary failures such as timeouts or may be retried once or twice. If the failure persists, explain the cause and do not treat it as an empty result. Failed public documentation requests do not require cloud account credentials.
DownstreamError