Data & Retrieval

Cosine Similarity

How aligned two vectors are, ignoring their length — 1 identical, 0 unrelated, −1 opposite.

Cosine similarity is the dot product of two vectors divided by their magnitudes. Because it ignores length and measures only direction, it’s the standard score for comparing embeddings in search and RAG.