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

# Embedding Model

## What Is Embedding?

In the RAG (Retrieval-Augmented Generation) process, the core task of **Embedding** is to convert large volumes of text processed by the Parser, such as documents and knowledge base content, into numerical representations that computers can understand and compare—namely, vectors.

This conversion enables a RAG system to:

### 1. **Understand Semantics**

Embedding models capture the deeper semantic meaning of text rather than just surface-level words. This means that even if a query and a document use different wording, the system can recognize their relationship as long as their meanings are similar.

### 2. **Retrieve Efficiently**

After converting text into vectors, the system can use efficient vector similarity search algorithms to quickly find the text passages most relevant to a user's query in a large database.

### 3. **Improve Generation Quality**

The retrieved text passages are provided to a large language model (LLM) as context, helping the LLM generate more accurate answers.

## Embedding Plays Two Key Roles in MaiAgent's RAG Technology

### 1. **Converts knowledge base content into vectors** and stores them in a vector database

### 2. **Vectorizes user questions**, compares them with vectors in the database, and identifies the most relevant content

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

Simply put, Embedding is the foundation of a RAG system. It converts unstructured text into computable and comparable vectors, making it a critical prerequisite for accurate information retrieval and high-quality content generation.

## How Embedding Affects RAG Systems

### 1. Retrieval Quality

* **Depth of semantic understanding**: High-quality Embedding models capture the semantic meaning of text more accurately, improving retrieval relevance
* **Context awareness**: Strong Embedding models understand contextual relationships within text, ensuring coherent retrieval results
* **Multilingual support**: Powerful multilingual Embedding models can handle cross-language knowledge retrieval requirements

### 2. System Performance

* **Retrieval speed**: The vector dimensions and computational efficiency of an Embedding model directly affect retrieval response time
* **Resource consumption**: Different Embedding models have different computing resource requirements, affecting system scalability
* **Parallel processing**: Efficient Embedding models support large-scale parallel retrieval

## Embedding Models Supported by MaiAgent

| Model                                    | Developer     | Country of Origin | Characteristics                                                                                                                   | Open Source | Deployment Method                                                           | Average MTEB Score                                                |
| ---------------------------------------- | ------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Cohere Embed v4.0                        | Cohere        | Canada            | Multilingual support and highest performance                                                                                      | No          | Requires a cloud API inference service                                      | Not yet published; v3.0 score of 64.47 can be used as a reference |
| Cohere Embed Multilingual v3.0 (Bedrock) | Cohere        | Canada            | Multilingual support and high performance                                                                                         | No          | Requires a cloud API inference service                                      | 64.47                                                             |
| OpenAI text-embedding-3-Large            | OpenAI        | United States     | Multilingual (particularly strong in English contexts) and moderate performance                                                   | No          | Requires a cloud API inference service                                      | 64.68                                                             |
| EmbeddingGemma                           | Google        | United States     | <mark style="color:red;">Open source</mark>, multilingual support, lightweight                                                    | Yes         | Can be deployed in the cloud or on an on-premises GPU based on requirements | 61.15                                                             |
| Mxbai-embed-large                        | Mixedbread AI | United States     | <mark style="color:red;">Open source</mark>, excellent balance between performance and resources; strong long-context performance | Yes         | Can be deployed in the cloud or on an on-premises GPU based on requirements | 64.68                                                             |
| BGE-Large                                | BAAI          | China             | <mark style="color:red;">Open source</mark>, multilingual support, lightweight                                                    | Yes         | Can be deployed in the cloud or on an on-premises GPU based on requirements | 64.23                                                             |
| Nomic-embed-text                         | Nomic AI      | United States     | <mark style="color:red;">Open source</mark>, lightweight                                                                          | Yes         | Can be deployed in the cloud or on an on-premises GPU based on requirements | 62.39                                                             |
| Qwen3-Embedding 0.6B                     | Alibaba       | China             | <mark style="color:red;">Open source</mark>, lightweight                                                                          | Yes         | Can be deployed in the cloud or on an on-premises GPU based on requirements | 61.82                                                             |
| Granite-embedding-278m-multilingual      | IBM           | United States     | <mark style="color:red;">Open source</mark>, multilingual, lightweight                                                            | Yes         | Can be deployed in the cloud or on an on-premises GPU based on requirements | 56.1                                                              |

{% hint style="info" %}
To ensure accurate semantic representations and retrieval, MaiAgent selects and evaluates its Embedding models according to the MTEB (Massive Text Embedding Benchmark) standard. MTEB is a leading benchmark for comparing semantic vectorization models and covers a variety of task types, including:

* Retrieval (semantic retrieval)
* Classification
* Clustering
* Reranking
* STS (Semantic Textual Similarity)
* Summarization / QA / Pair Classification, and more
  {% endhint %}

## Advantages of MaiAgent's Embedding Technology

### 1. Flexible Model Selection:

Provides multiple Embedding model options to meet different requirements

### 2. Multiple Deployment Options:

Supports cloud and on-premises deployment to ensure data security

### 3. Performance Optimization:

Specially optimized for RAG scenarios to deliver the best retrieval results

### 4. Cost-Effectiveness:

Selects the appropriate model based on actual requirements to balance performance and cost


---

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