Track · 2:30 · Liner note

The Cosine Between Friends

Cosine similarity compares two vectors by the angle between them, scoring from minus one to one, and vector search uses it to rank which stored items are closest in meaning to a query.

Two vectors point in nearly the same direction, and the angle between them is small. Cosine similarity turns that angle into a score from minus one to one, and vector search uses it to rank which stored items sit closest to your query. The Cosine Between Friends is the gentle version: how alike two things are depends on the direction they face, not how large either is.

Mind the details. Many embedding models output normalized vectors, in which case cosine and dot product agree, and approximate indexes trade a little recall for a lot of speed. Check that the top results are what a person would call similar.