Cosine distance compares the orientation of two vectors. In semantic search, it estimates how relevant an embedded query is to embedded text by measuring their distance in embedding space. section 7.2.2
Applied in embedding-based retrieval:
- Embed the user query with the same embedding model used for the text chunks. section 7.2.2
- Retrieve the top-k text embeddings with the closest similarity; tune k because overly broad or narrow retrieval can hurt results. section 7.2.2
- Treat the score as an approximation of relevance, not a guarantee: embeddings can lose information from the original text. section 7.2.2
Semantic search
A retrieval system embeds a user query, compares it with stored text embeddings using cosine distance, and returns the most similar documents. A Weaviate search may still return irrelevant results, requiring evaluation and tuning. section 7.2.2
Figure 7.6 The process of semantic search
Trace how query embedding, similarity comparison, and top-k retrieval form a semantic-search pipeline. section 7.2.2





