Vector Database Definition: What It Is and How It Works
In short
A vector database is a storage and retrieval system optimized for high-dimensional embeddings — numerical arrays that represent the semantic meaning of data. It finds results by measuring mathematical distance between vectors, not by matching exact strings.
A vector database stores and retrieves high-dimensional numerical arrays called embeddings — each one encoding the semantic meaning of a piece of data. Unlike a SQL database that matches exact strings, a vector database finds results by measuring mathematical distance between coordinates in high-dimensional space.
Traditional databases store structured rows and columns. Vector databases store arrays of floating-point numbers — for example, [0.23, -0.87, 0.14, ...] — that represent meaning, not raw text.
An embedding is a fixed-length array of floating-point numbers generated by an AI model. It encodes the semantic content of a piece of data — text, image, or audio — so that similar items produce numerically similar vectors.
Consider two sentences: "We need to cut carbon emissions" and "The firm must reduce its Scope 3 footprint." They share zero words. A SQL database returns no match. A vector database recognises they are semantically identical and returns both.
The Embedding Pipeline
Every vector in the database starts as raw data. The pipeline that converts it runs in four steps:
- Raw input: text, image, audio, or video
- Embedding model: OpenAI
text-embedding-3-large, Google Gecko, or open-source SBERT encodes the input - Output vector: a floating-point array of 768–3,072 dimensions (per OpenAI and Google model documentation, 2024)
- Storage: the vector is written to the database alongside structured metadata fields
Each vector is a coordinate in high-dimensional space. Similarity search finds the nearest coordinates using one of three distance metrics.
| Metric | Measures | Best For | Range |
|---|---|---|---|
| Cosine Similarity | Angle between vectors | Text / NLP search | −1 to 1 |
| Euclidean Distance | Straight-line distance | Image / spatial data | 0 to ∞ |
| Dot Product | Magnitude + direction | Dense retrieval / recommendation | −∞ to ∞ |
Cosine similarity is the dominant choice for enterprise text search because it is invariant to vector length — two documents of different word counts can still score as near-identical in meaning.
ANN Indexing: How Vector Databases Achieve Millisecond Search
Brute-force nearest-neighbour search is O(n) — scanning every record in a 1-billion-vector collection would take seconds per query. Approximate Nearest Neighbor (ANN) algorithms solve this by building index structures during ingestion.
The two dominant algorithms are:
- HNSW (Hierarchical Navigable Small World): Builds a multi-layer proximity graph. A query traverses from coarse high-level layers to fine-grained lower layers, achieving sub-10ms latency at the 99th percentile. Used by Qdrant, Weaviate, and Pinecone.
- IVF-Flat (Inverted File Index): Partitions the vector space into Voronoi cells (clusters). At query time, only the nearest N clusters are searched — dramatically reducing comparisons. Used by Faiss (Meta).
A 2025 distributed performance study published on arXiv demonstrated that Qdrant running HNSW on HPC platforms achieved consistent sub-millisecond recall at scale — validating ANN as production-ready for billion-record enterprise workloads.
ANN recall typically sits at 95–99%. A tiny fraction of true nearest neighbours may be missed — an acceptable trade-off when the alternative is seconds of latency per query.
Metadata Filtering: Combining Semantic and Structured Search
Vector databases are not purely unstructured. Every vector is stored alongside structured metadata fields: document_id, date, language, department, access_level.
Hybrid queries combine semantic vector search with a metadata filter. A real enterprise query might look like: "Find the 10 most semantically relevant documents to this query, but only from the Legal department, published after 2023."
This is critical for enterprise deployments where access control, data segmentation, and content freshness constraints apply. Efficient metadata filtering while maintaining ANN performance is a key differentiator between enterprise-grade systems (Qdrant, Pinecone, Weaviate) and simpler implementations.
Typical embedding dimensions for modern language models, per OpenAI and Google model documentation (2024). Higher dimensions capture finer semantic nuance but increase storage and compute costs.
Vector Database vs. Traditional Database: Key Differences
In short
Traditional SQL databases are optimised for exact-match queries on structured data. Vector databases are optimised for similarity search on unstructured data. Most enterprise AI stacks require both running in parallel.
The distinction is architectural, not generational. SQL databases are not being replaced — they are being complemented. Each system handles a fundamentally different class of query.
| Dimension | SQL Database | NoSQL Database | Vector Database |
|---|---|---|---|
| Data format | Structured rows/columns | Documents, key-value, graphs | High-dimensional float arrays |
| Query type | Exact match, range, join | Document lookup, aggregation | Similarity / nearest neighbour |
| Schema | Rigid, predefined | Flexible | Schema-light with metadata |
| Scaling model | Vertical (primarily) | Horizontal | Horizontal (distributed sharding) |
| Primary use case | Transactions, reporting | Flexible storage, real-time apps | AI search, RAG, recommendations |
| AI-native | No | Partial (some add vector plugins) | Yes — purpose-built |
The practical implication: a vector database cannot replace your ERP, CRM, or financial ledger. It handles what SQL cannot — retrieving semantically relevant content from unstructured knowledge bases, documents, and media.
The Hybrid Stack: Why Enterprises Run Both
In production AI systems, the pattern is consistent across the 100+ enterprise deployments Alice Labs has overseen: a PostgreSQL or similar relational database handles transactional records, while a vector database handles the retrieval layer for AI features.
A representative architecture looks like this:
- SQL layer: stores user accounts, product catalogue metadata, order history
- Vector layer: stores embeddings of product descriptions, support documents, and knowledge base articles
- AI application layer: receives a user query → embeds it → queries the vector DB → injects top-k results into the LLM prompt
This is the standard architecture for retrieval-augmented generation (RAG) — the dominant enterprise AI deployment pattern in 2024–2025.
NoSQL and Vector Extensions: When Are They Sufficient?
Several NoSQL systems now offer vector search as an extension: MongoDB Atlas Vector Search, Redis Vector, and pgvector for PostgreSQL. These are sufficient for low-scale pilots — fewer than 1 million vectors with modest query-per-second requirements.
At enterprise scale — 10M+ vectors, sub-10ms latency requirements, complex metadata filtering — purpose-built vector databases outperform extensions on every benchmark dimension.
Vector Database Use Cases: Where Enterprises Deploy This Technology
In short
The four dominant enterprise use cases are retrieval-augmented generation (RAG), semantic search, recommendation engines, and multimodal AI — each requiring fast, high-dimensional similarity search that traditional databases cannot provide.
Vector databases are not a standalone product — they are the retrieval layer that makes AI applications accurate and grounded in real organisational knowledge. Without them, LLMs hallucinate because they lack access to current, organisation-specific context.
A peer-reviewed analysis published in ScienceDirect (Elsevier, June 2024) identified four primary production deployment patterns that account for the majority of enterprise vector database workloads.
Retrieval-augmented generation is the primary production deployment pattern for enterprise vector databases in 2024, enabling LLMs to answer questions grounded in proprietary organisational knowledge without retraining.
1. Retrieval-Augmented Generation (RAG)
RAG is the most common enterprise AI deployment in 2024. The vector database stores embeddings from internal knowledge bases, policies, contracts, and documentation.
At query time: the user's question is embedded → the top-k most relevant document chunks are retrieved → those chunks are injected into the LLM prompt as context. The LLM answers using real, current organisational knowledge rather than hallucinating.
Example: A 500-person law firm stores all case precedents and regulatory guidance in a vector database. An internal AI legal research assistant retrieves the 8 most relevant precedents for any query in under 50ms — without keyword matching.
For a full technical breakdown of this architecture, see our guide on what is RAG and how retrieval-augmented generation works.
2. Semantic Search
Semantic search replaces keyword-based enterprise search with intent-based search. Users find relevant content even when they use entirely different terminology from the documents they need.
Searching "carbon reduction targets" returns documents about "net zero commitments" and "Scope 3 emissions" — without those exact phrases appearing anywhere in the query.
Alice Labs implemented AI-driven semantic site search for Ljusgårda, which now delivers 54,400 organic clicks per month — a result that keyword-based search infrastructure could not have achieved. This outcome demonstrates the compounding commercial value of semantic retrieval at scale.
3. Recommendation Engines
Vectors encode both user behaviour and item attributes in the same mathematical space. Similarity search then finds items most similar to what a user has previously interacted with — without explicit rules or collaborative filtering.
Enterprise applications include:
- E-commerce: product recommendations based on browsing and purchase history
- B2B catalogues: "customers who viewed this specification also needed these components"
- Media and content: article and video recommendations based on consumption patterns
- Internal knowledge: "employees who searched for this policy also needed these training materials"
4. Multimodal AI Search
Multimodal embeddings (such as OpenAI's CLIP model) encode both text and images into the same vector space. This enables natural language queries across image, audio, and video libraries.
Example: A manufacturer's engineer types "corroded pipe fitting" into a search interface. The vector database returns matching images from a 2-million-photo inspection archive — without any manual tagging or OCR.
| Use Case | What the Vector DB Does | Example Application | Data Types |
|---|---|---|---|
| RAG | Retrieves relevant document chunks for LLM context | Internal AI assistant, legal research tool | Text, PDFs, policies |
| Semantic Search | Matches intent, not keywords | Enterprise site search, intranet search | Text, documents |
| Recommendations | Finds similar items/users by vector proximity | E-commerce, B2B catalogues, content | Text, behavioural data |
| Multimodal AI | Cross-modal similarity search | Image search via text, audio retrieval | Images, audio, video, text |
Vector Database Providers: Forrester's 2024 Evaluation
In short
Forrester evaluated 14 vector database vendors in Q3 2024 across 25 criteria. Leading enterprise providers include Pinecone, Weaviate, Qdrant, Chroma, and Milvus — each with distinct architectural trade-offs.
In Q3 2024, Forrester published its first dedicated Vector Databases Wave — evaluating 14 vendors across 25 criteria spanning current offering, strategy, and market presence. A companion Landscape report in Q2 2024 mapped 24 vendors in total, signalling that the market has reached enterprise-grade maturity.
The emergence of a Forrester Wave specifically for vector databases — a category that barely existed at commercial scale before 2022 — is itself a market signal: enterprises are now standardising procurement processes around this technology.
| Provider | Indexing Algorithm | Deployment Options | Metadata Filtering | Notable Strength |
|---|---|---|---|---|
| Pinecone | HNSW (managed) | Cloud (managed only) | Yes | Serverless, fastest time-to-production |
| Weaviate | HNSW | Cloud, self-hosted, hybrid | Yes | Built-in hybrid search (BM25 + vector) |
| Qdrant | HNSW | Cloud, self-hosted, on-premises | Yes (advanced) | Performance at scale; Rust-native |
| Milvus / Zilliz | HNSW, IVF, DISKANN | Open-source, cloud (Zilliz) | Yes | Billion-scale open-source option |
| Chroma | HNSW | Embedded, self-hosted | Yes | Developer-first; rapid prototyping |
How to Select a Vector Database Provider
Provider selection should be driven by four operational constraints, not marketing positioning:
- Scale: How many vectors at peak? Under 5M — most providers suffice. Over 100M — benchmark Qdrant, Milvus, and Pinecone Enterprise specifically.
- Data residency: EU GDPR and sector-specific regulations may require on-premises or EU-region-only deployment. Qdrant and Weaviate support fully self-hosted deployments.
- Latency SLA: What is acceptable p99 query latency? Sub-10ms requires HNSW with tuned index parameters and sufficient memory allocation.
- Hybrid search requirement: Does the application need to combine keyword (BM25) and semantic search? Weaviate ships this natively; others require external implementation.
For enterprises evaluating the broader AI infrastructure stack, our analysis of why AI projects fail documents the most common infrastructure selection mistakes — many of which involve mismatched database architecture.
Open-source options (Qdrant, Milvus, Weaviate) offer full deployment control and no per-query pricing — critical for high-volume workloads. Managed services (Pinecone, Zilliz Cloud) trade cost predictability for operational simplicity. Neither is universally superior.
Ready to accelerate your AI journey?
Book a free 30-minute consultation with our AI strategists.
Book ConsultationWhen to Use a Vector Database — and When Not To
In short
A vector database is the right choice when your application requires similarity search over unstructured data at scale. It is the wrong choice when your workload is purely transactional, structured, or low-volume enough for a vector extension on an existing database.
The decision is architectural. Deploying a vector database adds infrastructure, operational overhead, and embedding pipeline complexity. That cost is justified when the capability it provides is genuinely required.
Use a Vector Database When:
- You are building a RAG pipeline that retrieves from a knowledge base of more than 10,000 documents
- Your search interface must understand intent, synonyms, or cross-lingual queries — not just exact keyword matches
- You need to search across unstructured content: PDFs, emails, support tickets, meeting transcripts, product images
- Your recommendation engine needs to find similar items based on semantic or behavioural similarity, not explicit category tags
- Query latency must be under 100ms at scale — brute-force similarity search on your existing SQL DB will not achieve this
- You need hybrid search: combining semantic similarity with structured metadata filters (date range, department, access tier)
Skip a Vector Database When:
- Your dataset is under ~100,000 records and query volume is low —
pgvectoron an existing PostgreSQL instance is sufficient and operationally simpler - Your queries are purely transactional: "give me all orders for customer ID 4821 placed in Q1" — SQL is the right tool
- You have no embedding pipeline in place and no AI model to generate vectors — the database alone does nothing without embeddings
- Your organisation lacks MLOps capability to maintain embedding model versioning — stale embeddings silently degrade search quality over time
Across our 100+ enterprise AI implementations, the most common mistake we observe is deploying a vector database before the embedding pipeline and data quality foundations are in place. The database is the last piece — not the first.
For organisations earlier in their AI maturity journey, our AI implementation roadmap sets out the sequenced infrastructure decisions that precede a production vector database deployment.
| Condition | Recommendation |
|---|---|
| Under 100K vectors, low query volume | pgvector or MongoDB Atlas Vector Search extension |
| 100K–10M vectors, moderate query volume | Purpose-built vector DB (Qdrant, Weaviate, Chroma) |
| 10M+ vectors, enterprise SLA requirements | Enterprise tier: Pinecone Enterprise, Zilliz Cloud, or self-hosted Qdrant/Milvus |
| On-premises / EU data residency required | Self-hosted Qdrant or Weaviate |
| Rapid prototyping / proof of concept | Chroma (embedded) or Pinecone Serverless (no infrastructure) |
Implementing a Vector Database in an Enterprise Environment
In short
A production vector database deployment requires four components beyond the database itself: an embedding pipeline, a chunking strategy, a metadata schema, and an index tuning plan. Skipping any one of these is the primary cause of poor search quality.
Selecting a vector database vendor is the straightforward part. The hard work is building the surrounding infrastructure that determines whether search quality is production-ready.
Based on Alice Labs' implementation experience across more than 100 enterprise AI projects in Sweden and Europe, the following architecture pattern consistently delivers the best retrieval quality in production RAG and search deployments.
Chunking Strategy: The Most Underestimated Variable
LLMs have context windows. Vector databases store chunks — discrete segments of source documents. Chunk size directly determines retrieval quality: too large, and the retrieved context is noisy; too small, and it loses coherent meaning.
Production-tested defaults:
- 512 tokens with 10–15% overlap: the standard starting point for most text retrieval tasks
- Semantic chunking: split on paragraph or section boundaries, not fixed token counts — preserves coherent units of meaning
- Hierarchical chunking: store both full-document and chunk-level embeddings; retrieve chunks but return document context to the LLM
Embedding Model Selection and Versioning
The embedding model must remain consistent across the entire collection. Mixing embeddings from different model versions (e.g., text-embedding-ada-002 and text-embedding-3-large) in the same index produces incoherent similarity scores.
When upgrading the embedding model, the entire collection must be re-embedded. This is a planned infrastructure event — not a routine update. Enterprises should treat embedding model selection with the same governance rigour as database engine selection.
For teams building the broader MLOps infrastructure to manage this, our guide on what is MLOps covers model versioning and pipeline governance in depth.
Index Tuning for Production Latency
HNSW has two primary tuning parameters that govern the trade-off between build time, memory usage, recall, and query latency:
ef_construction: controls index build quality. Higher values improve recall at the cost of slower index build time. Typical range: 100–400.m(max connections): controls graph connectivity. Higher values improve recall but increase memory usage. Typical range: 16–64.ef(search ef): controls query-time recall. Increase this to improve recall at the cost of higher query latency.
Start with vendor-recommended defaults. Benchmark recall and p99 latency against your specific dataset before tuning — the optimal parameters are workload-dependent.
If your vector database stores personal data as part of a high-risk AI system, GDPR and EU AI Act obligations apply to the retrieval layer — not just the LLM. Data minimisation, access controls, and right-to-erasure (including vector deletion) must be accounted for in architecture design. See our EU AI Act compliance guide for implementation-level detail.
Frequently Asked Questions: Vector Databases
In short
The most common enterprise questions about vector databases cover cost, compatibility with existing stacks, latency benchmarks, and when to build vs. buy embedding infrastructure.
What is a vector database in simple terms?
A vector database stores data as lists of numbers (called embeddings) that represent meaning. When you search, it finds the numbers most mathematically similar to your query — rather than matching exact words. This is what allows AI search to understand intent.
Can I just use PostgreSQL with pgvector instead of a dedicated vector database?
Yes — for collections under approximately 100,000 vectors at low query volume, pgvector on PostgreSQL is a practical and operationally simpler choice. Above that threshold, or with sub-10ms latency requirements, purpose-built vector databases (Qdrant, Pinecone, Weaviate) outperform extensions on every benchmark dimension.
How fast is vector database search?
At production scale, HNSW-indexed vector databases achieve sub-10ms latency at the 99th percentile for collections of up to hundreds of millions of vectors. A 2025 arXiv study of Qdrant on HPC platforms demonstrated consistent sub-millisecond retrieval at scale using HNSW indexing.
How many dimensions do vector embeddings need?
Modern language models produce embeddings of 768–3,072 dimensions (per OpenAI and Google model documentation, 2024). Higher dimensions capture finer semantic distinctions but increase storage costs and index build time. For most enterprise text search workloads, 1,536-dimensional embeddings (OpenAI text-embedding-3-small) provide an effective quality-cost balance.
What is the connection between vector databases and RAG?
Retrieval-augmented generation (RAG) depends entirely on a vector database. The vector DB stores embeddings of your organisation's documents. When a user asks a question, the query is embedded and the top-k most relevant document chunks are retrieved from the vector DB. Those chunks are then injected into the LLM prompt as grounding context — preventing hallucination. See our dedicated guide: what is RAG.
How much does a vector database cost?
Costs vary significantly by deployment model. Self-hosted open-source (Qdrant, Milvus, Weaviate) — infrastructure cost only, typically €200–€2,000/month depending on scale. Managed cloud services — Pinecone Serverless starts at $0.033 per million vectors stored; enterprise tiers are negotiated by contract. Total cost of ownership for managed services at high query volumes typically exceeds self-hosted at the 10M+ vector scale.
Are vector databases GDPR-compliant?
Vector databases themselves are storage systems — GDPR compliance depends on what data is embedded and how access is controlled. If personal data is embedded (e.g., customer support tickets), data minimisation, access controls, retention policies, and the right to erasure (including vector deletion) all apply. Enterprises operating under EU AI Act high-risk classifications face additional obligations at the retrieval layer.
Is vector database technology enterprise-ready?
Yes. Forrester's Q3 2024 Wave evaluated 14 vendors across 25 enterprise criteria — a clear signal of market maturity. The global market is projected to reach $8.95B by 2030 (MarketsandMarkets, 2024), growing at 23.7% CAGR. Leading providers offer SOC 2 Type II compliance, SLA-backed uptime, and enterprise support contracts. The technology is in active production at Fortune 500 companies and major European enterprises.
About the Authors & Reviewers

Co-Founder, Alice Labs
Co-Founder at Alice Labs. Builds AI automation, agent workflows and integration systems that hold up in real business operations.
- AI automation & agent systems lead
- Workflow design across 100+ deployments
- Specialist in RAG, integrations & APIs

Co-Founder, Alice Labs
Co-Founder at Alice Labs. Author of 7 research reports on AI adoption, governance and labor markets cited across EU, OECD and US benchmarks.
- 8+ years in AI strategy & implementation
- Top-5 AI Speaker, Sweden (Mindley 2025)
- 100+ enterprise AI engagements
Frequently Asked Questions
What is a vector database in simple terms?
A vector database stores data as lists of numbers (embeddings) that represent semantic meaning. When you search, it finds the most mathematically similar numbers to your query — understanding intent rather than matching exact words.
Can I use PostgreSQL with pgvector instead of a dedicated vector database?
For collections under ~100,000 vectors at low query volume, pgvector is sufficient. Above that scale, or with sub-10ms latency requirements, purpose-built vector databases (Qdrant, Pinecone, Weaviate) consistently outperform extensions.
How fast is vector database search?
HNSW-indexed vector databases achieve sub-10ms latency at p99 for hundreds of millions of vectors. A 2025 arXiv study of Qdrant on HPC platforms demonstrated consistent sub-millisecond retrieval at scale.
What is the connection between vector databases and RAG?
RAG (retrieval-augmented generation) depends on a vector database as its retrieval layer. The vector DB stores document embeddings; at query time, the most relevant chunks are retrieved and injected into the LLM prompt as grounding context — preventing hallucination.
How many dimensions do vector embeddings need?
Modern language models produce 768–3,072 dimensional embeddings (OpenAI and Google, 2024). For most enterprise text search, 1,536-dimensional embeddings provide an effective quality-cost balance.
How much does a vector database cost?
Self-hosted open-source options (Qdrant, Milvus, Weaviate) cost infrastructure only — typically €200–€2,000/month at scale. Managed cloud services like Pinecone Serverless start at $0.033 per million vectors stored; enterprise tiers are contract-negotiated.
Are vector databases GDPR-compliant?
Compliance depends on what data is embedded and how it is governed. If personal data is stored as embeddings, GDPR obligations apply — including data minimisation, access controls, and the right to erasure (vector deletion). EU AI Act high-risk classifications add further retrieval-layer requirements.
Is vector database technology enterprise-ready in 2024?
Yes. Forrester's Q3 2024 Wave evaluated 14 vendors across 25 criteria. The market is projected to reach $8.95B by 2030 at 23.7% CAGR (MarketsandMarkets, 2024). Leading providers offer SOC 2 Type II compliance and enterprise SLAs.
What Is Fine-Tuning? LLM Customization Explained for Enterprises
Next in AI ImplementationWhat Is Prompt Engineering? Techniques & Enterprise Use Cases
Further reading
- Marketsandmarkets· marketsandmarkets.com
- Grandviewresearch· grandviewresearch.com
- Forrester· forrester.com
- Forrester· forrester.com
Related services
Related reading
What Is RAG? Retrieval-Augmented Generation Explained
RAG (Retrieval-Augmented Generation) connects LLMs to external knowledge bases for accurate, source-grounded answers. Architecture, use-cases & enterprise guide.
dataAI Implementation Roadmap: From Pilot to Production
Explore the AI implementation roadmap from pilot to production, ensuring successful deployment with our comprehensive guide.
howtoWhat Is MLOps? Machine Learning Operations Explained
MLOps (Machine Learning Operations) automates ML model deployment, monitoring, and management. Learn the definition, platforms, and MLOps vs DevOps.
deepdiveWhy Ai Projects Fail
Most AI projects fail before reaching production. Based on RAND, MIT Sloan, and 100+ Alice Labs engagements — the 7 root causes, with concrete fixes for each.
Sources
- Vector Database Market Size, Share & Trends Analysis ReportMarketsandMarkets“Global vector database market projected to reach $8.95B by 2030”
- Vector Database Market ReportGrand View Research“23.7% CAGR projected for vector database market, 2024–2030; $7.34B by 2030”
- The Forrester Wave™: Vector Databases, Q3 2024Forrester“14 vendors evaluated across 25 criteria”
- The Vector Databases Landscape, Q2 2024Forrester“24 vector database vendors mapped in the market landscape”
- Distributed Vector Similarity Search on HPC PlatformsarXiv“Qdrant HNSW demonstrated consistent sub-millisecond recall at billion-vector scale on HPC platforms”
- Vector Databases: Fundamental Concepts and Use CasesScienceDirect / Elsevier“Peer-reviewed analysis of primary production deployment patterns for enterprise vector databases”
- Embedding Model DocumentationOpenAI / Google“Modern language model embeddings range from 768 to 3,072 dimensions”
Next scheduled review: