RAGFrameworks

pgvector — Open-Source Vector Similarity Search for Postgres

by pgvector (Andrew Kane)

IntermediateDocumentationFree~2-3 hours to read end-to-end, then ongoing reference

Run RAG retrieval inside the Postgres you already operate — HNSW indexes, metadata filters and hybrid search, in SQL.

Start LearningAdded Aug 12, 2026 · Updated Aug 12, 2026

Overview

pgvector 0.8.6 (released 29 July 2026) is maintained by Andrew Kane and has 22.6k GitHub stars; its README doubles as the project's complete documentation and reads as a reference manual rather than a tutorial. It opens with installation paths for Linux, macOS, Windows, Docker and the major managed Postgres services, then walks through storing embeddings in the vector column type and querying them with the distance operators <-> (L2), <=> (cosine) and <#> (inner product), plus Hamming and Jaccard equivalents for bit vectors. Separate sections cover the two index types — HNSW, which builds a multilayer proximity graph with the better speed-recall tradeoff at the cost of slower builds and more memory, and IVFFlat, which is cheaper to build — including the m, ef_construction, ef_search, lists and probes knobs that actually decide recall. The harder production topics each get their own section: filtering and the iterative index scans (hnsw.iterative_scan, hnsw.max_scan_tuples) added in 0.8 to stop a selective WHERE clause from destroying recall, multitenancy via partial indexes, hybrid search combining tsvector full-text ranking with vector distance, subvector indexing, and the half-precision (halfvec), binary (bit) and sparsevec types for cutting storage. It closes with a performance chapter on loading, index build parallelism, vacuuming and monitoring, a table of client libraries for 40+ languages, and a full operator and function reference plus FAQ. Six point releases shipped in the past twelve months, most of them HNSW and IVFFlat correctness fixes.

At a Glance

Topic
RAG
Level
Intermediate
Format
Documentation
Cost
Free
Duration
~2-3 hours to read end-to-end, then ongoing reference
Provider
pgvector (Andrew Kane)
Hands-on
Yes — code/exercises
Certificate
None

What You’ll Learn

  • Store and query embeddings in Postgres using the native vector column type
  • Choose between HNSW and IVFFlat indexes based on build time, memory and recall
  • Tune ef_search, m, lists and probes to hit a target recall at a target latency
  • Combine tsvector full-text ranking with vector distance for hybrid search in SQL
  • Use iterative index scans and partial indexes so metadata filters keep recall high
  • Cut storage with halfvec, binary and sparsevec types and binary quantization
  • Profile index usage with EXPLAIN and tune loading, vacuuming and build parallelism

Highlights

  • The README is the full reference — there is no separate docs site to fall out of date
  • 0.8.6 shipped 29 July 2026; six point releases in the past twelve months
  • Vectors live beside relational data, so JOINs, transactions, PITR and backups still apply
  • 22.6k stars and client libraries for 40+ languages, from Python and Go to Rust and Zig
  • Iterative index scans (0.8+) address the filtered-search recall problem most RAG tutorials skip

Who It’s For

Best For

  • Backend engineers adding RAG retrieval to an application that already runs Postgres
  • AI engineers who would rather not operate a second, dedicated vector database
  • Teams debugging poor recall on filtered or hybrid vector search

Prerequisites

  • Working SQL and basic PostgreSQL administration — extensions, indexes, EXPLAIN
  • Understanding of text embeddings and cosine/L2 distance

FAQ

What is pgvector — Open-Source Vector Similarity Search for Postgres?

pgvector is the open-source PostgreSQL extension that adds a native vector type and approximate-nearest-neighbour indexing, letting you keep RAG retrieval in the database that already holds your application data. Its README is the canonical, complete documentation. Read it and you can build a production hybrid-search stack — embeddings, HNSW indexes, metadata filters and full-text ranking — without adopting and operating a separate vector database.

Is pgvector — Open-Source Vector Similarity Search for Postgres free?

pgvector — Open-Source Vector Similarity Search for Postgres is free to access.

What level is pgvector — Open-Source Vector Similarity Search for Postgres for?

pgvector — Open-Source Vector Similarity Search for Postgres is aimed at a intermediate audience. Recommended background: Working SQL and basic PostgreSQL administration — extensions, indexes, EXPLAIN, Understanding of text embeddings and cosine/L2 distance.

How long does pgvector — Open-Source Vector Similarity Search for Postgres take?

Expect roughly ~2-3 hours to read end-to-end, then ongoing reference. Most learners work through it at their own pace.

What will I learn from pgvector — Open-Source Vector Similarity Search for Postgres?

You'll learn: Store and query embeddings in Postgres using the native vector column type; Choose between HNSW and IVFFlat indexes based on build time, memory and recall; Tune ef_search, m, lists and probes to hit a target recall at a target latency; Combine tsvector full-text ranking with vector distance for hybrid search in SQL; Use iterative index scans and partial indexes so metadata filters keep recall high; Cut storage with halfvec, binary and sparsevec types and binary quantization; Profile index usage with EXPLAIN and tune loading, vacuuming and build parallelism.

Topics

pgvectorpostgresvector-searchhnswhybrid-searchrag

Sources

This page was written from 3 sources, 2 on domains other than github.com.

  1. 1.github.compgvectorvendor
  2. 2.crunchydata.comhybrid vector search
  3. 3.raw.githubusercontent.comCHANGELOG.md