When an AI system searches your documents by meaning, it needs somewhere to store all the embeddings and a fast way to find the closest ones. That is the job of a vector database. You will see the term often when reading about RAG and AI search. This article explains what vector databases do and how to choose one, without assuming a database background.
What a vector database does
A vector database stores vectors, the lists of numbers produced by an embedding model, along with the original content and related details, and lets you search for the vectors most similar to a query vector.
In plain terms: you give it the meaning of a question, and it quickly returns the stored passages with the closest meaning.
Most vector databases also store:
- The original text of each chunk, so it can be shown or sent to a language model.
- Metadata, such as source document, title, date, category, language, and access permissions.
- Identifiers that link each chunk back to its source, so content can be updated or deleted.
Why not just use a regular database?
Traditional databases are excellent at exact matches and structured queries: find the customer with this email, list orders over a certain amount. They are not designed to answer "which of these million passages is closest in meaning to this question?"
Comparing a query against every stored vector one by one works for small collections but becomes slow as collections grow. Vector databases use specialized indexes, often called approximate nearest neighbor indexes, that find very close matches quickly without checking every vector. The "approximate" part means they trade a tiny amount of precision for a large gain in speed, which is almost always a worthwhile trade.
That said, the line between regular and vector databases has blurred. Many traditional databases and search engines now support vector search directly.
Key features to understand
Similarity search
The core feature: return the top matches for a query vector, using a similarity measure such as cosine similarity.
Metadata filtering
Restricting results by metadata, such as "only documents from the HR category," "only content updated this year," or "only documents this user is allowed to see." Filtering is essential for accuracy and for access control in business systems.
Hybrid search
Combining vector similarity with traditional keyword search. This catches both meaning-based matches and exact terms like product codes or names. For many business uses, hybrid search performs noticeably better than either approach alone.
Updates and deletions
Content changes. A good setup lets you update or remove chunks when source documents change, so the AI does not answer from outdated or deleted material.
Scale and performance
How many vectors it can hold, how quickly it searches, and how it handles many simultaneous users.
Types of options
Vector search inside a database you already use
Several popular databases offer vector search through built-in features or extensions. PostgreSQL with the pgvector extension is a widely used example. Others, including some document databases and search engines such as OpenSearch and Elasticsearch, support vector or hybrid search as well.
Good for: teams that want to keep everything in one familiar system, small to medium collections, and simpler operations.
Dedicated vector databases
Purpose-built products focused on vector search, available as open-source software you can host yourself, as managed cloud services, or both. Examples include Qdrant, Weaviate, Milvus, Chroma, and Pinecone, among others.
Good for: large collections, demanding performance needs, or teams that want specialized vector features.
Managed retrieval services
Some AI platforms and cloud providers offer complete retrieval or knowledge base services that handle chunking, embedding, storage, and search for you. You upload documents; they handle the rest.
Good for: getting started quickly with less engineering, if the service's data terms and features fit your needs.
Built into AI tools
Chat products that let you upload files to a project often use vector search behind the scenes. You never see the database.
Good for: small, non-sensitive collections and individual use.
How to choose
Ask:
- How much content? A few hundred documents rarely need a dedicated vector database. Millions of chunks might.
- What do you already run? If you already use a database that supports vector search, starting there is often simplest.
- Where must the data live? Sensitive content may require self-hosting or a specific region. See Local AI vs hosted APIs vs private cloud.
- Do you need hybrid search and strong filtering? Most business applications do.
- Who will maintain it? Managed services reduce operational work; self-hosting gives more control.
- What will it cost at your expected size, including storage, queries, and any hosting?
For many small businesses, the realistic answer is either the vector features of a database they already use or a managed service. Dedicated vector databases make sense as scale and requirements grow.
Practical tips
- Store the original text and source references with each vector, so you can show citations and re-embed later if you switch embedding models.
- Record which embedding model created each vector. Mixing models in one index produces meaningless results.
- Include permissions in metadata and filter on them for every query in systems used by people with different access levels.
- Keep the index in sync with source content through regular updates and deletions.
- Back it up like any other important data store.
- Protect it with access controls and encryption. A vector database containing your documents is as sensitive as the documents themselves.
Where it fits in the bigger picture
A vector database is one component of a RAG system. The overall quality depends just as much on clean source content, sensible chunking, a good embedding model, effective prompts, and testing. Choosing the "best" vector database will not fix poor documents or bad chunking. See Preparing your documents for AI.
Key takeaways
- A vector database stores embeddings with their text and metadata and finds the closest matches quickly.
- Approximate nearest neighbor indexes make search fast at scale.
- Metadata filtering and hybrid search are important for accuracy and access control.
- Options range from vector features in existing databases to dedicated products and fully managed services.
- Choose based on size, existing systems, data location, maintenance capacity, and cost, and protect the index like the source documents.