# AI 搜索

通过强大的知识发现工具，帮助你的用户更快找到所需信息，适用于你发布的内容

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

GitBook 站点会根据你希望为用户提供的体验，提供不同的搜索方式：

* **关键词搜索** – 基于关键词的标准搜索体验。已在所有站点自动启用。
* **GitBook AI 搜索** – 用户可直接在搜索框中获得问题的简短答案。
* **GitBook Assistant** – 用户可与 GitBook 的 AI 代理进行高级的交互式聊天体验。前往 [GitBook Assistant](/docs/documentation/zh/ai-yu-sou-suo/gitbook-ai-assistant.md) 了解更多。

要选择你网站的搜索体验，请打开你的网站仪表板，导航到 **设置** 页面，然后从左侧菜单中选择 **AI 与 MCP** 。你可以在这里选择你偏好的体验。

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

{% hint style="warning" %}
启用 GitBook 助手时，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 Assistant** ![](/files/464645f54a431f4fb9d7878d3281e325f2e2f741) 按钮，位于 **询问或搜索…** 栏
* 在 **询问或搜索…** 栏中输入一个问题，并在菜单顶部选择“询问…”选项。


---

# Agent Instructions: 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:

```
GET https://gitbook.com/docs/documentation/zh/docs-site/ai-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
