Semantic search

Also: dense retrieval, vector search

Queries and documents are embedded into the same vector space and ranked by cosine similarity, usually through an approximate nearest-neighbor index. It handles synonyms and paraphrases well but is weak on exact rare tokens such as codes and IDs.

Cosine similarity is the cosine of the angle between two vectors

Example

The query "how do I fix a flat tire" retrieves "repairing a punctured bicycle wheel" even though the two share no words, because their embeddings point in nearly the same direction.

See it in the lesson: Vector Embeddings Fundamentals →

Related terms

More in Retrieval, RAG & Agents