What is a vector database? Simple guide
A database that stores embeddings so you can quickly find text with similar meaning. Common in RAG apps.
Last reviewedIn plain English
A vector database is a database built to store embeddings, which are lists of numbers that represent meaning, and to find the ones closest to a query very quickly. A normal database is good at exact matches, such as "find the customer with this ID". A vector database is good at similar matches, such as "find the passages most like this question".
How it works
- Prepare the content. Split your documents into passages.
- Turn each passage into an embedding using an embedding model, and store it with the original text.
- At search time, turn the question into an embedding too.
- Find the nearest neighbours: the stored embeddings most similar to the question's.
- Return the matching passages, which a system like RAG can hand to an AI to write an answer.
A simple example
A help centre has 2,000 articles. A visitor asks, "Why was I charged twice?" No article has exactly those words, but one titled "Duplicate payments and refunds" has a very similar meaning. The vector database finds it because its embedding sits close to the question's.
Do you need one?
Not always.
- Small amounts of content can often be searched without one, or with a simple in-memory index.
- Large collections, frequent updates and fast response needs are where a dedicated vector database earns its place.
- Many existing databases now offer vector search, so you may not need a separate product.
Common mix-ups
- A vector database does not understand the text. It compares numbers. The quality depends on the embedding model you used.
- It is not an AI model. It stores and searches. A model still writes the answer.
- A match is not proof. The closest passage is the most similar one, and it may still not contain the answer.
Related terms
- EmbeddingA list of numbers that represents the meaning of a piece of text, so a computer can compare meanings. Used in search and RAG.
- RAG (retrieval-augmented generation)A method where the AI first searches your documents for relevant information, then uses it to write the answer. Reduces made-up facts.
- Machine learningBuilding software that learns patterns from data instead of following only hand-written rules.