AI & ML · Concept
Cosine Similarity
Cosine similarity compares embedding vectors by their direction. For OpenAI embeddings, a dot product can calculate it efficiently because the vectors have unit length.
Last updated
Syntax
cosine_similarity(a, b) = (a · b) / (||a|| ||b||)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Vector embeddingstext-embedding-3-smalltext-embedding-3-largeVector databaseSemantic text search