> 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/llm-ready-docs.md).

# 为 LLM 准备好的文档

让你发布的文档更容易被 AI 工具发现、阅读和使用

GitBook 会自动为你的文档站点发布适合 AI 的格式。

它们可帮助大语言模型（LLM）、编码代理和 AI 搜索系统。这些工具无需解析 HTML 就能发现并检索准确的文档。

## Markdown 页面

在末尾添加 `.md` 即可查看任何已发布页面 URL 对应的 Markdown。Markdown 能为 AI 工具提供结构化内容，无需包含周围的 HTML。

对于根落地页，请在 `/.md` 后面加上站点 URL。例如， `https://gitbook.com/docs` 会变成 `https://gitbook.com/docs/.md`。如果您的站点发布在域名根目录下，请使用 `https://docs.example.com/.md`.

<a href="https://gitbook.com/docs/publishing-documentation/llm-ready-docs.md" class="button primary">查看此页面的 .md 文件</a>

## llms.txt

[llms.txt](https://llmstxt.org/) 是面向 LLM 的网页内容拟议标准。在文档站点的根 URL 末尾添加 `/llms.txt` 。

它列出每个带有 Markdown 版本的已发布页面。AI 工具可以使用此索引来发现你的文档。

<a href="https://gitbook.com/docs/llms.txt" class="button primary">查看 GitBook 文档的 /llms.txt</a>

## llms-full.txt

在文档站点的根 URL 末尾添加 `/llms-full.txt` 。此文件汇总了完整的文档内容。

隐藏的页面也会包含在 `llms-full.txt`中。隐藏页面只会将其从已发布的目录中移除。

<a href="https://gitbook.com/docs/llms-full.txt" class="button primary">查看 GitBook 文档的 /llms-full.txt 文件</a>

## 已发布文档的 MCP 服务器

GitBook 为每个已发布的文档站点提供 Model Context Protocol（MCP）服务器。兼容的工具可以将你的文档作为结构化资源进行发现和检索。

隐藏页面仍可通过站点的 MCP 服务器访问。隐藏页面只会将其从已发布的目录中移除。

在文档站点的根 URL 末尾添加 `/~gitbook/mcp` 。例如，GitBook 的 MCP 服务器地址为 `https://gitbook.com/docs/~gitbook/mcp`.

{% hint style="info" %}
在浏览器中打开此 URL 会返回错误。请使用可以发起 HTTP 请求的工具。
{% endhint %}

了解更多信息，请参阅 [已发布文档的 MCP 服务器](https://gitbook.com/docs/documentation/zh/ai-for-your-readers/mcp-servers-for-published-docs.md).

## 为 AI 优化你的文档

GitBook 负责交付层。你的写作决定 AI 答案的质量。

编写可被 AI 工具可靠理解的内容：

* 让每一页都有明确目的。
* 使用描述性标题和简短的章节。
* 直接说明限制、默认值和要求。
* 包含具体示例和精确数值。
* 当你的产品变化时，更新内容。

这些做法能提升检索效果、减少歧义，并帮助人们找到答案。

### 保持翻译一致

如果你以多种语言发布内容，请让每个译文与其原文保持一致。

[翻译](https://gitbook.com/docs/documentation/zh/gitbook-dai-li/translations.md) 可让你使用 GitBook Agent 本地化内容。源内容更改时，GitBook 可以让翻译版本保持同步。

### 衡量 AI 流量

使用站点分析中的 [Agents & MCP](https://gitbook.com/docs/documentation/zh/analytics/insights/agents-and-mcp.md) 报告，跟踪来自 LLM 和 MCP 客户端的流量。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
