What is Similarity Score?
A similarity score measures how semantically similar two pieces of text are, calculated by comparing their vector embeddings. Scores typically range from 0 (unrelated) to 1 (identical meaning) using cosine similarity.
Why It Matters
In RAG systems, similarity scores determine which documents are "relevant enough" to include in the prompt. Setting the right threshold (e.g., 0.75) balances recall (finding relevant docs) vs precision (excluding noise).
Interpreting Scores
- • 0.90+ — Very similar, near-identical meaning
- • 0.80-0.90 — Highly relevant, same topic
- • 0.70-0.80 — Somewhat relevant, related concepts
- • 0.60-0.70 — Tangentially related
- • <0.60 — Likely unrelated
Note: Thresholds vary by embedding model and use case. Always calibrate with your data.
Common Distance Metrics
Cosine Similarity
Measures angle between vectors. Most common for text. Range: -1 to 1 (normalized to 0-1).
Euclidean Distance
Measures straight-line distance. Lower = more similar. Range: 0 to ∞.