Similarity search is a method for finding the items most like a given one by comparing their numeric fingerprints rather than their raw content. Whether the items are products, photos or paragraphs, each is turned into a vector, and the search returns whichever vectors sit closest to your query. It is the quiet engine behind ‘related items’, duplicate detection and the retrieval step in most AI assistants.

Here is a everyday example. Streaming services suggest a film ‘because you watched’ another one. They don’t compare plots word for word; they represent each title as a set of numbers and look for the nearest neighbours in that space. Similarity search does the same with anything you can turn into embeddings, and the comparison often uses cosine similarity to score how aligned two vectors are.

At scale you cannot check every item one by one, so the vectors live in a vector database with an index that finds close matches fast. The trade-off is a tiny bit of accuracy for a huge speed gain, well worth it when you are searching millions of records in real time. This approximate matching is what “nearest neighbour” refers to: the index returns the items that are almost certainly closest, not a guaranteed exact ranking.

There is a quiet pitfall to watch for. Similarity search only knows what the embeddings encode, so a model trained mostly on English will rank Dutch text poorly. The results are only as good as the model that produced the vectors, which is why the choice of embedding model matters as much as the search itself.

A good rule of thumb: use similarity search when “close enough” is the goal, like recommendations or related tickets. For exact lookups, an email or an order number, a plain database query is faster and more reliable.

At TopDevs we use similarity search to power recommendations, smart search and deduplication in client systems, so users surface the right thing without typing the exact right words.