GroveAI
technical

What is a vector database?

Quick Answer

A vector database stores and searches data as mathematical vectors (embeddings) rather than traditional rows and columns. This enables semantic search, where queries find results based on meaning rather than exact keyword matches. Vector databases are the foundation of RAG systems, powering AI-driven search, recommendation engines, and knowledge bases that understand context and intent.

Summary

Key takeaways

  • Stores data as mathematical representations of meaning, not just text
  • Enables semantic search that understands context and intent
  • Essential component of RAG and AI-powered knowledge systems
  • Popular options include Pinecone, Weaviate, Qdrant, and pgvector

How Vector Databases Work

Vector databases store data as high-dimensional vectors, where each vector represents the semantic meaning of a piece of content. When you add a document to a vector database, an embedding model converts the text into a vector of numbers, typically 768 to 3,072 dimensions. These numbers capture the meaning and relationships within the text. When you search, your query is converted into a vector using the same embedding model, and the database finds the stored vectors most similar to your query vector. This similarity search, typically using algorithms like HNSW or IVF, is extremely fast even across millions of vectors. The result is that searching for 'employee leave policy' will find documents about 'annual holiday entitlement' or 'time off procedures' even though the exact words differ.

Choosing the Right Vector Database

The right vector database depends on your scale, infrastructure, and requirements. For small to medium deployments, pgvector extends PostgreSQL with vector capabilities, avoiding the need for a separate database. For larger deployments requiring high performance, dedicated solutions like Pinecone (managed cloud), Weaviate (open-source, self-hosted or cloud), and Qdrant (open-source, highly performant) are popular choices. Consider factors including: hosting preference (managed vs self-hosted), filtering capabilities for metadata, scalability requirements, integration with your existing stack, and cost. For most initial RAG projects, starting with pgvector or a managed service like Pinecone provides the fastest path to production.

FAQ

Frequently asked questions

Not always. For smaller projects, pgvector (PostgreSQL extension) or SQLite with vector support can handle the job without adding infrastructure complexity. Dedicated vector databases become necessary at scale or when you need advanced features like real-time indexing.

Open-source options like Qdrant and Weaviate are free to self-host. Managed services typically start at £50 to £200 per month for small deployments. Enterprise deployments with millions of vectors cost £500 to £5,000+ per month depending on the provider and scale.

No. Vector databases complement traditional databases rather than replacing them. Use your existing database for structured data and transactions, and add a vector database specifically for semantic search and AI retrieval capabilities.

Vector databases scale through sharding, distributing vectors across multiple nodes, and using approximate nearest neighbour algorithms that trade small accuracy margins for significant speed improvements. Cloud-managed services handle scaling automatically. Self-hosted solutions require manual capacity planning.

Yes. Modern vector databases support real-time search with sub-100 millisecond query latency at scale. They can handle thousands of concurrent queries. Real-time indexing allows new documents to be searchable immediately after ingestion.

Have more questions about AI?

Our team can help you navigate the AI landscape. Book a free strategy call.