> 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/docs-site/ai-search.md).

# AI 搜索

借助强大的知识发现工具，帮助用户更快找到已发布内容中所需的信息

### 选择你的网站搜索体验

GitBook 网站提供不同的搜索体验，具体取决于你希望为用户提供什么：

* **关键词搜索** – 基于关键词的标准搜索体验。所有网站默认自动启用。
* **GitBook AI 搜索** – 用户可直接从搜索框获得问题的简短答案。适用于 Premium 和 Ultimate 网站方案。
* **GitBook 助手** – 用户可通过 GitBook 的 AI 代理获得高级的交互式聊天体验。适用于 Ultimate 网站方案。前往 [GitBook 助手](/docs/documentation/zh/ai-yu-sou-suo/gitbook-ai-assistant.md) 了解更多。

AI 搜索适用于 Premium 和 Ultimate 网站方案。GitBook Assistant 适用于 Ultimate 网站方案。

要选择你网站的搜索体验，请打开 **自定义**，在……下 **工具** 在网站侧边栏中，然后点击 **AI 助手**。在这里你可以选择你偏好的体验。

<figure><img src="/files/94828ed3506a19e84564fe6baf9c0ba61419b905" alt=""><figcaption><p>选择你在已发布文档中想要的搜索体验</p></figcaption></figure>

{% hint style="warning" %}
启用 GitBook Assistant 时，AI 搜索将被禁用。无论你选择哪种体验，标准关键词搜索始终会在搜索栏中提供结果。
{% endhint %}

## 搜索已发布的文档

用户可以打开 **提问或搜索…** 栏，按下 <kbd>⌘</kbd> + <kbd>K</kbd> （Mac 上）或 <kbd>Ctrl</kbd> + <kbd>K</kbd> 在 PC 上。

你的用户可以在你的文档网站内搜索关键词，并快速跳转到整个网站中的特定页面或页面部分。

如果你的文档网站有多个 [区块中](/docs/documentation/zh/docs-site/site-structure/site-sections.md)，搜索结果将包含这些部分中的所有页面，以便你的用户可以直接跳转到他们需要的页面。

## GitBook AI 搜索

{% hint style="info" %}
此功能适用于 [高级和终极站点方案](https://www.gitbook.com/pricing).
{% endhint %}

GitBook AI 搜索会在 **“搜索并查找…”** 你网站的搜索栏中提供基础 AI 驱动的答案。它基于你文档网站的内容进行训练，但无法从外部来源获取信息。

### 使用 GitBook AI 搜索

如果你已在网站设置页面启用 GitBook AI 搜索，用户可以直接在 **提问或搜索…** 页面顶部的栏中访问它。

他们可以直接点击它打开，或者按下 <kbd>⌘</kbd> + <kbd>K</kbd> 在 Mac 上 <kbd>Ctrl</kbd> + <kbd>K</kbd> 在 PC 上。

除了摘要答案外，用户还会在下方看到一个可展开的部分，其中显示 GitBook AI 用于生成答案的来源，以及可点击的相关追问问题。

{% hint style="warning" %}
GitBook AI 无法跨不同的单个已发布部分工作，这些部分位于不同的 [文档网站](/docs/documentation/zh/docs-site/publish-a-docs-site.md).

多部分搜索仅在查看已发布的 [区块中](/docs/documentation/zh/docs-site/site-structure/site-sections.md) 且位于同一网站内的内容时可用。
{% endhint %}

* 按 <kbd>⌘</kbd> + <kbd>I</kbd> （Mac 上）或 <kbd>Ctrl</kbd> + <kbd>I</kbd> （PC 上）
* 点击 **GitBook 助手** ![](/files/464645f54a431f4fb9d7878d3281e325f2e2f741) 按钮，位于 **提问或搜索…** 栏旁边
* 在 **提问或搜索…** 栏，然后在菜单顶部选择“Ask…”选项。


---

# 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/docs-site/ai-search.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.
