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

# Knowledge Base vs. File Library: Differences and When to Use Each

How knowledge bases and the file library differ, and where to put your data—a quick overview, use case comparison, common mistakes, a decision table, and ways to use both in the same Agent or conversa

**A knowledge base is a cheat sheet for an exam; the file library is the full textbook beside you when doing homework.**

Both can store documents, but AI uses them differently: a knowledge base helps an Agent **find answers quickly** to respond to users, while the file library lets AI **work with complete original files**. Putting data in the wrong place often leads to inaccurate answers, slower responses, or higher Credits usage. This page helps you decide where your data belongs.

***

## At a Glance <a href="#positioning" id="positioning"></a>

|                    | [Knowledge Base](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base.md) (RAG) | [File Library](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library.md)                             |
| ------------------ | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Analogy**        | A cheat sheet for an exam                                                                       | The full textbook beside you when doing homework                                                                 |
| **What it is**     | An Agent's “memory”: content is split into chunks and indexed in advance                        | A central place for your organization's files: original files are stored in file workspaces                      |
| **How AI uses it** | Retrieves the few chunks most relevant to the question, then answers based on them              | Reads complete files when needed before answering; can also edit, rename, and move files after your confirmation |
| **Goal**           | Answer users' questions as quickly and accurately as possible                                   | Help you write, consolidate, and revise content based on complete source material                                |

You cannot bring a whole stack of textbooks into an exam, so you prepare a cheat sheet. For homework, you need to open the textbook and consult it in full. Answering external users' questions is like taking an exam: you need a cheat sheet that gets you to the answer quickly. Writing internal documents is like doing homework: you need the complete original files.

***

## Use Case Comparison <a href="#use-cases" id="use-cases"></a>

|                              | Knowledge Base                                                                                                                                                                                                      | File Library                                                                                                                                                                                                      |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Typical scenarios**        | External customer support, FAQ responses, and queries about internal policies and SOPs                                                                                                                              | Writing, consolidating, and revising internal documents, such as drafting proposals, comparing multiple quotes, or updating FAQs to match new specifications                                                      |
| **What you need**            | Speed and accuracy                                                                                                                                                                                                  | Complete content that can be edited                                                                                                                                                                               |
| **Where it is used**         | Agents on any conversation platform (web Widget, LINE, API integrations, internal chat), and [Knowledge Base Q\&A](https://docs.maiagent.ai/maiagent-user-guide/en/work/maigpt/chat.md#knowledge-base-qa) in MaiGPT | MaiGPT ([attach a workspace](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/use-in-maigpt.md)), and <mark style="color:blue;">Internal Chat</mark> for Agents with a file workspace configured |
| **How to prepare data**      | Requires preparation: write [FAQs](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base/faq.md), clean the data, and remove outdated or duplicate content to ensure consistent answer quality       | Add the original files and organize workspaces by project or topic                                                                                                                                                |
| **Does the content change?** | Relatively stable; upload it again when updated                                                                                                                                                                     | Frequently edited; every change has a version that you can [restore](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/versions.md)                                                               |

{% hint style="warning" %}
Conversation platforms such as web Widget, LINE, and API integrations **never read from or write to the file library**. Only MaiGPT and an Agent's <mark style="color:blue;">Internal Chat</mark> use it. Put content that an external customer support Agent should answer from in a knowledge base.
{% endhint %}

***

## Common Mistakes <a href="#common-mistakes" id="common-mistakes"></a>

| Common practice                                                                                                                              | What happens                                                                                                                                                        | Recommendation                                                                                                                                                                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Putting product manuals in the file library and expecting an external customer support Agent to answer from them                             | Conversation platforms such as web Widget and LINE cannot access the file library, so the Agent cannot answer                                                       | Put them in a knowledge base and turn frequently asked questions into FAQs                                                                                                                                                                        |
| Using the file library to answer large volumes of repeated common questions                                                                  | Reading many complete documents can increase processing time and Credits usage; up to 5 files can be read at a time, with additional files read in batches          | Organize the questions into knowledge base FAQs for fast, consistent answers                                                                                                                                                                      |
| Dropping a large batch of unorganized original files into a knowledge base and asking an Agent to write a report or compare entire documents | Knowledge bases primarily retrieve relevant chunks; if the task requires comparing complete original files one by one, specify the documents and scope to reference | Put them in a file library workspace so AI can read each file in full before consolidating the content                                                                                                                                            |
| Putting a draft that is still being revised in a knowledge base                                                                              | Every change requires another upload and parsing wait, with no version history; outdated content may still be used in answers                                       | Keep drafts in the file library, then add the final version to the knowledge base when the Agent needs to use it for external responses                                                                                                           |
| Putting all documents in a knowledge base without organizing them                                                                            | Irrelevant or conflicting chunks are used as sources, making answers inaccurate                                                                                     | Include only cleaned content relevant to the Agent's task, and use [Search Testing](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base/test-search-result.md) before launch to confirm that the correct chunks can be retrieved |

***

## What Do I Want to Do → Where Should It Go? <a href="#decision-table" id="decision-table"></a>

| What I want to do                                                                                                            | Where to put it                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Have a customer support Agent on the official website or LINE answer questions about products, plans, returns, and exchanges | Knowledge Base                                                                                                                         |
| Have an Agent use standard answers for common questions                                                                      | Knowledge Base (FAQ)                                                                                                                   |
| Let colleagues look up company policies and SOPs in MaiGPT                                                                   | Knowledge Base                                                                                                                         |
| Ask AI to write a proposal based on specifications and customer requirements                                                 | File Library                                                                                                                           |
| Compare the full differences between several quotes or contracts                                                             | File Library                                                                                                                           |
| Ask AI to edit document content directly and keep a record of changes                                                        | File Library                                                                                                                           |
| Save documents and images that AI generates in a conversation                                                                | File Library (automatically saved to the <mark style="color:blue;">Temporary Area</mark> in <mark style="color:blue;">My Files</mark>) |
| Use the same data for external answers and internal revisions                                                                | Both: maintain original files in the file library, and put organized final versions or FAQs in a knowledge base                        |

Still unsure? Ask yourself: **Do I need to “find an answer” or “work with an entire file”?** Use a knowledge base to find answers and the file library to work with files.

***

## Can I Use Both in the Same Agent or Conversation? <a href="#use-together" id="use-together"></a>

Yes. The two do not conflict. AI decides whether to retrieve knowledge base chunks or read workspace files based on the question.

### Using Both in a MaiGPT Conversation <a href="#together-in-maigpt" id="together-in-maigpt"></a>

In the same MaiGPT conversation, you can [attach a workspace](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/use-in-maigpt.md#start-chat) and use <mark style="color:blue;">Select Knowledge Base</mark> to specify which knowledge base to query.

For example, a customer support training manager wants to consult both original workspace files and a knowledge base. In a workspace containing sample warranty FAQs, she clicks <mark style="color:blue;">Start a Conversation Here</mark>, selects the sample library knowledge base, and asks, “How long are the main unit and motor warranties in the workspace documents? What are the borrowing periods for undergraduate and graduate students in the knowledge base?” MaiGPT cites both the original workspace files and the knowledge base in a single response, helping her check the two data sources.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-865b65ea7c63f20df5411d1e3d0c033cc60d9650%2Fkb-file-library-prod-answer.png?alt=media" alt="A single response lists warranty information from workspace documents and borrowing periods from the selected knowledge base"><figcaption><p>The same MaiGPT conversation cites original workspace files and the selected knowledge base to answer questions; all content shown is fictional sample data.</p></figcaption></figure>

### Using Both in Agent Settings <a href="#together-in-agent" id="together-in-agent"></a>

Once the file library is enabled for your organization, <mark style="color:blue;">File Workspace</mark> appears in the <mark style="color:blue;">Knowledge and Data</mark> group on the left side of Agent settings. You can configure it alongside <mark style="color:blue;">Knowledge Base Settings</mark>. The file workspace determines how this Agent uses the file library in <mark style="color:blue;">Internal Chat</mark>:

| Option                                                      | Description                                                                                     |
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| <mark style="color:blue;">Do Not Use</mark>                 | Does not read from or write to workspaces (default)                                             |
| <mark style="color:blue;">Bind Workspace</mark>             | Always works in one workspace, reading and saving outputs there; users cannot switch workspaces |
| <mark style="color:blue;">Let Users Attach Their Own</mark> | Users can choose which file workspace to attach in the conversation                             |

When the same Agent has both a knowledge base and a file workspace configured:

* **Conversation platforms such as web Widget, LINE, and API integrations**: use only the knowledge base to answer.
* <mark style="color:blue;">**Internal Chat**</mark>: can query the knowledge base and read and write workspace files.

A common setup is: “**Use the knowledge base as the source for Q\&A, and keep original working files in the file library**.” If you also need AI to generate or edit files, follow the steps in [Let AI Edit and Organize Files](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/ai-edit.md). Simply asking a question or requesting an outline does not necessarily generate a file.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-ead1f1f37504807cf19b7c758800e66a17fd15eb%2Fagent-file-workspace-prod.png?alt=media" alt="Agent file workspace settings show three options: Do Not Use, Bind Workspace, and Let Users Attach Their Own"><figcaption><p>An Agent's file workspace can be disabled, bound to a fixed workspace, or left for users to attach. The built-in guidance also explains that external channels do not read from or write to the file library.</p></figcaption></figure>

{% hint style="info" %}

* To bind a workspace, the person configuring the Agent needs edit permission for that workspace.
* After a workspace is bound, each user's ability to read from or write to it in a conversation still depends on their own file library permissions: for users with view-only permission, AI only reads files; it does not edit files or save outputs there. For permission settings, see [Availability and Permissions](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library.md#availability-and-permissions).
  {% endhint %}

***

## Related Pages <a href="#related" id="related"></a>

* [Knowledge Base](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base.md): what a knowledge base is and what content it can contain
* [How to Create FAQs](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base/faq.md)
* [File Library](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library.md): storage, file workspaces, and permissions
* [Using Workspaces in MaiGPT](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/use-in-maigpt.md)
* [Let AI Edit and Organize Files](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/ai-edit.md)
* Technical Guide: [Knowledge Base vs. File Library: How They Work and How to Choose](https://docs.maiagent.ai/tech/quickstart/knowledge-base-vs-file-library): how they work, permissions, capacity, and billing differences for SI, presales, and implementation engineers


---

# 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/maiagent-user-guide/en/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.
