5,351,251 AI resources indexedWorking toward the world’s largest AI resource index.

pgvector for PostgreSQL

A PostgreSQL extension that adds vector columns, similarity operators, and approximate search indexes.

Published by pgvector contributors

PDF
No ratings yet

How to use it

Use a vector column for each passage embedding and retain the existing SQL columns that identify the document, section, and access scope. That makes it possible to constrain retrieval using your normal database rules.

Start with exact nearest-neighbor queries and compare them to HNSW or IVFFlat results at a fixed cutoff. Keep the index operator class consistent with the similarity metric your embedding model expects.

Compatibility
PostgreSQL, SQL
Components
Vector database extension, SQL filtering, Approximate nearest neighbors
Access
Local PostgreSQL extension. Requires a PostgreSQL installation that supports the extension.
Official resource