711
Dictionary

Cosine Similarity

The dot-product-of-unit-vectors metric that ranks embeddings.

1 min readupdated 2026-07-04

/ quick answer

Cosine similarity measures the angle between two vectors. It ignores magnitude, focusing on direction — the standard metric for comparing sentence embeddings. The dot-product-of-unit-vectors metric that ranks embeddings.

The dot-product-of-unit-vectors metric that ranks embeddings. Cosine similarity measures the angle between two vectors. It ignores magnitude, focusing on direction — the standard metric for comparing sentence embeddings. In practice: Two paraphrases of the same sentence yield a cosine similarity of ~0.95.
Definition
Cosine similarity measures the angle between two vectors. It ignores magnitude, focusing on direction — the standard metric for comparing sentence embeddings.
Example
Two paraphrases of the same sentence yield a cosine similarity of ~0.95.
Related Tool Stacks

/ frequently asked

What is Cosine Similarity?

Cosine similarity measures the angle between two vectors. It ignores magnitude, focusing on direction — the standard metric for comparing sentence embeddings.

What is an example of Cosine Similarity?

Two paraphrases of the same sentence yield a cosine similarity of ~0.95.

Why does Cosine Similarity matter?

The dot-product-of-unit-vectors metric that ranks embeddings.

What should I learn after Cosine Similarity?

Open the related workflows and prompts further down this page: they show how this idea is applied in a real task, step by step.

/ continue exploring

Related concepts

The vocabulary this page depends on.

  • →Retrieval

    Selecting the most relevant chunks for a query before generation.

  • →RAG (Retrieval-Augmented Generation)

    Inject external knowledge into an LLM at query time.

  • →Agentic RAG

    RAG where an agent decides what to retrieve, when, and from which source — instead of a single static query.

  • →Embedding

    A numerical vector representation of text, image or audio that captures meaning for similarity search.

all dictionary →

Related workflows

Turn this into a repeatable process.

all workflows →

Related tool stacks

The tools that run it in production.

all tool stacks →

Comparisons & alternatives

Pick between the options.

all comparisons →