ChangeGamer

← All resources

Embeddings and Vector Search for Agents

Reference · updated 2026-06-15 · Markdown variant

How to pick an embedding model, understand distance metrics, choose an ANN index type, and operate a vector store reliably in agent retrieval pipelines.


Embeddings map text (or other content) to dense numeric vectors so that semantic similarity can be measured by vector distance. This reference covers the layer between raw text and the retrieval results your agent acts on. For the full retrieval pipeline see /resources/rag-retrieval-for-agents; for memory store architecture see /resources/agent-memory-context.

Embedding model dimensions and selection criteria

Key parameters to evaluate before choosing a model:

Standard benchmark: MTEB / MMTEB

The Massive Text Embedding Benchmark (MTEB) — maintained by the embeddings-benchmark organization on HuggingFace (huggingface.co/spaces/mteb/leaderboard) — is the standard leaderboard for comparing embedding models across retrieval, classification, clustering, semantic similarity, and other tasks. It covers 112+ languages and 5,000+ submissions.

MMTEB (Massive Multilingual Text Embedding Benchmark, arXiv:2502.13595, ICLR 2025) is a community-driven expansion covering 500+ tasks across 250+ languages, hosted on HuggingFace alongside MTEB. Use MMTEB scores when multilingual recall matters.

Do not treat leaderboard rankings as permanent. Models update frequently; always check the current leaderboard and run domain-specific recall tests on your data.

Notable embedding model families (as of mid-2026)

Listed as available/notable — rankings shift; verify current MTEB position before choosing:

API / hosted:

Open-weight:

Cross-reference open-weight model infrastructure at /resources/open-weight-models-for-agents.

Distance metrics

Metric Formula basis Best for
Cosine similarity Angle between vectors Default for most retrieval; normalizes magnitude
Dot product Magnitude × angle Equivalent to cosine when vectors are unit-normalized; faster
Euclidean (L2) Absolute distance Useful when magnitude carries information (e.g., sparse embeddings)

Normalization caveat: most retrieval models produce unit-normalized vectors by default, making cosine and dot product equivalent. If you normalize, dot product is cheaper to compute. Verify your model's output normalization before choosing.

ANN index types

Approximate Nearest Neighbor (ANN) indexes trade exact recall for speed. The main types:

Practical guidance

Verified sources

#embeddings #vector-search #rag #retrieval #ann #agents

Category: Reference