Mistral Embedder
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))In the current adapter, 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.
Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateExport the API key
export MISTRAL_API_KEY=your_mistral_api_key_hereInstall dependencies
uv pip install -U agno mistralaiRun the example
python mistral_embedder.py