RetrievalFoundations Updated 2026

Cosine Similarity

Definition

A measure of how similar two vectors are by the angle between them — the standard way to compare embeddings in search and RAG.

Cosine similarity scores two vectors by the cosine of the angle between them, ranging from −1 (opposite) to 1 (identical direction). Because it ignores magnitude and looks only at direction, it is the standard metric for comparing text embeddings, as set out in Manning, Raghavan & Schütze's standard information-retrieval text (2008).

When a vector database finds the passages "closest" to a query, cosine similarity is usually the closeness being measured.

References

Primary, peer-reviewed and archival sources for this definition.

Introduction to Information Retrieval (Ch. 6: Scoring, term weighting & the vector space model)
Manning, C. D., Raghavan, P., & Schütze, H. (2008). Cambridge University Press.

Dictionary & encyclopedic entries

Cite this entry

MultipleChat. "Cosine Similarity." MultipleChat AI & LLM Glossary, 2026. https://multiple.chat/ai-glossary/cosine-similarity

Related terms

See this in practice

Run the same prompt across ChatGPT, Claude, Gemini, Grok and Perplexity side by side — with your own files as context and answers you can cross-check.

Try MultipleChat Free

Continue learning

See paid plans