Skip to content
Tracked since2026
0 reviews tracked

The Bottom Line

Entry price

Free, no paid tier

Biggest pro

Native PostgreSQL

Biggest con

PostgreSQL only

TL;DR - pgvector

  • pgvector is an open-source PostgreSQL extension for vector similarity search, allowing users to store and query vectors directly within their database.
  • It supports various distance metrics (L2, inner product, cosine, L1, Hamming, Jaccard) and vector types (single-precision, half-precision, binary, sparse).
  • pgvector offers both exact and approximate nearest neighbor search, with approximate search enabled by HNSW and IVFFlat indexes for improved performance.
Pricing: Free forever
Best for: Individuals & startups

What is pgvector?

Editorial review
pgvector is an open-source PostgreSQL extension for vector similarity search. Enables storing embeddings and performing similarity queries directly in your PostgreSQL database.

Available on: Linux, macOS, Windows

Pros & Cons

Pros

  • Native PostgreSQL
  • No separate service
  • Open source

Cons

  • PostgreSQL only
  • Limited compared to specialized DBs

Preview

Key Features

Vector storageSimilarity searchPostgreSQL nativeMultiple indexesExact and approximate searchOpen source

Pricing Plans

Open Source

Free

  • Full source code access
  • Other license
  • Community support
  • Self-hosted

Reviews

Be the first to review pgvector

Your take helps the next buyer. Verified LinkedIn reviewers get a badge.

Write a review

Best pgvector Alternatives

Top alternatives based on features, pricing, and user needs.

View full list →

Most buyers shortlist 2 or 3 tools before committing. Pull a side-by-side comparison or browse the full alternatives shortlist below.

Explore More

pgvector FAQ

What types of vector similarity search does pgvector support?

pgvector supports both exact and approximate nearest neighbor search. It can work with single-precision, half-precision, binary, and sparse vectors.

Which distance metrics are available in pgvector?

pgvector supports several distance metrics including L2 distance, inner product, cosine distance, L1 distance, Hamming distance, and Jaccard distance. The Hamming and Jaccard distances are specifically for binary vectors.

How can I install pgvector on a Linux or Mac system?

To install pgvector on Linux or Mac, clone the repository, navigate to the directory, and then run make followed by make install. This process supports Postgres 13 and newer versions.

What is the purpose of adding an index in pgvector?

Adding an index in pgvector enables approximate nearest neighbor search, which improves query speed by trading off some recall. This means queries with an approximate index may yield slightly different results compared to an exact search.

Which index types does pgvector support for approximate nearest neighbor search?

pgvector supports HNSW and IVFFlat index types for approximate nearest neighbor search. An HNSW index, for example, creates a multilayer graph to optimize query performance.

How do I calculate cosine similarity using pgvector?

To calculate cosine similarity, you can use the formula 1 - (embedding <=> '[3,1,2]'). The <=> operator returns the cosine distance, so subtracting it from 1 yields the similarity.

Source: github.com

Guides & Articles