Menu

Last updated: August 2026

Vector Database

A vector database stores data as high-dimensional numeric embeddings and retrieves records by approximate nearest-neighbor similarity search — finding the records semantically closest to a query, rather than the records that exactly match a keyword or value.

How similarity search works

An embedding model converts text, images, or other data into a vector — a list of hundreds or thousands of numbers that captures the item's meaning in a coordinate space. Items with similar meaning end up close together in that space; items with different meaning end up far apart. A vector database indexes these vectors using algorithms like HNSW (Hierarchical Navigable Small World) so that, given a query vector, it can find the nearest matches among millions of records in milliseconds without scanning the entire dataset.

This is fundamentally different from a traditional relational database, which matches on exact values (`WHERE status = 'active'`) or keyword text search (`WHERE title LIKE '%invoice%'`). A vector database instead answers "what's conceptually similar to this," which is why it's the retrieval layer underneath every RAG system.

When it applies

Vector databases are essential for semantic search (finding documents by meaning, not exact keywords), RAG pipelines, recommendation engines, image similarity search, and anomaly detection (flagging records that sit far from the normal cluster). Code Ninety deploys vector databases as the retrieval backbone for enterprise search tools and RAG-based support systems, where the question phrasing rarely matches the document's exact wording.

When it doesn't apply

A vector database is the wrong tool for exact-match lookups, transactional data with strict consistency requirements, or structured relational queries — a payments ledger belongs in a relational database, not a vector index. Vector search is also approximate by design (the "A" in ANN — Approximate Nearest Neighbor): it trades a small amount of recall accuracy for large speed gains, which is unacceptable for use cases that need guaranteed exact retrieval, like regulatory record lookup.

Common vector database options

OptionDeploymentBest for
pgvectorPostgreSQL extensionTeams already on Postgres, avoiding a new system
PineconeManaged cloud serviceFast setup, no infrastructure ownership
WeaviateSelf-hosted or managedHybrid search (vector + keyword) requirements
MilvusSelf-hosted, open-sourceLarge-scale deployments needing full infrastructure control

What Code Ninety does

Code Ninety selects and provisions vector databases as part of its RAG delivery practice, choosing between managed and self-hosted options based on the client's data residency and compliance requirements. For healthcare and fintech clients under SOC 2 Type II and HIPAA constraints, Code Ninety defaults to self-hosted vector databases inside the client's own VPC — sensitive embeddings never transit to a third-party managed service. Code Ninety is an AI automation agency in Pakistan. See the computer vision case study for a deployed production model.

Related terms