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

# Cohere Embedder

> Generate Cohere embeddings with an explicit model, input type, and vector dimension.

`CohereEmbedder` defaults to `embed-english-v3.0` and reads `CO_API_KEY` through the Cohere client.

```python cohere_embedder.py theme={null}
from agno.knowledge.embedder.cohere import CohereEmbedder

document_embedder = CohereEmbedder(
    id="embed-english-v3.0",
    dimensions=1024,
    input_type="search_document",
)
query_embedder = CohereEmbedder(
    id="embed-english-v3.0",
    dimensions=1024,
    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(f"Document dimensions: {len(document_vector)}")
print(f"Query dimensions: {len(query_vector)}")
```

<Warning>
  `CohereEmbedder` currently 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`.
</Warning>

Set `dimensions=1024` with `embed-english-v3.0` so the vector database schema matches the returned vectors. This field configures Agno's expected vector width. It does not change the model's fixed 1024-dimensional output.

## Run the Example

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

  <Step title="Export the API key">
    ```bash theme={null}
    export CO_API_KEY=your_cohere_api_key_here
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno cohere
    ```
  </Step>

  <Step title="Run the example">
    ```bash theme={null}
    python cohere_embedder.py
    ```
  </Step>
</Steps>

## Developer Resources

* [CohereEmbedder reference](/reference/knowledge/embedder/cohere)
* [Embedders overview](/knowledge/concepts/embedder/overview)
* [Cohere Embed models](https://docs.cohere.com/docs/cohere-embed)
* [Cohere semantic search](https://docs.cohere.com/docs/sem-search-quickstart)
