StackLift
All terms

Glossary

Vector database

A database that stores embeddings to enable semantic / similarity search.

A vector database stores numerical embeddings of text, images, or other data so you can search by meaning (similarity) rather than exact keywords - the retrieval layer behind RAG and AI search.

Common options include Pinecone, pgvector, Weaviate, and Qdrant. The right choice depends on scale, latency, and whether you want it inside your existing database.

Start in 60 seconds

Put this to work on your project.

Get an AI-assisted, architect-reviewed scope, cost range, and timeline. Free, no login.

The complete guide

Vector database: the complete guide

Updated November 18, 2026 ยท Published by , Founder, StackLift AI. Written with AI assistance; how we make content.

Short answer

A vector database is a database built to store embeddings, which are lists of numbers that capture the meaning of text, images, or audio, and to find the stored items closest in meaning to a query. It powers semantic search and retrieval-augmented generation, where an AI model pulls the right passages from your content before it answers.

What is a vector database in simple terms?

A normal database finds rows that match exactly: the customer with this ID, the orders placed this week. A vector database finds items that are similar in meaning. You ask for "how do I reset my login?" and it returns the help article titled "Recover your account access," even though the two share almost no words.

It does this by storing embeddings. An embedding model turns a piece of content into a long list of numbers, called a vector. Content with similar meaning gets vectors that sit close together, so searching becomes a question of which stored vectors are nearest to the query vector.

How does a vector database work?

Comparing a query against every stored vector gets slow as the collection grows. Vector databases build special indexes that find close matches quickly. This is called approximate nearest neighbor search: it trades a small amount of exactness for a large gain in speed. Common index types include HNSW graphs and product quantization.

  1. Split your content (documents, tickets, product pages) into chunks small enough to be useful on their own.
  2. Run each chunk through an embedding model to get its vector.
  3. Store the vector with the chunk text and metadata such as source, date, and who may see it.
  4. At question time, embed the question with the same model and search for the nearest vectors.
  5. Filter by metadata, rank the results, and pass the best chunks to a language model or show them to the user.

Step five is the heart of retrieval-augmented generation. The model answers from your passages instead of from memory, which keeps answers tied to your content and lets you cite sources.

Vector database examples and use cases

  • Semantic search across a knowledge base, contract library, or product catalog.
  • A support assistant that answers from your help center and past tickets.
  • Recommendations, such as similar products or related articles.
  • Duplicate and near-duplicate detection in records or documents.
  • Memory for an AI agent, so it can recall earlier facts and decisions.

Options include dedicated services such as Pinecone, Weaviate, Qdrant, and Chroma, and extensions to databases you may already run, such as pgvector for PostgreSQL. Cloud providers also offer vector search inside their own database products.

Vector database vs. traditional database vs. keyword search

Three ways to find information
ApproachMatches onStrong atWeak at
Relational database (SQL)Exact values and structured fieldsTransactions, reports, precise lookupsQuestions phrased in natural language
Keyword searchWords and phrasesExact terms, names, codes, part numbersSynonyms and meaning
Vector databaseCloseness in meaningNatural-language questions, fuzzy matchesExact identifiers and strict rules

Many strong systems combine them. Hybrid search runs keyword and vector search together and merges the results, so a query for a specific part number and a vague question both work.

Why does a vector database matter when you buy or build software?

If your product needs an AI feature that answers from your own data, retrieval quality decides whether users trust it. A language model with poor retrieval answers confidently from the wrong passage. Getting chunking, embeddings, filters, and permissions right takes more effort than installing the database.

Cost and effort depend on how much content you have, how often it changes, how fast answers must arrive, and who may see which documents. Using a vector extension inside your existing database is often simpler to run than adding a new service. See LLM integration and the AI and LLM integration cost guide for how these choices affect a project.

Common mistakes and misconceptions

Misconceptions about vector databases
MisconceptionWhat is actually true
It replaces your main databaseIt sits beside it and holds searchable representations, not your system of record
It trains the AI modelIt retrieves content at question time; the model is not retrained
More chunks always means better answersPoor chunking and no filters return noise; quality beats volume
Access rules take care of themselvesYou must store permissions as metadata and filter on them, or users may see documents they should not
You can swap embedding models freelyVectors from different models are not comparable, so changing models means re-embedding everything

How does StackLift approach retrieval features?

Retrieval is scoped during discovery, with the content sources, access rules, and quality checks written down before engineering begins. A senior architect reviews the estimate, and pricing follows deliverable complexity in story points. Agents work on feature branches, and observability and rollback are planned from sprint one. You can scope an AI feature feature by feature in the free estimate.

What are the main index types and distance measures?

Two choices shape how a vector database behaves: how it measures closeness and how it organizes vectors so search stays fast. You do not need to master the math, but you should know the names, because they appear in every product's settings.

Common index approaches
ApproachHow it works in plain termsTrade-off
Flat (exact)Compares the query with every vectorPerfectly accurate but slows as data grows
HNSWBuilds a layered graph so a search hops quickly toward close neighborsFast and accurate; uses more memory
IVFGroups vectors into clusters and searches only the nearest clustersLower memory; needs tuning of cluster counts
Quantized or compressedStores smaller versions of each vectorSaves memory and cost; small loss in accuracy

For distance, cosine similarity, dot product and Euclidean distance are the usual options. Use the one your embedding model recommends, since a mismatch quietly lowers result quality.

How do you choose a vector database?

  1. Count the content: how many items and how fast it grows.
  2. Check what you already run. If PostgreSQL is in place and the volume is modest, an extension may be enough.
  3. Decide on filters: can you restrict results by customer, department or document type, which most business apps require?
  4. Check access control: can you enforce who sees which documents at query time?
  5. Compare hosting: managed service, self-hosted or inside your cloud account, and where the data lives.
  6. Test with your own documents and questions, not a demo dataset.
  7. Plan for change: updating, deleting and re-embedding when you switch models.

Choosing is easier after a small test. Load a representative sample into two options and compare answer quality, speed and the effort of keeping them current.

How do you measure retrieval quality?

A vector database can run perfectly and still return the wrong passages. Measure retrieval separately from the final answer so you know which part is failing.

  • Hit rate: does the right passage appear in the top results for a set of known questions?
  • Ranking: how high does the right passage appear? Consider adding reranking.
  • Coverage: are there questions with no good source because the content is missing?
  • Freshness: how long between a document changing and the index reflecting it?
  • Permission safety: do users ever get passages they should not see?
  • Latency and cost: are searches fast enough and affordable at your traffic?

Build the question set from real user queries with the answers a person would accept, and re-run it after every change. The RAG implementation playbook lays out this loop.

What does a vector database mean for cost and timeline?

Costs fall into three buckets: embedding the content, storing and searching the vectors, and the engineering to keep them accurate and current. Embedding is usually a one-off per document plus updates. Storage and search costs rise with volume and with demands for speed and availability. The larger, less visible effort is cleaning content, choosing chunk sizes, handling permissions and building quality checks.

For a view of budget drivers, see AI and LLM integration cost, and use the free estimate to scope a retrieval feature with its data sources.

When do you not need a vector database?

A vector database solves a specific problem: finding content by meaning across more material than fits in a prompt. If you do not have that problem, it adds cost and moving parts for no gain.

  • Your content is small enough to place in the model's context window directly.
  • Users search for exact names, codes or IDs, where ordinary keyword search or a SQL query does better.
  • Your questions are about structured numbers, such as totals and counts, which belong in a normal database.
  • The data changes every few seconds and must be exactly current, so retrieval should read the source of truth.
  • You have no way to keep the index synchronized and permission-safe, which creates risk.

Start with the simplest thing that answers your real questions, and add vector search when evidence shows you need it.

What tools and technologies are commonly used?

Dedicated vector databases include Pinecone, Weaviate, Qdrant, Milvus and Chroma. Existing data platforms add vector features: pgvector for PostgreSQL, Elasticsearch and OpenSearch, MongoDB Atlas Vector Search, Redis and cloud services from AWS, Google Cloud and Azure. Embedding models come from providers such as OpenAI, Cohere, Google and open-weight families, and frameworks such as LangChain and LlamaIndex help wire the pieces together.

Questions people ask

Do I need a vector database for RAG?

You need some way to search by meaning, but not always a separate product. A small collection can live in a vector extension such as pgvector inside your existing database. Dedicated services help when the collection is large or latency needs are strict.

What is an embedding?

An embedding is a list of numbers produced by a model that represents the meaning of a piece of content. Similar content gets similar numbers. That lets software compare meaning by measuring distance.

Is pgvector good enough?

For many business applications it is. It keeps vectors next to your other data and uses tools your team already knows. Very large collections or heavy search loads may call for a dedicated service.

Can a vector database store my private documents safely?

Yes, if you design for it. Store access rules as metadata, filter every query by the user's permissions, and encrypt data at rest and in transit. A private model setup keeps content inside your environment.

How is a vector database different from a search engine?

A classic search engine matches words, while a vector database matches meaning. Many products use both together in hybrid search so exact terms and natural-language questions both return good results.

How do I keep a vector database up to date?

Re-embed content when it changes and remove vectors for deleted documents. A scheduled or event-driven pipeline handles this. Without it, answers drift out of date.

Is a vector database the same as a regular database?

No. A regular database matches exact values and structured queries. A vector database ranks items by similarity of meaning. Many systems use both, and some regular databases now add vector features.

Do I need to re-embed everything if I change models?

Yes. Vectors from different embedding models are not comparable. Plan for a re-indexing job and keep the original text so you can rebuild the index.

How much data can a vector database hold?

It depends on the product and the hardware behind it. Small collections run comfortably inside an existing database, and very large ones call for a dedicated, scalable service. Test with your own volume.

Sources

Sources and further reading

The standards, rules, research and official documentation this page draws on.