> 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/tech/quickstart/embedding.md).

# Embedding 模型

Embedding 模型在 RAG 中的角色、MaiAgent 雲端目前啟用的 Embedding 模型、地端部署的預設模型，以及自備 Embedding 服務的介面要求。

## 什麼是 Embedding？ <a href="#what-is-embedding" id="what-is-embedding"></a>

Embedding 模型把文字轉成一串數字（向量）。語意相近的文字，轉出來的向量也相近，所以系統可以用向量距離找出「意思相關」的段落，即使問題和文件的措辭不同。

在 MaiAgent 的 RAG 流程中，Embedding 模型做兩件事：

1. **建立索引**：把知識庫解析後的每個段落轉成向量，存進向量資料庫。
2. **轉換問題**：把使用者的問題轉成向量，和資料庫中的段落比對相似度。

<figure><img src="https://527168072-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F38pkhhqHl1oA6yyE9R2n%2Fuploads%2Fgit-blob-0ce05108866ecded0daa5a9fb3cd8b9137ffef26%2F2%20(1).png?alt=media" alt=""><figcaption><p>RAG 流程</p></figcaption></figure>

完整的檢索流程見 [RAG 知識庫檢索系統](/tech/quickstart/rag.md)。

## 選擇時要知道的事 <a href="#before-you-choose" id="before-you-choose"></a>

* **建立後無法在後台更改**：Embedding 模型在建立知識庫時選定。不同模型產生的向量無法互相比對，需要更換時請另建知識庫，或洽 MaiAgent 窗口。
* **圖片檔需要多模態模型**：要把圖片檔（例如 `.png`、`.jpg`）放進知識庫並建立索引，知識庫必須使用支援多模態的 Embedding 模型，否則該檔案會解析失敗。
* **Agent 可以混用**：同一個 Agent 可以掛使用不同 Embedding 模型的知識庫，平台會各自查詢後合併結果。

## MaiAgent 雲端啟用中的模型 <a href="#saas-models" id="saas-models"></a>

以下為 2026 年 10 月正式區的啟用清單，建立知識庫時可選的模型以後台顯示為準。

| 模型（後台名稱）                                 | 供應商                                         | 支援圖片檔 |
| ---------------------------------------- | ------------------------------------------- | ----- |
| OpenAI text-embedding-3                  | OpenAI（`text-embedding-3-large`）            | 否     |
| Cohere Embed V4.0                        | Cohere（`embed-v4.0`）                        | 是     |
| Cohere Embed Multilingual v3.0 (Bedrock) | AWS Bedrock（`cohere.embed-multilingual-v3`） | 否     |

## 地端部署 <a href="#on-premise" id="on-premise"></a>

地端與私有雲可以在本機部署 Embedding 模型（部署包的模型目錄提供 `jina-embeddings-v3`，需要 GPU），或接上既有的模型服務、雲端供應商。可用的模型與接法見 [地端模型服務接入](/tech/platform-development/onprem-model-services.md#local-model-catalog)；各雲端供應商是否支援 Embedding 見 [雲端模型推論 API 服務](/tech/platform-development/cloud-model-inference-api-service.md)。

### 自備 Embedding 服務的介面要求 <a href="#bring-your-own-service" id="bring-your-own-service"></a>

接上自行架設或第三方的 OpenAI 相容 Embedding 服務時，網址要包含 `/v1`，服務也必須接受 MaiAgent 送出的參數，否則知識庫檔案會全部解析失敗。完整規則見 [地端模型服務接入：自備 Embedding 與 Reranker 的限制](/tech/platform-development/onprem-model-services.md#embedding-reranker-limits)。

{% hint style="info" %}
Embedding 模型影響的是「找不找得到」。若某個問題常常找不到正確段落，可以先用後台的 [搜尋測試](https://docs.maiagent.ai/build/knowledge-base/test-search-result) 檢查結果，再評估調整 [Reranker](/tech/quickstart/reranker.md)、檢索片段數量，或改用其他 Embedding 模型重建知識庫。
{% endhint %}


---

# 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/tech/quickstart/embedding.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.
