What is a vector database?
A vector database stores vectors, which are long lists of numbers that represent the meaning of text, images or other content, and answers one kind of question very fast: which stored items are closest to this one? That is similarity search, and it is the basis of semantic search and most systems that let a language model answer from a company's own documents.
A traditional database is good at exact matches: find the customer whose ID is 4471. A vector database is good at approximate ones: find the ten passages that mean something close to this question.
How does a vector database work?
- Embed. Each document is split into passages, and an embedding model turns each passage into a vector.
- Store. The vector is saved with the original text and metadata such as source, date and access rights.
- Index. The database organises the vectors so it does not have to compare a query with every record. Most use approximate nearest neighbour methods, which trade a little accuracy for a large gain in speed.
- Query. The question is embedded with the same model, and the database returns the nearest vectors, often filtered by metadata.
Vector database vs relational database
| Relational database | Vector database | |
|---|---|---|
| Stores | Rows and columns | Vectors with attached metadata |
| Finds by | Exact values and ranges | Similarity in meaning |
| Typical query | "Orders over $500 in March" | "Passages like this question" |
| Result | Exact | Ranked by closeness, approximate |
| Typical use | Transactions, records | Semantic search, RAG, recommendations |
The line is blurring. Many general-purpose databases and search engines now offer vector search as a feature, so a separate product is not always needed.
Do you need a vector database?
You need vector search when users or a model must find content by meaning across a body of material too large to paste into a prompt. You may not need a dedicated product. For a few thousand documents, a vector extension to a database you already run is usually enough. A specialised system earns its place at large scale, with strict speed requirements or heavy filtering.
What goes wrong?
Most problems come from what was stored, not the database: passages split in the wrong places, duplicates, outdated versions and missing access controls that let a search return documents the user should not see.