pgvector Documentation
pgvector is the foundational open-source vector similarity search extension for PostgreSQL. It provides the core vector, halfvec, bit, and sparsevec data types, distance operators, and built-in HNSW and IVFFlat index access methods.
vchordKey Features
- Exact and approximate nearest-neighbor search inside standard PostgreSQL tables with full ACID transactions, point-in-time recovery, joins, and filtering.
- Multiple vector representations:
- Single-precision floating-point vectors (
vector, up to 2,000 dimensions indexed; up to 16,000 dimensions stored) - Half-precision floating-point vectors (
halfvec, up to 4,000 dimensions indexed) - Binary vectors (
bit, up to 64,000 dimensions indexed) - Sparse vectors (
sparsevec, up to 1,000 non-zero elements across up to 1,000,000 dimensions)
- Single-precision floating-point vectors (
- Six distance metrics: L2 distance (
<->), inner product (<#>), cosine distance (<=>), L1 distance (<+>), Hamming distance (<~>), and Jaccard distance (<%>). - Iterative index scans (
0.8.0+) that automatically expand HNSW or IVFFlat candidate traversal whenWHEREfilters narrow the result set.
Documentation Sections
Install pgvector via Pigsty, Docker, Linux packages, Homebrew, or source; enable the extension; and insert or bulk-load vectors.
Distance operators, similarity calculations, vector aggregates, WHERE filtering with iterative index scans, and hybrid search.
Create and tune HNSW and IVFFlat indexes, parallel index build settings, progress monitoring, and scaling with vchord.
Half-precision (halfvec), binary quantization (bit + re-ranking), sparse vectors (sparsevec), and Matryoshka sub-vector indexing.
Complete SQL function and operator reference, GUC parameters, memory sizing, query plan debugging, and frequently asked questions.
Drop-in RaBitQ vchordrq and vchordg indexes on standard pgvector columns for 100M+ vectors without changing queries.