What it does
Core capabilities at a glance
- Approximate Nearest Neighbor Search
- Nearest Neighbor Search
Deep dive
The full breakdown - performance, comparisons, and setup
pgvectorLink to this section
pgvector is a local-AI tool - Open-source vector similarity search for Postgres.
OverviewLink to this section
You can also install it with Docker, Homebrew, PGXN, APT, Yum, pkg, APK, or conda-forge, and it comes preinstalled with Postgres.app and many hosted providers. There are also instructions for GitHub Actions.
Ensure C++ support in Visual Studio is installed and run 'x64 Native Tools Command Prompt for VS [version]' as administrator. Then use 'nmake' to build:
By default, pgvector performs exact nearest neighbor search, which provides perfect recall.
You can add an index to use approximate nearest neighbor search, which trades some recall for speed. Unlike typical indexes, you will see different results for queries after adding an approximate index.
An HNSW index creates a multilayer graph. It has better query performance than IVFFlat (in terms of speed-recall tradeoff), but has slower build times and uses more memory. Also, an index can be created without any data in the table since there isn’t a training step like IVFFlat.
A higher value of 'ef_construction' provides better recall at the cost of index build time / insert speed.
An IVFFlat index divides vectors into lists, and then searches a subset of those lists that are closest to the query vector. It has faster build times and uses less memory than HNSW, but has lower query performance (in terms of speed-recall tradeoff).
pgvector is open-source, written primarily in C, with 23,783 GitHub stars under the Other license. It was last updated on 2026-10-08.
Key capabilitiesLink to this section
From the project's documentation:
- exact and approximate nearest neighbor search
- single-precision, half-precision, binary, and sparse vectors
- L2 distance, inner product, cosine distance, L1 distance, Hamming distance, and Jaccard distance
- any language with a Postgres client
-
- (negative) inner product
-
- Hamming distance (binary vectors)
How it fits a local-AI stackLink to this section
pgvector runs on your own hardware, so pair it with a model and a GPU sized to your needs. Use the VRAM calculator to pick a model that fits your card, and see what you can run for hardware guidance. Related local-AI tools in the directory:
SourcesLink to this section
- Source code & docs: pgvector/pgvector
Stats from GitHub, 2026-10-12.
From the community
What users are saying
“Exactly, all your favourite PG types, plus any that come with extensions such as vectors with pgvector. We are working on PostGIS to, which will bring the geo types to PGlite.”
“> Nobody’s actually run this in production We do at Discourse, in thousands of databases, and it's leveraged in most of the billions of page views we serve. > Pre- vs.”
“Hey HN, this one has a cool back story with it that shows the power of open source. The author, Greg[0], wanted to use pgvector in a Postgres services, so he created a PR[1] in our Postgres repo.”
Frequently asked
Quick answers to common questions
What is pgvector?
pgvector is a other tool for local AI workloads. Open-source vector similarity search for Postgres
Is pgvector free and open source?
Yes, pgvector has 23,783 GitHub stars and is licensed under Other. You can self-host it for free on macos, linux, windows, docker.
What platforms does pgvector support?
pgvector runs on macos, linux, windows, docker.
What hardware do I need for pgvector?
The hardware requirements depend on which models you run. Check our hardware directory for compatible GPUs and systems. pgvector has 23,783 GitHub stars and an active community.
Does pgvector support GPU acceleration?
pgvector supports GPU acceleration via CUDA, Metal, or Vulkan depending on your platform. For the best performance, pair it with an NVIDIA RTX 4090 or 5090.
What are the best alternatives to pgvector?
Popular alternatives include other other tools in our directory. Browse our full collection at /tool for comparisons, community reviews, and benchmark data to find the right fit for your workflow.
How much does pgvector cost?
pgvector is free-open-source. It is completely free and open source to self-host.
Pairs well with
Complementary tools, models, and hardware