Euclidean distance
The straight-line distance between two vectors, the square root of the summed squared differences.
In more detail
Smaller means more similar. For unit-length vectors it ranks results in the same order as cosine similarity and the dot product; pgvector writes it as <-> and Chroma's default space is its square.
Related terms
- cosine similarity — A similarity score between two vectors from the angle between them, from 1 for the same direction to -1 for opposite, ignoring their lengths.
- dot product — The sum of the products of two vectors' matching values, a similarity score that grows with both alignment and length.
Taught in
- What An Embedding Is — AI Engineering: LLM Apps, RAG & Agents