# Semantic search

> Semantic search is search that matches by meaning rather than exact words, typically by comparing embeddings, so a query such as "how do I get my money back" can find a page titled "Refund policy".

Also called: vector search, meaning-based search, neural search, similarity search. Category: Data and retrieval. Source: https://aibuildindex.com/glossary/semantic-search

## In the index

- Search over internal documents: median $2,150, middle half $300 to $8,800, 918 priced briefs (https://aibuildindex.com/cost/document-search-rag)
- Vector databases: median $4,000, middle half $500 to $11,400, 264 priced briefs (https://aibuildindex.com/skills/vector-databases)

Traditional keyword search fails when people use different words from the documents they are looking for. Semantic search closes that gap by comparing what the query means with what each document means. It is the retrieval step in most AI assistants and a useful upgrade on its own for help centres, product catalogues and internal document stores, where staff and customers rarely know the exact terminology.

## How it works

An embedding model converts every document passage into a vector, a list of numbers that encodes its meaning, and stores them in a [vector database](https://aibuildindex.com/glossary/vector-database). When a query arrives, it is converted with the same model, and the system returns the passages whose vectors are closest. Because similar meanings produce nearby vectors, "cancel my subscription" lands close to "ending your plan" even with no words in common.

Results are often improved with a second pass. A [reranking](https://aibuildindex.com/glossary/reranking) model reads the top candidates alongside the query and reorders them by relevance, and metadata filters narrow results by date, product or permission. In a [RAG](https://aibuildindex.com/glossary/retrieval-augmented-generation) system the top passages are then handed to a language model to write an answer; in a plain search interface they are simply shown as results.

## What it means for cost

Semantic search is not expensive to run for modest collections; embedding is cheap compared with generating text. The build effort goes into preparing content, choosing an embedding model that suits the language and domain, and testing whether the results are actually better than the existing search. A buyer with multilingual content, specialist jargon or product codes should expect extra tuning, often by combining semantic and keyword search in [hybrid search](https://aibuildindex.com/glossary/hybrid-search).

Ask a builder how relevance will be measured, for example with a list of real queries and the documents that should come back, and how new or edited documents get re-embedded. Live figures for search and retrieval builds are on the [document search and RAG cost page](https://aibuildindex.com/cost/document-search-rag).

## When it is the wrong tool

Semantic search is weak at exact lookups: part numbers, names, error codes, legal citations. It can also return something that sounds related but is wrong, where a keyword search would correctly return nothing. For structured questions over tables of data, [text-to-SQL](https://aibuildindex.com/glossary/text-to-sql) is a better fit.

## Common questions

### Is semantic search the same as RAG?

No. Semantic search finds relevant passages. RAG adds a language model that reads those passages and writes an answer. Semantic search can be used on its own, and RAG can use other kinds of retrieval.

### Does semantic search work across languages?

With a multilingual embedding model, yes: a query in one language can retrieve documents written in another. Quality varies by language pair and model, so it should be tested on real queries before launch.

## Related terms

- [Embedding](https://aibuildindex.com/glossary/embedding): An embedding is a list of numbers that represents the meaning of a piece of text, an image or another item, so that items with similar meanings end up close together and can be compared, searched or grouped by software.
- [Vector database](https://aibuildindex.com/glossary/vector-database): A vector database is a data store built to save embeddings, the numeric representations of text, images or audio, and to find the stored items most similar in meaning to a query, which makes it the usual search layer behind RAG systems.
- [Hybrid search](https://aibuildindex.com/glossary/hybrid-search): Hybrid search combines keyword search and semantic vector search in one query and merges their results, so a system finds both exact matches such as product codes and passages that match by meaning.
- [Reranking](https://aibuildindex.com/glossary/reranking): Reranking is a second retrieval step in which a more precise model rescores the top results from a first, faster search and reorders them by relevance to the query, so the best passages reach the user or language model first.
- [Retrieval-augmented generation (RAG)](https://aibuildindex.com/glossary/retrieval-augmented-generation): Retrieval-augmented generation is a way of answering questions with a language model that first looks up relevant passages in your own documents, then writes an answer grounded in what it found.
- [Knowledge base](https://aibuildindex.com/glossary/knowledge-base): A knowledge base is an organised collection of a business's information, such as help articles, policies, product details and past answers, that people or AI systems consult to answer questions consistently.
