> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/getting-started/ai-documentation.md).

# 借助 AI 构建

使用 AI 构建 GitBook 文档可在不同环境中进行——在你的仓库本地、CI 工作流中，或直接通过 AI 代理。每个已发布站点默认都包含适合 AI 的输出，并根据你的方案提供交互式 AI 功能。

## 选择你的 AI 工作流

如果你希望 AI 编码助手或代理帮助你编写和管理内容，GitBook 会根据你的工作方式提供不同的选项：

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">封面图</th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover-dark data-type="image">封面图（深色）</th></tr></thead><tbody><tr><td><strong>在本地借助 AI 构建</strong></td><td>在你的仓库中使用遵循 GitBook 规则的 AI 编码助手进行工作。</td><td><a href="/files/51dd26b1976aad0df555a51bcd5dce8d4140fc5f">/files/51dd26b1976aad0df555a51bcd5dce8d4140fc5f</a></td><td><a href="/pages/dd1c63cc42f33c379dcd4bb26f91c4c7f8a96204">/pages/dd1c63cc42f33c379dcd4bb26f91c4c7f8a96204</a></td><td><a href="/files/5529148c87c96f400a155b056b4d93b084bd357b">/files/5529148c87c96f400a155b056b4d93b084bd357b</a></td></tr><tr><td><strong>使用 MCP 构建</strong></td><td>将 AI 代理连接到 GitBook 的 API，为你创建、编辑和管理文档。</td><td><a href="/files/05433dab2b9d1809fa9f468c7b20b4397a39f5e5">/files/05433dab2b9d1809fa9f468c7b20b4397a39f5e5</a></td><td><a href="/pages/edc2cc7343295ecf861f3c6515bedd4884d8baf8">/pages/edc2cc7343295ecf861f3c6515bedd4884d8baf8</a></td><td><a href="/files/4a6ae91b9e3a38b5173de195b49969d230a7d95b">/files/4a6ae91b9e3a38b5173de195b49969d230a7d95b</a></td></tr><tr><td><strong>使用 GitBook Agent 构建</strong></td><td>借助 GitBook 的 AI 直接在编辑器中进行更改。</td><td><a href="/files/e3e588c5f64eadec519ddc463fe24a0f31f99a6e">/files/e3e588c5f64eadec519ddc463fe24a0f31f99a6e</a></td><td><a href="/pages/b5ac798786cec307b1c4ee767ac2ab9e54c84acb">/pages/b5ac798786cec307b1c4ee767ac2ab9e54c84acb</a></td><td><a href="/files/42ecb4ee27da74466c8a8f5475e319067c7417f4">/files/42ecb4ee27da74466c8a8f5475e319067c7417f4</a></td></tr></tbody></table>

## 将你已发布的文档连接到 AI 工具

一旦发布，你的文档就可以被 Claude、Codex、Cursor、Copilot 和 GitBook 助手等 AI 工具读取。

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-gitbook-assistant">:gitbook-assistant:</i></h4></td><td><strong>GitBook 助手</strong></td><td>帮助读者从你的文档中快速获取有上下文的答案——无论是在你的网站上，还是嵌入到你的产品中。</td><td><a href="/pages/9f97be21402fc075995178c6e13cb838c64a90aa">/pages/9f97be21402fc075995178c6e13cb838c64a90aa</a></td></tr><tr><td><h4><i class="fa-mcp">:mcp:</i></h4></td><td><strong>已发布文档的 MCP</strong></td><td>让外部 AI 工具通过你网站的 MCP 服务器直接连接到你已发布的文档。</td><td><a href="/pages/b4a8a4cbe1c54b4f31675a4dca208e1f709d7eb0">/pages/b4a8a4cbe1c54b4f31675a4dca208e1f709d7eb0</a></td></tr><tr><td><h4><i class="fa-sparkles">:sparkles:</i></h4></td><td><strong>适合 LLM 的文档</strong></td><td>了解 GitBook 如何让你已发布的文档更易于被 AI 工具发现、读取和使用。</td><td><a href="/pages/015f9eb49f1a26919577acf3bbf104bb8b736009">/pages/015f9eb49f1a26919577acf3bbf104bb8b736009</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/getting-started/ai-documentation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
