News / Learn / Embeddings & vector search
What is a vector database and do you need one?
You'll be able to decide whether your product needs a vector database or can use something simpler.
In plain English
A vector database stores embeddings, which are lists of numbers that represent the meaning of text, images or other data. It finds the stored items closest in meaning to a query. Its main job is fast similarity search over many items at once.
Why it matters
Many AI products need to find relevant content, such as help articles, past tickets or product records, based on meaning rather than exact keywords. A vector database makes that search fast at scale. Adding one also adds cost, infrastructure and things to maintain, so you should know when you actually need it.
How it works
Each piece of content is turned into an embedding by an embedding model. The vector is stored along with the original text and any metadata, such as a user ID or document date.
When a user asks something, the query is converted into an embedding with the same model. The database then compares that query vector against stored vectors and returns the nearest ones, usually ranked by a similarity measure such as cosine similarity.
The database uses index structures so it does not need to compare the query against every stored item. This trades a little accuracy for a large gain in speed, which matters once you have many thousands or millions of items.
You can often skip a dedicated vector database when your collection is small. A few thousand vectors can be searched in memory with a simple loop, or stored in a relational database that offers vector support. Many teams start there and move only when speed, scale or filtering needs grow.
A concrete example
A minimal in-memory search with cosine similarity, enough for a small collection:
import numpy as np
def top_k(query_vec, doc_vecs, k=3):
q = query_vec / np.linalg.norm(query_vec)
d = doc_vecs / np.linalg.norm(doc_vecs, axis=1, keepdims=True)
scores = d @ q
best = np.argsort(-scores)[:k]
return [(int(i), float(scores[i])) for i in best]
# doc_vecs: a 2D array, one row per stored embedding
# query_vec: a 1D array from the same embedding modelA short sketch to show the idea. Check the official docs of the tool you use.
What goes wrong
- Assuming you need a vector database from day one Start with a simple store or an existing database with vector support. Move to a dedicated system when measured speed or scale requires it.
- Mixing embeddings from different models Vectors from different models live in different spaces and cannot be compared. Re-embed all content whenever you change the embedding model.
- Storing vectors without the source text Keep the original text and metadata next to each vector. You need them to show results, filter them and debug bad matches.
- Expecting exact keyword matching Similarity search finds related meaning, not exact terms. Combine it with keyword search when names, codes or exact phrases matter.
Going deeper
Learn how index types such as approximate nearest neighbor trade speed for accuracy. Then study metadata filtering and how it interacts with similarity search. Finally, look at how retrieval quality is measured with a small labeled set of queries.
FAQ
Is a vector database the same as a regular database?
Not quite. A regular database is built for exact lookups and filters. A vector database is built to find the nearest vectors to a query. Many regular databases now offer vector features too.
How many items do I need before a vector database helps?
There is no fixed number. When brute-force search is fast enough for your users, you may not need one. Measure latency with your own data before you decide.
Do I need one for a chatbot?
Not always. A chatbot that answers from a small set of documents can often work with simple search. A dedicated store helps when the document set is large or changes often.
Can a vector database replace keyword search?
Usually no. Vector search handles meaning well but can miss exact terms. Many systems combine both approaches.
What is the most common reason teams add one too early?
They adopt it because it sounds necessary. Test a simple approach on real queries first. Add complexity only when the simple approach fails in a way you can measure.
Written with AI by CapyLaunch. Spotted a mistake? Email hello@capylaunch.com.