> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Qdrant FastEmbed 嵌入器

`FastEmbedEmbedder` 类用于通过 [FastEmbed](https://qdrant.github.io/fastembed/) 将文本数据嵌入为向量。

## 用法

```python cookbook/embedders/qdrant_fastembed.py theme={null}
from agno.agent import AgentKnowledge
from agno.vectordb.pgvector import PgVector
from agno.embedder.fastembed import FastEmbedEmbedder

# 将句子嵌入数据库
embeddings = FastEmbedEmbedder().get_embedding("The quick brown fox jumps over the lazy dog.")

# 打印嵌入和它们的维度
print(f"Embeddings: {embeddings[:5]}")
print(f"Dimensions: {len(embeddings)}")

# 在知识库中使用嵌入器
knowledge_base = AgentKnowledge(
    vector_db=PgVector(
        db_url="postgresql+psycopg://ai:ai@localhost:5532/ai",
        table_name="qdrant_embeddings",
        embedder=FastEmbedEmbedder(),
    ),
    num_documents=2,
)
```

## 参数

| 参数           | 类型    | 默认                       | 描述                          |
| ------------ | ----- | ------------------------ | --------------------------- |
| `dimensions` | `int` | -                        | 生成的嵌入的维度                    |
| `model`      | `str` | `BAAI/bge-small-en-v1.5` | 要使用的 qdrant\_fastembed 模型名称 |

## 开发者资源

* 查看 [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/agent_concepts/knowledge/embedders/qdrant_fastembed.py)
