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

# MongoDB 的 VoyageAI 集成

> 使用 LangChain Python 通过 MongoDB 与 VoyageAI 集成。

与 MongoDB 的 VoyageAI 相关的所有功能

> [VoyageAI by MongoDB](https://www.voyageai.com/) 构建针对您的领域和公司的嵌入模型，以提升检索质量。

## 安装和设置

使用

```bash pip theme={null}
pip install langchain-voyageai
```

```bash uv theme={null}
uv add langchain-voyageai
```

安装集成包

获取 VoyageAI by MongoDB API 密钥并将其设置为环境变量（`VOYAGE_API_KEY`）

## 文本嵌入模型

查看 [使用示例](https://langchain-docs-zh.mintlify.site/langchain/oss/python/integrations/embeddings/voyageai.md)。

```python theme={null}
from langchain_voyageai import VoyageAIEmbeddings
```

## 重新排序

查看 [使用示例](https://langchain-docs-zh.mintlify.site/langchain/oss/python/integrations/document_transformers/voyageai-reranker.md)。

```python theme={null}
from langchain_voyageai import VoyageAIRerank
```

***

> 官方原文：[src/oss/python/integrations/providers/voyageai.mdx](https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/providers/voyageai.mdx) · 非官方翻译，译文由 AI 生成，以英文原文为准。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.