[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-pgvector::en":3,"gloss-cluster-pgvector::en":19,"gloss-next-pgvector::en":8},{"slug":4,"category":5,"name":4,"definition":6,"meta_desc":7,"faq":8,"schema_markup":8,"related":9},"pgvector","data-infra","pgvector is an open-source extension that turns an ordinary PostgreSQL database into a capable vector store, adding a `vector` column type, distance operators (`\u003C->` for Euclidean, `\u003C=>` for cosine, `\u003C#>` for inner product), and index types (IVFFlat and HNSW) for fast approximate nearest neighbor search. Why it matters for AI\u002FSaaS builders: it lets teams add semantic search or RAG retrieval to a product without introducing a second database system. Most SaaS backends already run Postgres for their core relational data (users, subscriptions, orders); pgvector means embeddings can live in the same database, in the same table even, right next to the rows they describe — joined with a plain SQL `JOIN`, filtered with a plain `WHERE` clause, and covered by the same backups, replication, and transactional guarantees as everything else. That operational simplicity is a major reason pgvector adoption exploded through 2024–2026: one fewer moving part, one fewer vendor bill, one fewer data-sync job to keep the vector store consistent with the source of truth. How it works: after `CREATE EXTENSION vector;`, you add a column like `embedding vector(1536)` to a table, populate it via your application (call an embedding API, `UPDATE` the row), and build an index — `CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops);` — for fast approximate search once row counts grow past a few tens of thousands (below that, a sequential scan is often fast enough and simpler). Queries look like ordinary SQL: `SELECT id, body FROM articles ORDER BY embedding \u003C=> $1 LIMIT 5;` returns the 5 nearest neighbors to a query vector by cosine distance. Because it's just Postgres, you can combine vector similarity with relational filtering and metadata filtering in a single query — no separate filter API, no eventual-consistency lag between two systems. Trade-offs versus dedicated vector databases: at very large scale (tens of millions of vectors with high query throughput) or when you need multi-region replication tuned specifically for vector workloads, purpose-built stores like Pinecone or Qdrant still generally out-perform and out-scale pgvector. Worked example: a project-management SaaS adds an \"AI search\" feature. Instead of standing up Pinecone, they add `embedding vector(1536)` to their existing `tasks` table, backfill it with a batch job calling the embedding API, and build an HNSW index. The search endpoint becomes `SELECT * FROM tasks WHERE workspace_id = $1 ORDER BY embedding \u003C=> $2 LIMIT 10;` — semantic search that respects existing row-level tenant isolation for free, shipped in one migration and one endpoint.","pgvector is an open-source PostgreSQL extension that adds native vector storage and similarity search to a standard Postgres database.",null,[10,13,16],{"slug":11,"name":12},"cosine-similarity","Cosine Similarity",{"slug":14,"name":15},"postgresql","PostgreSQL",{"slug":17,"name":18},"vector-store","Vector Store",[20,24,27,30,33,37,40,43,46,49,53,56],{"slug":21,"category":5,"name":22,"updated_at":23},"acid","ACID","2026-08-24T02:46:37+00:00",{"slug":25,"category":5,"name":26,"updated_at":23},"ann-search","ANN Search",{"slug":28,"category":5,"name":29,"updated_at":23},"backpressure","Backpressure",{"slug":31,"category":5,"name":32,"updated_at":23},"batch-processing","Batch Processing",{"slug":34,"category":5,"name":35,"updated_at":36},"bm25","BM25","2026-08-24T02:46:38+00:00",{"slug":38,"category":5,"name":39,"updated_at":23},"cache","Cache",{"slug":41,"category":5,"name":42,"updated_at":23},"cap-theorem","CAP Theorem",{"slug":44,"category":5,"name":45,"updated_at":23},"change-data-capture","Change Data Capture (CDC)",{"slug":47,"category":5,"name":48,"updated_at":23},"chroma","Chroma",{"slug":50,"category":5,"name":51,"updated_at":52},"chunk-overlap","Chunk Overlap","2026-08-24T03:30:02+00:00",{"slug":54,"category":5,"name":55,"updated_at":23},"columnar-storage","Columnar Storage",{"slug":57,"category":5,"name":58,"updated_at":23},"connection-pooling","Connection Pooling"]