MistralEmbedder uses mistral-embed by default. The model returns 1024-dimensional vectors.
mistral_embedder.py
Run the Example
1
Set up your virtual environment
2
Export the API key
3
Install dependencies
4
Run the example
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Generate 1024-dimensional embeddings with MistralEmbedder and mistral-embed.
MistralEmbedder uses mistral-embed by default. The model returns 1024-dimensional vectors.
from agno.knowledge.embedder.mistral import MistralEmbedder
embedder = MistralEmbedder()
embedding = embedder.get_embedding("The quick brown fox jumps over the lazy dog.")
print(embedding[:5])
print(len(embedding))
endpoint and max_retries use parameter names rejected by the current mistralai client. Pass a preconfigured client through mistral_client when you need either setting.Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Export the API key
export MISTRAL_API_KEY=your_mistral_api_key_here
Install dependencies
uv pip install -U agno mistralai
Run the example
python mistral_embedder.py
Was this page helpful?