pgvector
by pgvector (open source project)
Search by meaning inside your Postgres database.
1. Price
No free tier on the pricing page. As reported on the official pricing page, checked Oct 10, 2026.
github.com/pgvector/pgvector2. Commercial use
“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”
Use for any purpose without fee under the PostgreSQL License.
github.com/pgvector/pgvector/blob/master/LICENSE3. Key & sign-up
“PGPASSWORD behaves the same as the password connection parameter.”
No pgvector account or key. Your app connects to your own Postgres database with its user and password. The database password must stay on your server; pgvector is reached through a Postgres client, not from browser code.
postgresql.org/docs/current/libpq-envars.htmlChecked 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
SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.
Pricing
None
No monthly plan
—
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
A vector column holds up to 16,000 dimensions
HNSW and IVFFlat indexes on the vector type cover up to 2,000 dimensions (halfvec up to 4,000)
Postgres 13 or newer
From the official docs. github.com/pgvector/pgvector/blob/master/README.md
Key and access
No pgvector account or key. Your app connects to your own Postgres database with its user and password.
none from pgvector; Postgres client libraries read PGHOST, PGUSER and PGPASSWORD (or a connection string you pass)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.
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
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
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
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.
The extension was compiled on one machine with native CPU flags and run on another.
Rebuild with make OPTFLAGS="" for a portable build.
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.
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
3 of 6: llms.txt yes, OpenAPI no, SDK yes, MCP no, status page no, AI assistants allowed yes
Checked Nov 13, 2026.
None found
npm install pgvectorpip install pgvectorAlternatives
pgvector This page
Pick Supabase when you want hosted Postgres with pgvector already there, plus sign-in, file storage and ready APIs.
Pick Qdrant Cloud when you want a separate managed search engine built only for vectors.
Pick LanceDB when you want vector search embedded in your app or in its cloud, without running Postgres.
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.”
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 sudoTurn it on once in each database that should use it.
CREATE EXTENSION vector;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;
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;[{"id":1,"embedding":"[1,2,3]"},{"id":2,"embedding":"[4,5,6]"}]Mistakes to avoid
An expression in ORDER BY stops Postgres from using the vector index.
An IVFFlat index built with too little data returns fewer results.
Indexes on the vector type stop at 2,000 dimensions.
Each distance function needs its own index.
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.