Vector search

Also called: semantic search

What is Vector search?

Vector search finds documents by comparing embeddings rather than matching keywords, ranking results by distance in meaning. It is what allows a chatbot to answer a question phrased in the visitor's own words when the website uses different terminology entirely.

In more detail

Keyword search finds documents that contain the words you typed. Vector search finds documents that mean something similar, by comparing embeddings. A visitor who asks "do you sort out damp?" can be matched with a page titled "Condensation and mould treatment".

Every passage is stored with its embedding, and an index makes it fast to find the nearest neighbours of a question's embedding among thousands or millions of them. Results come back ranked by distance rather than by word overlap.

It has blind spots. It can rank a passage on the right topic above one that answers the exact question, and it is weaker on identifiers such as part numbers. Hybrid search, which blends vector and keyword scores, is a common fix.

Illustration for "Vector search"GLOSSARYVector search
Vector search, defined in plain English.
Vector search connected to customers and the tools that serve themVector searchEmbeddingRetrieval-augment…Knowledge base
Related terms in this glossary.

How SpideyChat handles it

SpideyChat uses vector search over each assistant's passages and FAQ answers, stored in PostgreSQL with the pgvector extension and an HNSW index, and takes the five nearest results for every question. It does not use hybrid search.

We make SpideyChat. The rest of this page describes the term in general, not our product.

Questions

Is vector search better than keyword search?
For questions in natural language, usually. For exact terms such as part numbers, keyword search is often more reliable, which is why many systems use both.
What is the difference between semantic search and vector search?
Semantic search describes the goal, matching on meaning. Vector search is the usual way of achieving it.

All glossary terms