# Similarity search

Concept · [Building with AI](https://ecosystem.samcarlton.com/ai)

Also called: nearest neighbor search, nearest neighbour search, k-nearest neighbors, kNN, ANN search, approximate nearest neighbor

Finding the stored items whose [vectors](https://ecosystem.samcarlton.com/vector) are closest to a query's vector, so results match by meaning rather than exact words. [Vector databases](https://ecosystem.samcarlton.com/vector-database) are built to do it quickly.

**For example:** A shopper searches 'something warm for winter', and similarity search returns coats and sweaters though neither word was typed.

## Connects to (7)

- [Vector database](https://ecosystem.samcarlton.com/vector-database): A database built to store embeddings and quickly find the items closest in meaning to a question, not just the ones that share its exact…
- [Cosine similarity](https://ecosystem.samcarlton.com/cosine-similarity): A common way to measure how alike two vectors are by the angle between them.
- [Embedding](https://ecosystem.samcarlton.com/embedding): A way of turning a piece of text into a list of numbers that captures its meaning, so software can tell which pieces of text are about…
- [Lexical search](https://ecosystem.samcarlton.com/lexical-search): Search that matches the exact words in a query.
- [Reranking](https://ecosystem.samcarlton.com/reranking): A second pass in search where a more careful model reorders the first batch of results by how well each actually answers the question.
- [Recommendation engine](https://ecosystem.samcarlton.com/recommendation-engine): Software that suggests items a person is likely to want, based on what they and similar people have done before.
- [Hybrid search](https://ecosystem.samcarlton.com/hybrid-search): Combining keyword search and similarity search, so results match both exact terms, such as product codes, and overall meaning.

Map view: https://ecosystem.samcarlton.com/similarity-search
