Skip to content
AI & Machine Learning

Vector Database

Definition

A vector database stores embeddings and quickly finds the ones closest to a query, even among millions of items. It is the usual store behind search by meaning and the retrieval step in RAG.

Diagram

How a vector database answers a searchAhead of time, every document is turned into an embedding and stored in the vector database’s index. When a question comes in, it is embedded the same way, and the database returns the three stored items closest to it, without comparing against every item.AHEAD OF TIMEDocumentsembedAT SEARCH TIME“cancel my plan”embedVector indexTOP 3 MATCHES1. How to cancel2. Pause your plan3. Refund policy
The index is what makes it fast: it narrows the search to the right neighborhood instead of comparing the query with every item. That speed usually comes from approximate search, which very occasionally misses the single closest match. Many teams start with a vector extension to their existing database before adding a separate one.

Worked example