pgvector logo

pgvector

Free

PostgreSQL Ecosystem

FreeFree tier
Inputs: text
Type
Open Source

About pgvector

pgvector is an open-source extension for PostgreSQL that enables high-performance vector similarity search. It supports exact and approximate nearest neighbor search, multiple vector types (single-precision, half-precision, binary, and sparse), and a variety of distance functions including L2, inner product, cosine, L1, Hamming, and Jaccard distance. Vectors can be stored alongside traditional relational data, leveraging PostgreSQL's ACID compliance, point-in-time recovery, JOINs, and indexing capabilities. It can be installed via package managers like Homebrew, APT, Yum, or Docker, and works with any language that has a PostgreSQL client.

Key Features

Exact and approximate nearest neighbor search
Support for single-precision, half-precision, binary, and sparse vectors
Multiple distance functions: L2, inner product, cosine, L1, Hamming, Jaccard
Full PostgreSQL feature integration: ACID compliance, JOINs, point-in-time recovery
Quantization for scaling large vector datasets
Any language with a PostgreSQL client can use it
Easy installation via Docker, Homebrew, PGXN, APT, Yum, and more

Pros & Cons

Pros
  • Native integration with PostgreSQL eliminates the need for a separate vector database
  • Supports multiple distance metrics and vector types for flexibility
  • ACID compliance and transactional guarantees inherited from PostgreSQL
  • Open source with active community development
  • Broad installation options including package managers and Docker
Cons
  • Approximate nearest neighbor search performance depends on indexing parameters and may require tuning
  • Not horizontally scalable like some dedicated vector databases (relies on PostgreSQL scaling approaches)

Best For

Storing and querying vector embeddings alongside relational dataSemantic search and recommendation systemsSimilarity-based retrieval in any application using PostgreSQLLeveraging PostgreSQL's ecosystem for vector search in production

FAQ

What is pgvector?
pgvector is an open-source PostgreSQL extension that provides vector similarity search capabilities, allowing you to store and query vector embeddings directly within PostgreSQL.
How do I install pgvector?
You can install pgvector from source (via git clone, make, make install), or via package managers such as Docker, Homebrew, APT, Yum, PGXN, conda-forge, and others. Detailed installation instructions are available on the GitHub repository.
What distance functions does pgvector support?
pgvector supports L2 distance, inner product, cosine distance, L1 distance, Hamming distance, and Jaccard distance.