Cosine Similaritymath
A measure of similarity between two vectors defined as their dot product divided by the product of their magnitudes — equivalently, the cosine of the angle between them.
Cosine similarity is the workhorse of embedding-based retrieval and clustering; it is insensitive to vector length, so it captures direction (semantics) over magnitude.
Where it appears
- SKCE foundation for embeddings/vector-search
- Upstream similarity matrix pass
Descend
Prerequisites
Dependencies
- —
Foundations
Historical evolution
Standard since latent semantic analysis (1990s); the default embedding distance.
Implementation details
sim(a,b) = (a.b)/(|a||b|); upstream keeps top-10 most similar per vector for clustering.
Sources
- [2026-07-11-knowledge-compiler-compiling-human-knowledge-into-static-semantic-artifacts] 2026-07-11-knowledge-compiler-compiling-human-knowledge-into-static-semantic-artifacts
- [2026-07-11-knowledge-compiler-compiling-human-knowledge-into-static-semantic-artifacts] 2026-07-11-knowledge-compiler-compiling-human-knowledge-into-static-semantic-artifacts