Vector Search
How computers retrieve the right information by measuring conceptual closeness instead of matching exact spelling.
Finding meaning even when zero words overlap.
Old search engines look for exact letter matches. Vector search looks for concept proximity in embedding space.
How queries turn into vectors
When you type a search question, an embedding model converts your sentence into a list of numbers. The search engine calculates the cosine angle between your query vector and millions of stored document vectors in fractions of a millisecond.
Dropping a pin and finding the closest neighbors.
Vector search acts like dropping a GPS pin on a map and scooping up the three closest landmarks.
What is top-k retrieval?
In production search, k represents the number of documents retrieved (typically \(k = 3\) or \(k = 5\)). The database ranks all candidates by distance and returns only the top-k highest-scoring snippets to pass into the model's context window.
Highway express lanes make searching instant.
Comparing your query against a billion documents takes too long. Algorithms like HNSW use express highways to zoom in rapidly.
What does HNSW stand for?
HNSW stands for Hierarchical Navigable Small World. It is an index graph inspired by the "six degrees of separation" rule. Instead of evaluating 10,000,000 items, the search hops across only 20 to 50 nodes to pinpoint the exact closest answer.
Combining vectors with keywords gives the best results.
Vector search understands broad ideas, but keyword search is unbeatable for exact serial numbers and proper names. Mixing both is called hybrid search.
What is Reciprocal Rank Fusion?
Reciprocal Rank Fusion (RRF) is an algorithm that combines rankings from both search methods. An item ranked highly by both keyword search and vector search automatically rises to the very top of the list.