Similarity is an angle, not a distance
Retrieval ranks passages by cosine similarity between the query vector and each document vector. Written out, that is the dot product normalised by both magnitudes:
Layer 4 · Foundations
The geometry of similarity, why ANN search is approximate, HNSW's structure, and the recall-latency-memory triangle.
Retrieval ranks passages by cosine similarity between the query vector and each document vector. Written out, that is the dot product normalised by both magnitudes: