semantic search
Semantic search is a retrieval technique that finds documents by what a query means rather than by the exact words it contains. A search for “reset my password” can surface a passage titled “recovering account access” even though the two share no keywords.
The technique encodes every document in a corpus as an embedding, using a model that places text with similar meaning close together in a shared vector space. At query time, the same model encodes the query, and the system ranks documents by a similarity measure such as cosine similarity.
The widget below runs sample queries against a set of help-center articles and toggles between matching by meaning and matching by keywords, showing which articles each approach returns:
Comparing a query against every stored vector gets slow on large collections. Production systems store the vectors in a vector database and run an approximate nearest-neighbor search, which may miss a few of the true closest matches in exchange for much lower latency. Long documents are usually split into chunks first, so each vector stands for a passage rather than a whole file.
The setup depends on the shape of the task. Symmetric search matches items of similar length, such as duplicate questions in a forum. Asymmetric search matches a short query against longer passages, and it works best with a model trained on that pairing.
Semantic search is the usual retrieval stage in retrieval-augmented generation (RAG) pipelines. Its weak spot is exact matching. Product codes, error strings, and rare identifiers tend to blur together in embedding space, so many systems pair it with keyword scoring in a hybrid search setup and send the top candidates to a reranker.
Related Resources
Tutorial
ChromaDB: Embeddings and Vector Databases in Python
Learn what embeddings and vector databases are, then store, query, and filter text with ChromaDB in Python and use it to give an LLM context.
For additional information on related topics, take a look at the following resources:
- Vector Databases and Embeddings With ChromaDB (Course)
- Build an LLM RAG Chatbot With LangChain (Tutorial)
- LlamaIndex in Python: A RAG Guide With Examples (Tutorial)
- Using LlamaIndex for RAG in Python (Course)
- Embeddings and Vector Databases With ChromaDB (Quiz)
- First Steps With LangChain (Course)
- Build an LLM RAG Chatbot With LangChain (Quiz)
- LlamaIndex in Python: A RAG Guide With Examples (Quiz)
Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.
By Martin Breuss • Updated Nov. 2, 2026