Semantic Vector Search
GenAI SystemsSearch by meaning instead of by exact words: turn the query and every document into embeddings (lists of numbers), then return the documents whose numbers are closest to the query's.
Ask a good librarian for "something for a new puppy owner" and she hands you a book called Raising Your First Dog, even though not one of your words appears in the title. She understood what you meant. A keyword search would hunt for the exact words "new puppy owner" and find nothing. Semantic search is the librarian.
Keyword search matches text. Semantic search matches meaning. A keyword engine looks for the same characters you typed, so "puppy" never finds a page that only says "dog". A semantic engine compares what the words mean, so both land together.
How it works. An embedding model turns a piece of text into a vector, a list of numbers (often several hundred to a few thousand) that works like coordinates in a space of meaning. Texts with similar meanings end up close together. To compare two vectors, the usual measure is cosine similarity: the cosine of the angle between them, from 1 (same direction, same meaning) down through 0 (unrelated) to -1 (opposite).
A tiny example. Give "dog" the vector [0.9, 0.1], "puppy" [0.85, 0.2] and "invoice" [0.05, 0.95]. Dog and puppy have a cosine similarity of 0.99, so they point almost the same way. Dog and invoice score 0.16, so they are nearly unrelated. A search for "dog" would rank a page about puppies far above a page about invoices, with no shared keyword needed.
Where it is weak. Embeddings are poor at exact tokens: an error code like 0x3F, a product SKU, a person's name. Those need exact matching, which is why production systems often use hybrid search, combining keyword search (for example BM25) and vector search, then merging the two rankings. Quality also depends on the embedding model fitting your language and domain.
The scale problem. Comparing a query against millions of vectors one by one is too slow for an interactive search. That is the job of a vector database and its approximate nearest-neighbor index.
- Same idea at both ends: embed the documents once, embed each query, return the nearest vectors.
- Cosine similarity compares direction, so a long document and a short one about the same topic still match.
- Use the same embedding model for the documents and the queries, or the numbers will not be comparable.
- Semantic search finds related meaning but can miss exact identifiers: pair it with keyword search for those.
- It is the retrieval half of RAG.
Curated Curation & Deep Insights
ScaleDojo CertifiedOur system architects are vetting high-quality, authorized video guides for Semantic Vector Search with zero third-party platform links.
We are preparing premium, zero-competitor deep-dives for Semantic Vector Search. Authorized reading references will appear automatically.