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

# AWS Bedrock Embedder

> Generate Cohere Embed v3 or v4 embeddings through AWS Bedrock.

`AwsBedrockEmbedder` defaults to `cohere.embed-multilingual-v3` with 1024 dimensions. Set `input_type` for the text being embedded.

```python aws_bedrock_embedder.py theme={null}
from agno.knowledge.embedder.aws_bedrock import AwsBedrockEmbedder

document_embedder = AwsBedrockEmbedder(input_type="search_document")
query_embedder = AwsBedrockEmbedder(input_type="search_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]
>
> `AwsBedrockEmbedder` applies one configured `input_type` to every call. A single instance used by a vector database therefore applies the same input type to document insertion and query search. Cohere retrieval models distinguish `search_document` from `search_query`.

For Cohere Embed v4, set `id="cohere.embed-v4:0"`. The embedder changes its default vector dimension to 1536. Set `output_dimension` to use 256, 512, 1024, or 1536 dimensions.

## Run the Example

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

**1. Configure AWS credentials**

Authenticate with the AWS SDK credential chain, then set the region:

```bash theme={null}
export AWS_REGION=us-east-1
```

**2. Install dependencies**

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

**3. Run the example**

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

## Developer Resources

* [Cohere Embed v4 on Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-embed-v4.html)
* [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.