Skip to content

Glossary: RAG Basics

Cosine similarity

Also written: dot product

A score for how close two embedding vectors are in meaning: 1 for the same meaning, near 0 for unrelated. For normalized vectors it equals the dot product, which is why a single matrix multiplication can score every chunk.

Where the book teaches it

Related terms

EmbeddingVector searchNormalized vectors