What is a vector database?

A vector database stores numeric representations of text or images and finds the entries closest to a query vector, usually using an approximate nearest-neighbour index.

Comparing a question to every stored passage is exact and gets slower in proportion to how many passages there are. A vector database trades a little accuracy for a large speed gain by building an index that skips most of the comparisons. That trade is worth making at millions of vectors and is close to pointless at thousands.

Why it matters

Vector databases are frequently adopted before they are needed, adding a service to operate and a second place for data to drift out of sync. The question worth asking is how many vectors a single query actually has to compare against. For a system that answers questions about one website at a time, a query only ever searches that site's own passages — a few thousand at most — and a plain database with an ordinary index handles that in milliseconds.

Examples

  • A product search across fifty million listings, where scanning everything is not an option.
  • An image similarity service comparing a query against every photo ever uploaded.
  • A support tool that searches one customer's pages, which does not need one.

Not the same as

Semantic search

Semantic search is the technique. A vector database is one way to make it fast at large scale.

Related

term

What is an embedding?

Embeddings are why an AI representative can answer "do you deliver to Berlin?" from a page that only says "we ship across the EU". Text is converted to vectors, and similar meaning lands close together.

term

What is semantic search?

Keyword search asks whether two pieces of text share words. Semantic search asks whether they mean the same thing. The difference shows up immediately in customer questions, because customers do not use a company's vocabulary: someone asks 'can I send it back?' about a page headed 'Returns and exchanges', and the two share not one significant word.

term

What is cosine similarity?

It is the standard way to compare embeddings, and its defining property is that it ignores magnitude entirely. Two vectors pointing the same way score identically whether one is twice as long as the other. In practice, scores for text embeddings tend to fall in a narrow band — often 0.6 to 0.9 for anything vaguely related — which is why a raw score is meaningless without knowing the distribution for a given model.

term

What is semantic search?

Keyword search asks whether two pieces of text share words. Semantic search asks whether they mean the same thing. The difference shows up immediately in customer questions, because customers do not use a company's vocabulary: someone asks 'can I send it back?' about a page headed 'Returns and exchanges', and the two share not one significant word.

term

What is cosine similarity?

It is the standard way to compare embeddings, and its defining property is that it ignores magnitude entirely. Two vectors pointing the same way score identically whether one is twice as long as the other. In practice, scores for text embeddings tend to fall in a narrow band — often 0.6 to 0.9 for anything vaguely related — which is why a raw score is meaningless without knowing the distribution for a given model.

term

What is an AI knowledge base?

A traditional knowledge base stores articles and gives you search over their words. An AI knowledge base stores the same content as passages indexed by meaning, which is what allows a question phrased in the customer's own words to reach the passage that answers it.

RubyRep is this, applied to your website.

Give it your URL and it reads your pages, then answers your customers from them.

Train My RubyRep