D
Doc and Tell
Glossary/ai/ml
ai/ml

Cosine Similarity

A metric that measures the angle between two vectors to determine how semantically similar two texts are.

Cosine similarity computes the cosine of the angle between two embedding vectors, producing a score between -1 and 1. A score near 1 means the texts are semantically similar; near 0 means unrelated. It is the standard distance metric for vector search.

Unlike Euclidean distance, cosine similarity is magnitude-invariant, meaning it focuses on direction rather than vector length. This makes it robust across embeddings of different text lengths and is why it is the default similarity function in most vector databases.

Analyze Documents Related to Cosine Similarity

Upload any document and get AI-powered analysis with verifiable citations.

Start Free