# 什么是 agent？ (/zh/agent)

<!-- agent-signals: reading_time_min: 3 · est_tokens: 1813 · updated: 2026-07-31 -->

<Info>
  agent 需要 [Pro 或 Enterprise 方案](https://mintlify.com/pricing?ref=agent)。
</Info>

agent 是一款 AI 工具，会根据你的提示，为文档创建包含建议更改的拉取请求 (PR；亦称“合并请求”/Merge Request) 。当你发送请求时，agent 会：

* **调研**：搜索并阅读你现有的文档、所有已连接的代码仓库、相关上下文以及网络内容。
* **规划**：为复杂的文档工作创建结构化任务清单。
* **撰写**：生成或更新内容，遵循写作规范和最佳实践。
* **验证**：运行 Mintlify 命令行界面 (CLI) 检查，确保文档可以正确构建。
* **发布更改**：打开一个包含建议更改的拉取请求 (PR；亦称“合并请求”/Merge Request) 供你审核，或直接向你的部署 branch 提交，具体取决于你的[审核流程设置](/zh/agent/index#choose-how-the-agent-publishes-changes)。

<div id="how-to-use-the-agent">
  ## 如何使用 agent [#如何使用-agent]
</div>

你可以通过以下方式向 agent 发送提示词：

* **Slack**：在 agent 所在的任何频道中提及 `@Mintlify`，或直接向该应用发送私信。参见[将 agent 添加到 Slack](/zh/agent/slack)。
* **控制台**：在 [Mintlify 控制台](https://app.mintlify.com)中打开 agent 面板以开始新对话。
* **自动化**：按计划或基于事件触发 agent。参见[自动化](/zh/automations/index)。

<div id="what-you-can-do-with-the-agent">
  ## 你可以用智能助手做什么 [#你可以用智能助手做什么]
</div>

使用智能助手可以：

* 根据你的提示词、拉取请求 (PR；亦称“合并请求”/Merge Request) 、Slack 线程或文件附件撰写新内容。
* 根据新功能或 API 变更更新现有文档。
* 处理并插入来自 Slack 附件的图片、图表和其他文件。
* 在你的文档中搜索并修改代码示例和 API 参考。
* 引用任何已安装 Mintlify GitHub 应用的仓库中的源代码。
* 通过自动化处理文档维护工作。
* 回答与你的文档和技术写作相关的问题。
* 处理代码审查反馈并维护文档质量。
* 在知识从 Slack 对话和拉取请求中流失之前，将其记录下来。
* 高效地在多个文件和目录之间导航并协调更改。

<div id="connect-your-github-account">
  ## 连接你的 GitHub 账户 [#连接你的-github-账户]
</div>

默认情况下，代理会以 Mintlify 机器人身份创建拉取请求 (PR；亦称“合并请求”/Merge Request) 。若要将拉取请求归属到你的账号，请在控制台的 [My profile](https://dashboard.mintlify.com/settings/account) 页面连接你的 GitHub 账户。

<div id="choose-how-the-agent-publishes-changes">
  ## 选择 agent 如何发布更改 [#选择-agent-如何发布更改]
</div>

默认情况下，agent 会为每次更改打开一个拉取请求，以便你的团队在更改发布前进行审核。如果你的部署由 Mintlify 托管，agent 会将更改直接提交到你的部署 branch，使其立即发布。

对于连接到你自有 Git 提供商的部署，请在控制台的 [Automations](https://app.mintlify.com/products/automations) 页面点击 **Configure Slack**，然后在 Slack 设置中设置 **Review process**：

* **Create a pull request**：agent 在新的 branch 上提交更改，并针对你的部署 branch 打开拉取请求。当你希望有人在更改发布前进行审核时，请使用此选项。
* **Push to main**：agent 直接向你的部署 branch 提交更改，agent 完成后更改立即发布。当你信任 agent 无需审核即可发布时（例如在预发布环境的部署中），请使用此选项。

<Note>
  如果你的部署 branch 设置了阻止直接推送的分支保护规则，即使你将 **Review process** 设为 **Push to main**，agent 仍会打开拉取请求。
</Note>

<div id="connect-repositories-as-context">
  ## 将仓库连接为上下文 [#将仓库连接为上下文]
</div>

Agent 只能访问你通过 Mintlify GitHub 应用连接的仓库。你可以在 [GitHub 应用设置](https://github.com/apps/mintlify/installations/new) 中，或对于 GitLab 在 [Git Settings](https://app.mintlify.com/settings/deployment/git-settings) 中，配置 agent 可访问的仓库。

<div id="use-ai-tools-alongside-the-agent">
  ## 与 agent 配合使用 AI 工具 [#与-agent-配合使用-ai-工具]
</div>

agent 通过拉取请求异步工作，但你也可以在本地使用 Cursor 或 Claude Code 等 AI 编码工具进行快速、迭代式编辑。安装 Mintlify [skill](/zh/ai/skillmd) 并连接 [MCP 服务器](/zh/ai/model-context-protocol)，让你的编辑器拥有与 agent 相同的上下文。

要让外部代理通过 MCP 工具调用直接编辑你的内容，请将其连接到 [Mintlify MCP 服务器](/ai/mintlify-mcp)。

<Prompt description="为 AI 编码工具安装 Mintlify skill 和 MCP 服务器。" actions="[&#x22;copy&#x22;, &#x22;cursor&#x22;]">
  安装 Mintlify skill，以获取关于 Mintlify 项目结构、组件和文档最佳实践的上下文：

  npx skills add [https://mintlify.com/docs](https://mintlify.com/docs)

  然后添加 Mintlify Docs MCP 服务器以访问文档搜索。[https://mintlify.com/docs/mcp](https://mintlify.com/docs/mcp)

  然后添加 Mintlify MCP 服务器以访问 dashboard 和其他 Mintlify 专属工具。[https://mcp.mintlify.com](https://mcp.mintlify.com)
</Prompt>

<div id="next-steps">
  ## 后续步骤 [#后续步骤]
</div>

<Card title="连接 Slack" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M8 7L16 7&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M8 11L12 11&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/agent/slack">
  将 agent 添加到你的 Slack 工作区。
</Card>

<Card title="自定义行为" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M20.3584 13.3567C19.1689 14.546 16.9308 14.4998 13.4992 14.4998C11.2914 14.4998 9.50138 12.7071 9.50024 10.4993C9.50024 7.07001 9.454 4.83065 10.6435 3.64138C11.8329 2.45212 12.3583 2.50027 17.6274 2.50027C18.1366 2.49809 18.3929 3.11389 18.0329 3.47394L15.3199 6.18714C14.6313 6.87582 14.6294 7.99233 15.3181 8.68092C16.0068 9.36952 17.1234 9.36959 17.8122 8.68109L20.5259 5.96855C20.886 5.60859 21.5019 5.86483 21.4997 6.37395C21.4997 11.6422 21.5479 12.1675 20.3584 13.3567Z&#x22; stroke=&#x22;currentColor&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M13.5 14.5L7.32842 20.6716C6.22386 21.7761 4.433 21.7761 3.32843 20.6716C2.22386 19.567 2.22386 17.7761 3.32843 16.6716L9.5 10.5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M5.50896 18.5H5.5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;2&#x22;/></svg>" href="/zh/agent/customize">
  使用 `AGENTS.md` 文件配置 agent。
</Card>

<Card title="编写高效的提示词" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M3.49977 18.9853V20.5H5.01449C6.24074 20.5 6.85387 20.5 7.40518 20.2716C7.9565 20.0433 8.39004 19.6097 9.25713 18.7426L19.1211 8.87868C20.0037 7.99612 20.4449 7.55483 20.4937 7.01325C20.5018 6.92372 20.5018 6.83364 20.4937 6.74411C20.4449 6.20253 20.0037 5.76124 19.1211 4.87868C18.2385 3.99612 17.7972 3.55483 17.2557 3.50605C17.1661 3.49798 17.0761 3.49798 16.9865 3.50605C16.4449 3.55483 16.0037 3.99612 15.1211 4.87868L5.25713 14.7426C4.39004 15.6097 3.9565 16.0433 3.72813 16.5946C3.49977 17.1459 3.49977 17.759 3.49977 18.9853Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M13.5 6.5L17.5 10.5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/agent/effective-prompts">
  使用更聚焦的提示词以获得更好的效果。
</Card>

<Card title="使用自动化实现自动化" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/automations/index">
  使用自动化处理重复性任务和文档维护。
</Card>
