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

# VoyageAI Embedder

> Generate VoyageAI retrieval embeddings with explicit document and query input types.

`VoyageAIEmbedder` defaults to `voyage-2` with 1024 dimensions.

```python voyageai_embedder.py theme={null}
from agno.knowledge.embedder.voyageai import VoyageAIEmbedder

document_embedder = VoyageAIEmbedder(
    request_params={"input_type": "document"},
)
query_embedder = VoyageAIEmbedder(
    request_params={"input_type": "query"},
)

document_vector = document_embedder.get_embedding(
    "The quick brown fox jumps over the lazy dog."
)
query_vector = query_embedder.get_embedding("Which animal jumps?")

print(len(document_vector), len(query_vector))
```

> [!WARNING]
>
> `VoyageAIEmbedder` applies one `request_params` dictionary to every call. A single instance used by a vector database therefore applies the same `input_type` to document insertion and query search. VoyageAI retrieval models distinguish `document` from `query` inputs.

For a nondefault vector size, set `dimensions` and `request_params={"output_dimension": ...}` to the same value.

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Export the API key**

```bash theme={null}
export VOYAGE_API_KEY=your_voyage_api_key_here
```

**2. Install dependencies**

```bash theme={null}
uv pip install -U agno voyageai
```

**3. Run the example**

```bash theme={null}
python voyageai_embedder.py
```

## Developer Resources

* [VoyageAIEmbedder reference](https://agno-v2.mintlify.site/reference/knowledge/embedder/voyageai.md)
* [VoyageAI text embeddings](https://docs.voyageai.com/docs/embeddings)
* [Embedders overview](https://agno-v2.mintlify.site/knowledge/concepts/embedder/overview.md)


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