# Cosine similarity

Concept · [Building with AI](https://ecosystem.samcarlton.com/ai)

Also called: cosine distance, cosine, vector similarity, dot product

A common way to measure how alike two [vectors](https://ecosystem.samcarlton.com/vector) are by the angle between them. A score near 1 means very similar meaning, near 0 means unrelated.

**For example:** 'Refund policy' and 'how to get my money back' score close to 1. 'Refund policy' and 'giraffe' score much lower.

## Connects to (5)

- [Similarity search](https://ecosystem.samcarlton.com/similarity-search): Finding the stored items whose vectors are closest to a query's vector, so results match by meaning rather than exact words.
- [Vector](https://ecosystem.samcarlton.com/vector): An ordered list of numbers.
- [Embedding](https://ecosystem.samcarlton.com/embedding): A way of turning a piece of text into a list of numbers that captures its meaning, so software can tell which pieces of text are about…
- [Dimension](https://ecosystem.samcarlton.com/dimension): One number position in a vector, like one axis on a map.
- [Vector database](https://ecosystem.samcarlton.com/vector-database): A database built to store embeddings and quickly find the items closest in meaning to a question, not just the ones that share its exact…

Map view: https://ecosystem.samcarlton.com/cosine-similarity
