code/+/trust primary logo full color svg

Vector Database

Definition

A vector database is a specialized data store that indexes and retrieves high-dimensional numerical embeddings by similarity rather than by exact match. Vector databases power retrieval-augmented generation (RAG) systems by finding the documents most semantically relevant to a user query in milliseconds, even across millions of stored records.

Traditional databases find rows by exact or pattern-matched values. Vector databases find rows by meaning -- the embedding of "invoice late payment" is close to "overdue bill" even though no words match. This semantic search capability is what makes RAG and AI assistants possible over large document sets.

Common vector database options

  • pgvector -- Postgres extension; easiest to operate if you already use Postgres
  • Pinecone -- managed, serverless; fastest to production
  • Weaviate -- open-source; strong hybrid search (vector + keyword)
  • Qdrant -- open-source; good for on-premises GovCon deployments

When to choose which

For most enterprise AI projects, pgvector on an existing Postgres instance is the lowest-friction starting point. Migrate to a dedicated vector database if you exceed 10 million vectors or need sub-10ms p99 retrieval at scale.

Related terms

Need help implementing this in your business?

Code and Trust translates AI concepts like vector database into working implementations — starting with a workflow audit that shows exactly where it creates ROI.

Schedule AI Audit →