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

# Embedding モデル

## Embedding とは？

RAG (Retrieval-Augmented Generation) の処理過程において、**Embedding** の中核的な役割は、Parser によって処理された大量のテキストデータ（ドキュメントやナレッジベースの内容など）を、コンピューターが理解し比較できる数値形式、すなわちベクトル（vectors）へと変換することです。

この変換処理により、RAG システムは次のことが可能になります。

### 1. **意味の理解**

Embedding モデルは、表層的な語彙だけでなく、テキストの深い意味的な内容を捉えます。これにより、クエリとドキュメントで使われている表現が異なっていても、意味が近ければシステムはそれらの関連性を認識できます。

### 2. **効率的な検索**

テキストをベクトルに変換した後、システムは効率的なベクトル類似度検索アルゴリズムを活用し、膨大なデータベースの中からユーザーのクエリに最も関連性の高いテキスト断片を素早く見つけ出すことができます。

### 3. **生成品質の向上**

検索された関連テキスト断片は、大規模言語モデル（LLM）にコンテキストの参照情報として提供され、LLM がより正確な回答を生成するのに役立ちます。

## Embedding は MaiAgent の RAG 技術において 2 つの重要な役割を果たします

### 1. **ナレッジベースのデータ内容をベクトルに変換し**、ベクトルデータベースに保存する

### 2. **ユーザーの質問をベクトル化し**、データベース内のベクトルと類似度を比較して、最も関連性の高い内容を見つけ出す

<figure><img src="/files/ZMVu3I8vS44MG30jJPta" alt=""><figcaption><p>RAG フロー</p></figcaption></figure>

簡単に言えば、Embedding は RAG システムの基盤であり、非構造化のテキストデータを計算可能・比較可能なベクトルへと変換します。これは、精密な情報検索と高品質なコンテンツ生成を実現するための重要な前処理ステップです。

## Embedding が RAG システムに与える影響

### 1. 検索品質

* **意味理解の深さ**：高品質な Embedding モデルは、テキストの意味的な内容をより正確に捉え、検索の関連性を高めます
* **コンテキスト認識**：優れた Embedding は、テキストのコンテキスト関係を理解し、検索結果の一貫性を確保します
* **多言語対応**：強力な多言語 Embedding モデルは、言語をまたいだナレッジ検索のニーズに対応できます

### 2. システム性能

* **検索速度**：Embedding モデルのベクトル次元数と計算効率は、検索の応答時間に直接影響します
* **リソース消費**：Embedding モデルによって必要とする計算リソースが異なり、システムの拡張性に影響します
* **並列処理**：効率的な Embedding モデルは、大規模な並列検索をサポートできます

## MaiAgent が対応している Embedding モデル

| モデル名                                     | 開発元           | 産地   | 特性                                                                     | オープンソース | デプロイ方式                            | MTEB 平均スコア           |
| ---------------------------------------- | ------------- | ---- | ---------------------------------------------------------------------- | ------- | --------------------------------- | -------------------- |
| Cohere Embed v4.0                        | Cohere        | カナダ  | 多言語対応、最高性能                                                             | 否       | クラウド API 推論サービスが必要                | 未公開、v3.0 の 64.47 を参考 |
| Cohere Embed Multilingual v3.0 (Bedrock) | Cohere        | カナダ  | 多言語対応、高性能                                                              | 否       | クラウド API 推論サービスが必要                | 64.47                |
| OpenAI text-embedding-3-Large            | OpenAI        | アメリカ | 多言語対応（特に英語の文脈で強力）、中程度の性能                                               | 否       | クラウド API 推論サービスが必要                | 64.68                |
| EmbeddingGemma                           | Google        | アメリカ | <mark style="color:red;">オープンソース</mark>、多言語対応、軽量                       | 是       | ニーズに応じてクラウドまたはオンプレミスの GPU にデプロイ可能 | 61.15                |
| Mxbai-embed-large                        | Mixedbread AI | アメリカ | <mark style="color:red;">オープンソース</mark>、性能とリソースのバランス良好、長いコンテキストでの性能が高い | 是       | ニーズに応じてクラウドまたはオンプレミスの GPU にデプロイ可能 | 64.68                |
| BGE-Large                                | BAAI          | 中国   | <mark style="color:red;">オープンソース</mark>、多言語対応、軽量                       | 是       | ニーズに応じてクラウドまたはオンプレミスの GPU にデプロイ可能 | 64.23                |
| Nomic-embed-text                         | Nomic AI      | アメリカ | <mark style="color:red;">オープンソース</mark>、軽量                             | 是       | ニーズに応じてクラウドまたはオンプレミスの GPU にデプロイ可能 | 62.39                |
| Qwen3-Embedding 0.6B                     | Alibaba       | 中国   | <mark style="color:red;">オープンソース</mark>、軽量                             | 是       | ニーズに応じてクラウドまたはオンプレミスの GPU にデプロイ可能 | 61.82                |
| Granite-embedding-278m-multilingual      | IBM           | アメリカ | <mark style="color:red;">オープンソース</mark>、多言語対応、軽量                       | 是       | ニーズに応じてクラウドまたはオンプレミスの GPU にデプロイ可能 | 56.1                 |

{% hint style="info" %}
意味表現の精度と検索精度を確保するため、MaiAgent が提供する Embedding モデルは MTEB（Massive Text Embedding Benchmark）基準に基づいて選定・評価されます。MTEB は現在主流となっている意味ベクトル化モデルの比較基準であり、以下を含むさまざまなタスクタイプを網羅しています。

* Retrieval（意味検索）
* Classification（分類）
* Clustering（クラスタリング）
* Reranking（再ランク付け）
* STS（Semantic Textual Similarity 意味的類似度）
* Summarization / QA / Pair Classification など
  {% endhint %}

## MaiAgent の Embedding 技術の強み

### 1. モデル選択の柔軟性：

複数の Embedding モデルから選択でき、さまざまなニーズに対応します

### 2. 多様なデプロイ方式：

クラウドおよびオンプレミスのデプロイに対応し、データの安全性を確保します

### 3. 性能の最適化：

RAG のシナリオに特化した最適化を行い、最適な検索効果を提供します

### 4. コスト効率：

実際のニーズに応じて適切なモデルを選択し、性能とコストのバランスを取ります


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/tech/maiagent-tech-ja/quickstart/embedding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
