{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibyhf457taaop2blvwe4gc6hoic47uhtudwwumgyrldn4x2gvho2e",
    "uri": "at://did:plc:5sgu76a53rz3n6unbykmovqy/app.bsky.feed.post/3mloh7tsnwxz2"
  },
  "description": "pgvector is the popular PostgreSQL extension that adds a vector column type, distance operators, and approximate nearest-neighbour indexes for similarity search over embeddings. It turns any PostgreSQL database into a vector database, removing the operational overhead of running a separate ANN store for many RAG and recommendation workloads.\n\n\nWhat it provides\n\n * vector(N) column type. Stores fixed-dimensional float vectors.\n * Distance operators. L2 distance (<->), inner product (<#>), cosine ",
  "path": "/engineering-glossary/pgvector-postgresql-vector-extension/",
  "publishedAt": "2026-05-12T18:46:42.000Z",
  "site": "https://sahilkapoor.com",
  "tags": [
    "PostgreSQL",
    "Vector Database",
    "Embeddings",
    "RAG"
  ],
  "textContent": "**pgvector** is the popular PostgreSQL extension that adds a `vector` column type, distance operators, and approximate nearest-neighbour indexes for similarity search over embeddings. It turns any PostgreSQL database into a vector database, removing the operational overhead of running a separate ANN store for many RAG and recommendation workloads.\n\n## What it provides\n\n  * **`vector(N)` column type.** Stores fixed-dimensional float vectors.\n  * **Distance operators.** L2 distance (`<->`), inner product (`<#>`), cosine distance (`<=>`).\n  * **Indexes.** IVFFlat (inverted file with flat lists) and HNSW (hierarchical navigable small world); both approximate, both order-of-magnitude faster than brute force.\n  * **Filtered search.** Combine vector similarity with standard SQL `WHERE` clauses (filter by tenant, date, category).\n\n\n\n## Why teams use it\n\n  * Reuses existing PostgreSQL operations, backups, monitoring, and access control.\n  * Co-locates vectors with structured data; no separate sync layer needed.\n  * Standard SQL; familiar to existing engineers.\n  * Available on every managed PostgreSQL platform (RDS, Cloud SQL, Aurora, Supabase, Neon, Crunchy, Azure Database).\n\n\n\n## Tradeoffs versus dedicated vector databases\n\npgvector wins on operational simplicity and filtered queries; dedicated systems (Pinecone, Weaviate, Qdrant, Milvus) tend to scale further on pure vector workloads and offer more index choices and tuning knobs.\n\nšŸ”—\n\n**Related Terms**\nPostgreSQL, Vector Database, Embeddings, RAG.",
  "title": "pgvector",
  "updatedAt": "2026-05-13T19:14:32.028Z"
}