pgvector PostgreSQL Vector Extension
github.com
2
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
pgvector is an open source extension for PostgreSQL that adds vector similarity search capabilities, enabling the database to store and query high dimensional vectors alongside traditional relational data. With over 21,900 GitHub stars and released under the PostgreSQL License, the project is maintained by Andrew Kane and has become the go to solution for building AI and machine learning applications directly within PostgreSQL without requiring a separate vector database. The current version 0.8.3 supports exact nearest neighbor search using standard SQL as well as approximate nearest neighbor search through two index types: HNSW (Hierarchical Navigable Small World) for superior query performance at the cost of more memory, and IVFFlat (Inverted File with Flat Compression) for faster index builds and lower memory usage. The extension supports multiple distance functions including L2 distance for Euclidean similarity, inner product for dot product similarity, and cosine distance for angular similarity. Vector dimensions up to 16,000 are supported with the standard vector type, while the halfvec type provides 16 bit precision for half the storage at up to 4,000 dimensions. Additional types include sparsevec for sparse vectors and binary vectors for binary quantization. The extension integrates seamlessly with pg_dump for backups, supports hybrid search combining semantic and full text search through PostgreSQL tsvector, and works with popular embedding models from OpenAI text-embedding-3-large at 3,072 dimensions, Cohere, and open source alternatives. Companies including OpenAI use it for production AI workloads.
Statistics
2
Views
0
Clicks
0
Like
0
Dislike