Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

pgvector

by pgvector (open source project)

Search by meaning inside your Postgres database.

Vector databases

WebsiteGitHub

1. Price

No free tier on the pricing page. As reported on the official pricing page, checked Oct 10, 2026.

github.com/pgvector/pgvector

Checked against the maker's official pages, pricing on Oct 10, 2026. Tap a verdict to see its source.How we checkedReport an error

What pgvector does

pgvector is a free add-on for the Postgres database, not an online service with its own key. It lets your database store embeddings, lists of numbers that describe the meaning of a text or picture, next to your normal rows. Then one query finds the rows closest in meaning, such as similar products or matching help articles.

  • pgvector is one of 24 APIs in the Vector databases category on AgentGid.
  • It is one of 19 that can be started for free.
  • 13 of them ship an official MCP server; pgvector does not.
  • Its official SDK is the 3rd most downloaded in the category (11.4M a week).

What people build with it

Answers from your own documents

Store your help articles or notes with their embeddings, find the passages closest to a question, and give them to an AI model to answer from.

Similar products on a shop page

Show "you may also like" items whose descriptions or photos are closest to the one a shopper is looking at.

Search inside one customer's data

In an app with many customers, each search looks only at that customer's rows, and the closest matches still come back first.

Keyword and meaning search together

Combine normal word search with search by meaning, so exact product codes and loosely worded questions both find the right page.

Find pictures that look alike

Store an embedding for every uploaded image and find the ones that look closest to a new picture.

Spot duplicate support tickets Idea

When a new ticket comes in, look up earlier tickets with the closest meaning and link them, so the team answers once.

pgvector popularity

12.1M
SDK downloads a week
+20.1% on the 4-week average
209
public agent repos use its SDK
23.8K
GitHub stars, pgvector/pgvector
SDK downloads per weeknpm pgvector, pypi pgvector 12,052,456

SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.

Pricing

Free tier

None

Cheapest plan

No monthly plan

Usage price

—

Plans

Free extension; available on most managed Postgres services (pricing is the host's).

As reported on the official pricing page, checked Oct 10, 2026. Prices change: confirm before you buy.

Limits

All installs (open source)

A vector column holds up to 16,000 dimensions

All installs (open source)

HNSW and IVFFlat indexes on the vector type cover up to 2,000 dimensions (halfvec up to 4,000)

All installs (open source)

Postgres 13 or newer

From the official docs. github.com/pgvector/pgvector/blob/master/README.md

Key and access

How it signs in

No pgvector account or key. Your app connects to your own Postgres database with its user and password.

Environment variable
none from pgvector; Postgres client libraries read PGHOST, PGUSER and PGPASSWORD (or a connection string you pass)
Safe in browser code
No, keep it on your server
Card at sign-up

No

Steps only a person can do

  • Choose where the database runs (a hosted Postgres that offers pgvector, or your own server) and create a database user. Read the connection details from .env on the server and run CREATE EXTENSION vector once per database.
  • Pick the embedding model or service that will turn your texts or images into numbers (it may need its own paid key). Size the vector column to that model's number of dimensions.

Commercial use and your data

Free and open source under the PostgreSQL License. You may use, change and pass it on for any purpose, also in paid products, as long as the copyright notice stays in copies.

In a paid app
Yes

Use for any purpose without fee under the PostgreSQL License.

“Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted” source

redistribute-files
With conditions

Shipping pgvector itself (for example in a database image) is allowed if the copyright notice and license paragraphs stay in the copies.

“provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.” source

client-work
Yes

Any purpose is allowed, paid or not.

“Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted” source

Errors to handle

fatal error: postgres.h: No such file or directory

Building pgvector failed because the Postgres development files are missing.

Install the server development package for your Postgres version (for example postgresql-server-dev-18), then build again.

Illegal instruction

The extension was compiled on one machine with native CPU flags and run on another.

Rebuild with make OPTFLAGS="" for a portable build.

Fewer results after adding an HNSW index

The search list (hnsw.ef_search) is 40 by default, and filters are applied after the index scan.

Turn on iterative index scans (SET hnsw.iterative_scan = strict_order) or raise hnsw.ef_search.

Query does not use the vector index

The query sorts by an expression or has no LIMIT.

ORDER BY the distance operator itself, ascending, with a LIMIT.

Use it from an agent

Our agent check

3 of 6: llms.txt yes, OpenAPI no, SDK yes, MCP no, status page no, AI assistants allowed yes

Checked Nov 13, 2026.

MCP server

None found

npm
npm install pgvector
PyPI
pip install pgvector

Alternatives

pgvector This page

Free (open source)No free tier

Supabase (pgvector)

Pick Supabase when you want hosted Postgres with pgvector already there, plus sign-in, file storage and ready APIs.

Free (open source)Free tierOfficial MCP

Qdrant Cloud

Pick Qdrant Cloud when you want a separate managed search engine built only for vectors.

Free (open source)Free tierOfficial MCP

LanceDB

Pick LanceDB when you want vector search embedded in your app or in its cloud, without running Postgres.

See its pageNo free tier

All vector databases APIs

Get started

Tell your AI assistant

“Add pgvector to my Postgres: enable the extension, add an embedding column sized to my embedding model, add an HNSW index with the matching distance ops, and query with ORDER BY distance and LIMIT from server code.”

  1. Install the extension on your Postgres server (or pick a hosted Postgres that already has it).

    cd /tmp
    git clone --branch v0.8.7 https://github.com/pgvector/pgvector.git
    cd pgvector
    make
    make install # may need sudo

    From github.com/pgvector/pgvector/blob/master/README.md

  2. Turn it on once in each database that should use it.

    CREATE EXTENSION vector;

    From github.com/pgvector/pgvector/blob/master/README.md

  3. Add a vector column and search for the nearest rows.

    CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
    SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;

    From github.com/pgvector/pgvector/blob/master/README.md

First request

pgvector has no hosted service; this is the Getting Started SQL from the README, and the response is from our own run of it in PGlite 0.5.16 with pgvector 0.8.7.

CREATE EXTENSION vector;
CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');
SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;

Mistakes to avoid

Sorting by 1 - cosine distance DESC to get the most similar rows.
ORDER BY the cosine distance operator itself, ascending, with LIMIT, and compute similarity in the SELECT list.

An expression in ORDER BY stops Postgres from using the vector index.

Creating an IVFFlat index on an empty table right after CREATE TABLE.
Load data first, then create the IVFFlat index (or use HNSW, which needs no data to build).

An IVFFlat index built with too little data returns fewer results.

An HNSW index on vector(3072) for a large embedding model.
Store halfvec(3072) or index an expression cast to halfvec, which indexes up to 4,000 dimensions.

Indexes on the vector type stop at 2,000 dimensions.

Building the index with one distance and querying with another.
Match the ops class to the operator, for example vector_cosine_ops for cosine distance queries.

Each distance function needs its own index.

Passing Python lists to psycopg without registering the vector type.
Call register_vector(conn) after connecting (or in the pool's configure callback).

The Python helper needs the types registered on each connection.

Questions

Do I need an account or a key for pgvector?

No. It is a free extension that runs inside your own Postgres; you only need the database login.

Which programming languages can use it?

Any language with a Postgres client; the project keeps helper libraries for Python, JavaScript, Go, Ruby and many more.

My embeddings have 3,072 numbers. Can I index them?

The vector type indexes up to 2,000 dimensions; use half-precision vectors (up to 4,000) or binary quantization for more.

Does it work with backups and replicas?

Yes. It uses the Postgres write-ahead log, so replication and point-in-time recovery work.

How do I update it later?

Install the new version the same way, then run ALTER EXTENSION vector UPDATE in each database.