> 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/work/file-library/vs-knowledge-base.md).

# 知識庫 vs 檔案庫：用途差異與選用時機

知識庫和檔案庫差在哪、資料該放哪一邊：一句話定位、適用情境對照、常見誤用與「我要做什麼 → 放哪裡」決策表，以及兩者在同一個 Agent 或對話裡怎麼搭配。

**知識庫是考試時的小抄，檔案庫是寫作業時手邊的整本課本。**

兩者都能放文件，但 AI 用它們的方式不同：知識庫讓 Agent **快速找出答案**回覆使用者，檔案庫讓 AI **參考完整原檔來做事**。資料放錯邊，常見的結果是回答不準、回得慢，或 Credits 用量偏高。這一頁幫你判斷資料該放哪裡。

***

## 一句話定位 <a href="#positioning" id="positioning"></a>

|            | [知識庫](https://docs.maiagent.ai/build/knowledge-base.md)（RAG） | [檔案庫](https://docs.maiagent.ai/work/file-library.md) |
| ---------- | ------------------------------------------------------------ | ---------------------------------------------------- |
| **比喻**     | 考試時的小抄                                                       | 寫作業時放在手邊的整本課本                                        |
| **是什麼**    | Agent 的「記憶」：內容先切成片段、建好索引                                     | 組織的檔案集中處：檔案以原檔保存在檔案工作區                               |
| **AI 怎麼用** | 先檢索出與問題最相關的幾個片段，再依片段回答                                       | 需要時整份讀完檔案再回答，也能在你確認後修改、改名、搬移檔案                       |
| **目標**     | 最快、最準地回答使用者的問題                                               | 讓 AI 根據完整內容幫你撰寫、彙整、改寫                                |

考試時不可能帶整疊課本進考場，所以要準備小抄；寫作業時則需要把課本攤開、完整查閱。對外回答問題像考試，要的是最快能找到答案的小抄；內部撰寫文件像寫作業，要的是完整的原檔。

***

## 適用情境對照 <a href="#use-cases" id="use-cases"></a>

|             | 知識庫                                                                                                                           | 檔案庫                                                                                                                                    |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **典型情境**    | 對外客服、FAQ 問答、內部規章與 SOP 查詢                                                                                                      | 內部撰寫、彙整、改寫文件，例如寫提案、整理多份報價、依新規格改 FAQ                                                                                                    |
| **要的是**     | 要快、要準                                                                                                                         | 要完整、可修改                                                                                                                                |
| **在哪裡用**    | 任何對話平台的 Agent（網頁 Widget、LINE、API 串接、內部對話），以及 MaiGPT 的 [知識庫問答](https://docs.maiagent.ai/work/maigpt/chat.md#knowledge-base-qa) | MaiGPT（[掛上工作區](https://docs.maiagent.ai/work/file-library/use-in-maigpt.md)），以及有設定檔案工作區的 Agent 的 <mark style="color:blue;">內部對話</mark> |
| **資料要怎麼準備** | 要花功夫整理：寫 [FAQ](https://docs.maiagent.ai/build/knowledge-base/faq.md)、清洗資料、去掉過時或重複的內容，回答品質才會穩定                                 | 放原檔即可，依專案或主題分工作區整理                                                                                                                     |
| **內容會變嗎**   | 相對固定，更新時重新上傳                                                                                                                  | 經常修改；每次修改都留版本，可以 [還原](https://docs.maiagent.ai/work/file-library/versions.md)                                                          |

{% hint style="warning" %}
網頁 Widget、LINE、API 串接等對話平台**一律不讀也不寫檔案庫**，只有 MaiGPT 與 Agent 的 <mark style="color:blue;">內部對話</mark> 會用到。要讓對外客服 Agent 回答的內容，請放知識庫。
{% endhint %}

***

## 常見誤用 <a href="#common-mistakes" id="common-mistakes"></a>

| 常見做法                                 | 會發生什麼                                             | 建議                                                                                                               |
| ------------------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| 把產品手冊放進檔案庫，期待對外客服 Agent 據此回答         | 網頁 Widget、LINE 等對話平台讀不到檔案庫，Agent 答不出來             | 放知識庫，並把高頻問題整理成 FAQ                                                                                               |
| 用檔案庫回答大量重複的常見問題                      | 需要讀取大量完整文件時，處理時間與 Credits 用量可能增加；單次讀取最多 5 份，可分批讀取 | 整理成知識庫的 FAQ，回答又快又一致                                                                                              |
| 把一大批未整理的原檔直接丟進知識庫，請 Agent 寫報告或比較整份文件 | 知識庫以檢索相關片段為主；若任務需要逐份比對完整原檔，應明確指定要參考的文件與範圍         | 放檔案庫的工作區，讓 AI 整份讀完再彙整                                                                                            |
| 把還在反覆修改的草稿放知識庫                       | 每改一次都要重新上傳、等解析，沒有版本紀錄；舊版內容可能還被拿來回答                | 草稿放檔案庫，定稿、要讓 Agent 對外回答時再放進知識庫                                                                                   |
| 沒整理就把所有文件都放進知識庫                      | 不相關或互相矛盾的片段被當成依據，回答失準                             | 只放與 Agent 任務相關、已清洗的內容，上線前用 [搜尋測試](https://docs.maiagent.ai/build/knowledge-base/test-search-result.md) 確認找得到正確片段 |

***

## 我要做什麼 → 放哪裡 <a href="#decision-table" id="decision-table"></a>

| 我要做什麼                              | 放哪裡                                                                                    |
| ---------------------------------- | -------------------------------------------------------------------------------------- |
| 讓官網或 LINE 上的客服 Agent 回答產品、方案、退換貨問題 | 知識庫                                                                                    |
| 讓 Agent 用標準答案回覆常見問題                | 知識庫（FAQ）                                                                               |
| 讓同仁用 MaiGPT 查公司規章、SOP              | 知識庫                                                                                    |
| 依規格書和客戶需求，請 AI 寫一份提案               | 檔案庫                                                                                    |
| 比較幾份報價單、合約的完整差異                    | 檔案庫                                                                                    |
| 請 AI 直接修改文件內容，並保留修改紀錄              | 檔案庫                                                                                    |
| 保存 AI 在對話中產出的文件、圖片                 | 檔案庫（自動存進 <mark style="color:blue;">我的檔案</mark> 的 <mark style="color:blue;">暫存區</mark>） |
| 同一份資料既要對外回答、又要內部改寫                 | 兩邊都放：原檔在檔案庫維護，整理好的定稿或 FAQ 放知識庫                                                         |

還是拿不定主意，就問自己：**要的是「找到答案」，還是「處理整份檔案」？** 找答案用知識庫，處理檔案用檔案庫。

***

## 同一個 Agent 或對話可以並用嗎 <a href="#use-together" id="use-together"></a>

可以。兩者不衝突，AI 會依問題決定要檢索知識庫的片段，還是讀取工作區的檔案。

### 在 MaiGPT 對話中並用 <a href="#together-in-maigpt" id="together-in-maigpt"></a>

同一段 MaiGPT 對話可以一邊 [掛上工作區](https://docs.maiagent.ai/work/file-library/use-in-maigpt.md#start-chat)，一邊用 <mark style="color:blue;">選擇知識庫</mark> 指定要查詢的知識庫。

例如，客服訓練負責人想同時查工作區原檔與知識庫。她在存有示範保固 FAQ 的工作區按 <mark style="color:blue;">由此開始對話</mark>，再勾選圖書館示範知識庫，詢問「工作區文件中的主機與馬達保固多久？知識庫中的大學生與研究生借書期限各是多少？」MaiGPT 在同一則回答分別引用工作區原檔與知識庫，方便她核對兩種資料來源。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-865b65ea7c63f20df5411d1e3d0c033cc60d9650%2Fkb-file-library-prod-answer.png?alt=media" alt="同一則回答列出工作區文件的保固資訊與已勾選知識庫的借書期限"><figcaption><p>同一段 MaiGPT 對話分別引用工作區原檔與勾選的知識庫回答問題；圖中內容均為虛構示範資料。</p></figcaption></figure>

### 在 Agent 設定中並用 <a href="#together-in-agent" id="together-in-agent"></a>

組織開通檔案庫後，Agent 設定左側 <mark style="color:blue;">知識與資料</mark> 群組會出現 <mark style="color:blue;">檔案工作區</mark>，可以和 <mark style="color:blue;">知識庫設定</mark> 同時設定。檔案工作區決定這個 Agent 在 <mark style="color:blue;">內部對話</mark> 中怎麼使用檔案庫：

| 選項                                        | 說明                           |
| ----------------------------------------- | ---------------------------- |
| <mark style="color:blue;">不使用</mark>      | 不讀取也不寫入工作區（預設）               |
| <mark style="color:blue;">綁定工作區</mark>    | 固定在一個工作區工作，讀取與產出都在那裡，使用者不能更換 |
| <mark style="color:blue;">讓使用者自行掛載</mark> | 使用者可以在對話中自行選擇要掛上的檔案工作區       |

同一個 Agent 同時掛知識庫、又設定檔案工作區時：

* **網頁 Widget、LINE、API 串接等對話平台**：只用知識庫回答。
* <mark style="color:blue;">**內部對話**</mark>：可以同時查知識庫、讀寫工作區的檔案。

常見的搭配方式是「**知識庫負責問答依據，檔案庫保留工作原檔**」。若還需要讓 AI 產出或修改檔案，請依 [讓 AI 修改、整理檔案](https://docs.maiagent.ai/work/file-library/ai-edit.md) 的步驟操作；單純詢問或要求大綱，不代表一定會產生檔案。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-ead1f1f37504807cf19b7c758800e66a17fd15eb%2Fagent-file-workspace-prod.png?alt=media" alt="Agent 檔案工作區設定列出不使用、綁定工作區與讓使用者自行掛載三個選項"><figcaption><p>Agent 的檔案工作區可設為不使用、固定綁定或讓使用者自行掛載；原生提示也說明對外通路不讀寫檔案庫。</p></figcaption></figure>

{% hint style="info" %}

* 要綁定工作區，設定 Agent 的人需要有該工作區的編輯權限。
* 綁定工作區後，每位使用者在對話中能讀或寫這個工作區，仍依他自己的檔案庫權限而定：只有檢視權限的人，AI 只會幫他讀檔，不會改檔或把產出存進去。權限設定見 [開通與權限](https://docs.maiagent.ai/work/file-library.md#availability-and-permissions)。
  {% endhint %}

***

## 相關頁面 <a href="#related" id="related"></a>

* [知識庫](https://docs.maiagent.ai/build/knowledge-base.md)：知識庫是什麼、能放哪些內容
* [如何建立 FAQ 常見問題](https://docs.maiagent.ai/build/knowledge-base/faq.md)
* [檔案庫](https://docs.maiagent.ai/work/file-library.md)：空間、檔案工作區與權限
* [在 MaiGPT 使用工作區](https://docs.maiagent.ai/work/file-library/use-in-maigpt.md)
* [讓 AI 修改、整理檔案](https://docs.maiagent.ai/work/file-library/ai-edit.md)
* 技術人員手冊：[知識庫 vs 檔案庫：運作原理與選用依據](https://docs.maiagent.ai/tech/quickstart/knowledge-base-vs-file-library)：給 SI、售前與導入工程師的運作原理、權限、容量與計費差異


---

# 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/work/file-library/vs-knowledge-base.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.
