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

# 用 Agent 模板庫建立 Agent

從 Agent 模板庫挑一個官方模板，預覽示範對話後一鍵套用，得到一個可自由修改指令、知識庫與工具的組織自建 Agent。

<mark style="color:blue;">Agent 模板庫</mark> 把 MaiAgent 官方設計好的 Agent 做成「模板」。你可以先預覽模板的示範對話，覺得合用就按 <mark style="color:blue;">套用</mark>，系統會在你的組織裡建立一個**可以自由編輯**的 Agent，之後角色指令、知識庫、工具都能照公司需求調整。

## 模板庫與 Agent 市集的差別 <a href="#vs-marketplace" id="vs-marketplace"></a>

兩者的官方 Agent 來源相同，差別在「拿到手之後能不能改」：

|            | Agent 市集（啟用官方內建 Agent） | Agent 模板庫（套用模板）      |
| ---------- | ---------------------- | -------------------- |
| 得到什麼       | 一個**鎖定**的官方 Agent      | 一個**可編輯**的組織自建 Agent |
| 角色指令／工具／模型 | 不可修改                   | 可自由修改                |
| 版本更新       | 自動跟隨官方最新版              | 套用當下的版本，之後不會被官方改版覆蓋  |
| 計入額度       | 官方內建 Agent 的同時啟用上限     | 方案的 Agent 數量上限       |

簡單說：**想開箱即用、由官方維護，用 Agent 市集；想以官方設計為起點再客製，用 Agent 模板庫。** Agent 市集的用法請見 [使用官方內建 Agent](/work/built-in-agents/use.md)。

{% hint style="info" %}
要瀏覽並套用 <mark style="color:blue;">Agent 模板庫</mark> 的模板需要兩個條件：組織方案包含 Agent Builder，且你的角色具備 <mark style="color:blue;">AI 功能</mark> 中的 <mark style="color:blue;">AI 助理</mark> 權限（角色權限設定請見 [角色權限](/org/roles/role-permission.md)）。<mark style="color:blue;">Agent 市集權限</mark> 只決定能否看到並操作 <mark style="color:blue;">Agent 市集</mark>、與 Agent 建立對話及傳送訊息，不影響能否使用模板庫；要限制哪些成員能套用模板，請在角色權限中取消 <mark style="color:blue;">AI 助理</mark> 權限（取消後該角色也無法新增或編輯 Agent）。若該角色仍保有 <mark style="color:blue;">AI 功能</mark> 中的其他頁面權限（例如 <mark style="color:blue;">知識庫</mark> 權限），左側選單仍會顯示 <mark style="color:blue;">Agent 模板庫</mark>，但無法瀏覽或套用模板。
{% endhint %}

## 使用情境 <a href="#use-case" id="use-case"></a>

某貿易公司的業務主管小林，希望業務團隊回覆客戶來信時語氣一致、重點清楚，但不想從零寫一份角色指令。他到 <mark style="color:blue;">Agent 模板庫</mark> 搜尋「郵件」，找到「郵件回覆撰寫」模板，先預覽示範對話確認它會先覆述來信重點、再確認語氣與版本後才草擬回信；確定合用後按 <mark style="color:blue;">套用</mark>，系統隨即建好一個同名的 Agent 與專屬知識庫。小林接著點 <mark style="color:blue;">前往 AI 助理設定</mark>，把 Agent 改名為團隊慣用的名稱並儲存。之後他可以再把公司的報價規範上傳到這個 Agent 的知識庫、調整角色指令，讓回信更貼近公司口徑。

## 操作步驟 <a href="#steps" id="steps"></a>

### 1. 進入 Agent 模板庫 <a href="#open-library" id="open-library"></a>

在左側選單點選 <mark style="color:blue;">Agent 模板庫</mark>，頁面會以卡片列出所有可套用的官方模板。每張卡片顯示模板名稱、分類、簡介；若模板會用到 MaiGPT 連接器（例如 Microsoft、Google），卡片上會顯示對應的連接器圖示。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-eb8a9e821c13eeac598316f4f46c027a96fcb557%2Fagent-templates-library.png?alt=media" alt="Agent 模板庫頁面，列出官方模板卡片與分類篩選"><figcaption><p>左側選單的 Agent 模板庫與模板卡片列表</p></figcaption></figure>

### 2. 篩選或搜尋模板 <a href="#filter-and-search" id="filter-and-search"></a>

* 上方的 <mark style="color:blue;">全部</mark>／<mark style="color:blue;">職務</mark>／<mark style="color:blue;">產業</mark> 可切換分類方式，再點下方的分類標籤（例如 <mark style="color:blue;">法務</mark>、<mark style="color:blue;">銀行</mark>）縮小範圍。
* 右上角的 <mark style="color:blue;">搜尋模板名稱或描述</mark> 可用關鍵字找模板。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-bf733806a3cdff6fed48843a872234d462a219a7%2Fagent-templates-search.png?alt=media" alt="在搜尋框輸入「郵件」後只剩「郵件回覆撰寫」一張卡片"><figcaption><p>搜尋「郵件」找到「郵件回覆撰寫」模板</p></figcaption></figure>

### 3. 預覽模板 <a href="#preview" id="preview"></a>

點擊卡片或卡片上的 <mark style="color:blue;">預覽</mark>，會開啟預覽視窗：

* 左側播放一段示範對話，讓你看到這個 Agent 實際怎麼跟使用者互動；可點 <mark style="color:blue;">重新播放</mark> 從頭再看一次。
* 右側的導覽會隨對話同步，說明每一步在做什麼。
* 下方有 <mark style="color:blue;">套用</mark> 按鈕；環境有開啟 [Ask AI](/start/header-tools.md#ask-ai) 時，還會出現 <mark style="color:blue;">Ask AI</mark>，可以直接請 AI 以這個模板為基礎幫你規劃客製方向。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-d568636b6585d0cf7130564f6b86a3400f02241b%2Fagent-templates-preview.png?alt=media" alt="郵件回覆撰寫模板的預覽視窗，左側為示範對話、右側為步驟導覽"><figcaption><p>預覽視窗：示範對話與步驟導覽，底部為 Ask AI 與套用按鈕</p></figcaption></figure>

{% hint style="info" %}
預覽只是播放官方準備的示範對話，不會建立任何資源，也不會消耗你的額度。
{% endhint %}

### 4. 套用模板 <a href="#apply" id="apply"></a>

在預覽視窗按 <mark style="color:blue;">套用</mark>。建立完成後會顯示 <mark style="color:blue;">Agent 已加入</mark> 視窗，列出這次建立的資源：

* **AI 助理**：名稱與模板相同；若組織裡已有同名 Agent，系統會自動在名稱後加上編號。
* **知識庫**：一個與 Agent 同名的專屬知識庫，已連結到這個 Agent。

視窗中可以直接前往下一步：

* <mark style="color:blue;">前往對話</mark>：馬上和新 Agent 對話試用。
* <mark style="color:blue;">前往上傳知識庫文件</mark>：把公司自己的文件放進專屬知識庫。
* <mark style="color:blue;">前往 AI 助理設定</mark>：調整名稱、角色指令、工具等設定。
* <mark style="color:blue;">稍後再說</mark>：關閉視窗，之後可到 <mark style="color:blue;">AI 助理</mark> 列表找到它。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-c0c2a7ed4ae4f9f9022aca49fd2214516a65d50c%2Fagent-templates-apply-success.png?alt=media" alt="Agent 已加入視窗，列出建立的 Agent 與知識庫及後續導向按鈕"><figcaption><p>套用成功後列出建立的 Agent 與知識庫</p></figcaption></figure>

{% hint style="warning" %}
每套用一次就會新建一個 Agent，並計入方案的 Agent 數量上限。額度已滿時會出現「已達建立數量上限，請升級方案或聯繫管理員」的提示（各方案額度見 [試用與訂閱方案](/others/trial-and-plans.md)）。
{% endhint %}

### 5. 依需求調整 Agent <a href="#customize" id="customize"></a>

點 <mark style="color:blue;">前往 AI 助理設定</mark> 會進入這個 Agent 的設定頁。它和你自己建立的 Agent 完全一樣，可以修改 <mark style="color:blue;">名稱</mark>、LLM 模型，也能在左側切換到 <mark style="color:blue;">知識庫設定</mark>、<mark style="color:blue;">工具</mark>、<mark style="color:blue;">MaiGPT 連接器</mark>、<mark style="color:blue;">技能設定</mark> 等項目調整。模板原本帶有的工具、技能與連接器，套用後已預先掛好。改完記得按 <mark style="color:blue;">儲存</mark>。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-acc3bc9c769f6300116f8ee19334b34089e95991%2Fagent-templates-edit-settings.png?alt=media" alt="套用後的 Agent 設定頁，名稱已改為示範－郵件回覆撰寫"><figcaption><p>套用後的 Agent 設定頁：已預先帶入知識庫、工具、連接器與技能，名稱可自行修改</p></figcaption></figure>

各項設定的詳細說明可參考 [建立 Agent](/build/agent/setup.md) 與 [為 Agent 加入角色指令](/build/agent/add-system-prompt.md)。


---

# 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://docs.maiagent.ai/build/agent/agent-templates.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.
