What are embeddings and vector search?
Keyword search matches words. Ask for "budget pacing problems" and it finds documents with those words. It misses the one titled "Why our spend ran out by the 20th." Embeddings fix that by representing meaning as numbers, so two passages about the same idea sit close together even when they share no words.
An embedding model turns each passage into a vector, often hundreds or thousands of numbers long. Vector search, run by a vector database or a search index, finds the stored vectors nearest to the question's vector. It's the retrieval step behind most retrieval-augmented generation.
How does vector search work?
- Split the content. Documents are broken into chunks, often a few paragraphs each, ideally along headings and tables rather than at a fixed length.
- Embed each chunk. An embedding model turns every chunk into a vector, and the vectors are stored with a link back to their source.
- Embed the question. The same model turns the question into a vector.
- Find the nearest. The index returns the chunks whose vectors are closest, usually using approximate nearest-neighbor search to stay fast at scale.
- Rerank. A second, slower model reads the top results against the question and reorders them, so only the best few go to the language model.
| Search type | Matches on | Strong at | Weak at |
|---|---|---|---|
| Keyword (sparse, such as BM25) | Exact words | Names, codes, IDs, rare terms | Synonyms and paraphrases |
| Vector (dense) | Meaning | Paraphrases and related ideas | Exact terms and numbers |
| Hybrid | Both, with results merged | Most real-world questions | Adds tuning and cost |
What is an example of vector search?
Finding the right brand guideline
A copywriter asks an assistant whether a product can be called "eco-friendly" in France. The guidelines never use that phrase. They say environmental claims need certification in EU markets.
Keyword search finds nothing. Vector search finds the passage, because the question and the rule mean nearly the same thing. A reranker confirms it's the best match, and the assistant answers with a link to the source.
Vector search vs. a semantic layer
| Vector search | Semantic layer | |
|---|---|---|
| Finds | Passages related to a question | The defined metric or field a question asks for |
| Best for | Documents, policies, and notes | Numbers, KPIs, and performance data |
| Answer type | The closest text, which a model summarizes | A calculation from agreed definitions |
| Failure mode | A close but wrong passage | A definition nobody has set yet |
Why do embeddings and vector search matter?
Retrieval decides what a model sees, and a model can only answer from what it sees. Most wrong answers from document assistants start with the wrong passage being retrieved.
- Chunking. A chunk that separates a table from its header, or a rule from its exception, loses its meaning.
- Exact terms. Vector search can miss a campaign ID or SKU, so pair it with keyword search.
- Stale indexes. If documents change and the index doesn't, answers quote old policy.
- Numbers. Embeddings capture meaning and can't do arithmetic. Questions about metrics need governed data and defined calculations.
How does Alli do this?
For performance data, Alli takes the governed route. Ask Alli resolves every request against the metrics, dimensions, and business rules defined in Alli Semantic Layer, so a question about ROAS uses the definition your teams agreed on rather than the closest passage that mentions it.
Each answer shows the data, logic, and source behind it, so people can check where a number came from before they act on it.
Explore Ask AlliEmbeddings and vector search FAQ
What is an embedding in AI?
An embedding is a list of numbers that represents the meaning of text, an image, or other data. Items with similar meanings get similar numbers, so a computer can measure how related they are.
What is a vector database?
A database built to store embeddings and quickly find the ones closest to a query. Many general databases and search engines now offer vector search too.
What is the difference between semantic search and keyword search?
Keyword search matches the words in a query. Semantic search matches meaning, so it finds relevant results that use different words. Many systems use both.
What is reranking?
A second step that takes the top search results and reorders them with a more careful model, so the most relevant passages reach the language model first.
Last updated Back to the glossary
