EmbeddingAgent.
EmbeddingAgent converts text into numerical vectors for semantic search, similarity matching, and RAG applications.
How It Works
Quick Start
1
Install
2
Create Agent
3
Generate Embedding
Methods
embed()
embed()
embed_batch()
embed_batch()
similarity()
similarity()
Configuration
- Basic
- With Config
- Dict Config
EmbeddingConfig Parameters
Supported Models
OpenAI
text-embedding-3-small(default)text-embedding-3-largetext-embedding-ada-002
Cohere
cohere/embed-english-v3.0cohere/embed-multilingual-v3.0
Voyage
voyage/voyage-3voyage/voyage-3-lite
Mistral
mistral/mistral-embed
Examples
Semantic Search
Document Similarity Matrix
RAG Retrieval
Async Usage
Use Cases
Semantic Search
Find documents by meaning, not keywords
RAG
Retrieve relevant context for LLM prompts
Clustering
Group similar documents together
Deduplication
Find and remove duplicate content
Best Practices
Batch embeddings for throughput
Batch embeddings for throughput
Use the batch method over a loop of single
embed() calls. One batched request is far cheaper and faster than many round trips for large corpora.Keep the model consistent across a corpus
Keep the model consistent across a corpus
Vectors from different models aren’t comparable. Embed queries and documents with the same model, or similarity scores become meaningless.
Normalise before cosine similarity
Normalise before cosine similarity
Normalise vectors when your similarity metric assumes unit length. Skipping this skews rankings, especially across texts of very different lengths.
Pair with a vector store for RAG
Pair with a vector store for RAG
The agent produces vectors; a vector database stores and searches them. Combine the two to build retrieval-augmented generation pipelines.
Related
Rewrite queries for better retrieval in RAG pipelines.
Synthesise multiple sources into a report.

