Use pgvector when your business already uses PostgreSQL and you want AI search beside your documents, customers, permissions, and orders. Install the extension, create a vector column, load embeddings, start with exact search, then add HNSW when measured latency needs it. pgvector has a $0 licence; Supabase Pro is $25 a month ($300 a year) before overages.
If your business data already lives in PostgreSQL, adding a separate vector database can feel like buying a second filing cabinet for one drawer. pgvector takes the opposite route: it puts AI search inside the database you already back up, secure, and query.
This guide shows how to use pgvector for AI search in PostgreSQL, from installing the extension to running filtered semantic search with HNSW or IVFFlat indexes. It also prices the managed route, because Neon and Supabase change the decision for small teams.
Quick Answer
To use pgvector, install the extension for your PostgreSQL server or choose a hosted PostgreSQL provider that includes it, then run CREATE EXTENSION vector; once in each database. Create a table with a vector column sized to your embedding model, insert embeddings beside the source text and business fields, and query with cosine distance (<=>), L2 distance (<->), or inner product (<#>). Add an HNSW index when exact search becomes too slow. pgvector is free under the PostgreSQL License; Neon Free is $0 a month, while Supabase Pro starts at $25 a month for one default project before overages.
In this article
- How we checked this guide
- What pgvector replaces, and what it does not
- How pgvector works inside PostgreSQL
- Self-hosted, Neon, or Supabase
- Requirements before you use pgvector
- Step 1: install pgvector
- Step 2: enable the extension and verify it
- Step 3: create your first table and insert data
- Step 4: run AI search with filters and joins
- Step 5: add an HNSW or IVFFlat index
- First-run security steps you must not skip
- Make pgvector useful for real work
- Backup and update routine
- Common errors and fixes
- Tips and tricks that save money
- The real cost maths
- When not to self-host pgvector
- Pros and cons
- Our verdict
- FAQ
- Strategic Pivot
- Sources
How we checked this guide
We checked licence, install routes, operators, indexes, filtering, upgrades, and troubleshooting in the official pgvector repository on December 2, 2026. We checked managed prices on official Neon and Supabase pages the same day.
What pgvector replaces, and what it does not

pgvector replaces the separate vector database for many small-business AI search jobs. It stores embeddings in PostgreSQL beside the rows they describe, so one SQL query can rank by meaning and still filter by customer, product, status, date, language, or permission.
That matters because business search is rarely pure similarity. A support assistant should find the damaged-item refund passage only from current policy documents, for the right product line, and for records the user may see.
pgvector does not replace the embedding model. You still choose the model that turns text, images, or other content into vectors. That choice fixes the dimension of the column, and every stored vector must match it.
It also does not replace document preparation. Poor chunks, stale text, missing metadata, or weak embeddings will return wrong evidence quickly.
pgvector is open source under the PostgreSQL License. In plain words, you may use, copy, modify, and distribute it without a licence fee, provided the licence notices stay with copies. The extension licence fee is $0; your PostgreSQL server, embedding model, backups, and admin time still cost money.
Best for: a small-business owner, freelancer, or technical operator who already uses PostgreSQL and wants semantic search without running a second database. Skip if: you want a finished document-chat product, need a dedicated vector engine at very large scale, or do not want to operate PostgreSQL at all.
pgvector sits below finished document-chat tools. Our guide to install AnythingLLM to chat with business documents covers a ready-made workspace. Choose AnythingLLM when you want the application. Choose pgvector when you are building your own search or RAG feature and want the database layer inside PostgreSQL.
It also sits beside the dedicated vector databases in this series: Qdrant for payload filtering, Chroma for an embedded Python route, Weaviate for object-and-hybrid search, and Milvus for scale. pgvector’s advantage is simpler: your vectors live with your business rows.
How pgvector works inside PostgreSQL
pgvector is a PostgreSQL extension, not a separate service. It adds vector data types, distance operators, and index support to PostgreSQL. The official repository describes it as open-source vector similarity search for Postgres, with exact and approximate nearest-neighbour search.
The main type is vector. A column such as embedding vector(1536) stores 1,536-number embeddings. The number in parentheses is not decoration; it must match the embedding model output exactly.
pgvector also supports halfvec, bit, and sparsevec. Start with vector; move to halfvec or binary quantization only after measuring recall and storage pressure.
Similarity is expressed with operators: <=> for cosine distance, <-> for L2 distance, <#> for negative inner product, and <+> for L1 distance. Cosine distance is the safe starting point for many text embeddings.
By default, pgvector performs exact nearest-neighbour search. Exact search gives perfect recall for the stored vectors, but it scans more work as the table grows. When speed matters more than perfect recall, add an approximate index.
The two index types are HNSW and IVFFlat. HNSW usually gives the better speed-recall trade-off, but it builds more slowly and uses more memory. IVFFlat builds faster and uses less memory, but it needs data in the table before indexing and careful list/probe tuning.
Filtering is where pgvector feels most like PostgreSQL. Index ordinary columns such as customer_id, category, or status, then combine a WHERE clause with vector ordering. With approximate indexes, filtering happens after candidate rows return, so selective filters may need iterative scans, partial indexes, partitioning, or separate tenant tables.
Self-hosted, Neon, or Supabase
You have three practical routes. The right one depends on whether PostgreSQL is already part of your stack and who owns backups, updates, and uptime.
| Route | Licence or base price | Best for | Main limit |
|---|---|---|---|
| Self-hosted PostgreSQL + pgvector | $0 licence fee, PostgreSQL License | Existing PostgreSQL, private data, full SQL control | You own security, backups, updates, monitoring, and uptime |
| Neon | Free $0/month; Launch $0.106/CU-hour + $0.35/GB-month | Fast managed PostgreSQL with pgvector on every plan | Free plan has 1 GB storage per project and 100 CU-hours/project |
| Supabase | Free projects available; Pro $25/month before overages | PostgreSQL plus auth, APIs, storage, and pgvector in one platform | Free database size is 500 MB per project; compute and usage can add cost |
Self-hosting is cheapest in licence terms and often cheapest in cash when PostgreSQL already runs your application. Managed PostgreSQL is cheaper in attention when nobody wants to own database operations.
Requirements before you use pgvector
Check the PostgreSQL version first. The official pgvector source instructions support PostgreSQL 13 and later. Current examples use pgvector v0.8.7, with Docker tags for PostgreSQL 15 through 19.
Decide where PostgreSQL will run. If you already have PostgreSQL, confirm pgvector is available from your package source or provider. Neon includes pgvector on every plan; Supabase’s semantic search guide also uses pgvector.
Plan the embedding model before creating the table. Record the model name, dimension, distance metric, and whether vectors are normalized. A model change later means a new column or table and a full re-embed of the source content.
Estimate storage before importing. A vector value takes 4 * dimensions + 8 bytes before normal row overhead. At 1,536 dimensions, that is 6,152 bytes per vector. One hundred thousand vectors therefore carry about 615 MB of raw vector payload before text, metadata, indexes, and database overhead.
Plan memory for indexes. HNSW performs best when the graph fits in memory, and builds are faster when it fits in maintenance_work_mem. Tune on staging first; do not set memory so high that the server runs out of RAM.
Decide the security boundary before real data arrives. Name the application database user, the admin user, the backup method, and the tenant or customer field that filters search results. Retrofitting permission fields after import is slower and riskier.
Step 1: install pgvector
Choose one install route. Do not mix routes casually, because upgrades should use the same method as the original installation.
For a managed provider, there may be nothing to install on the server. On Neon, run the extension statement in the SQL Editor or a PostgreSQL client. The provider supplies the extension files, and you enable them per database.
For Docker, use the official pgvector image that adds pgvector to the PostgreSQL image. Replace the PostgreSQL major version with the version your application uses:
docker pull pgvector/pgvector:pg17-trixieRun that image the same way you run PostgreSQL, with a persistent volume and secrets handled normally. If you raise maintenance_work_mem for parallel HNSW builds in Docker, make container shared memory at least that large.
For Debian or Ubuntu packages, follow the PostgreSQL APT repository setup for your server, then install the package for your PostgreSQL major version:
sudo apt install postgresql-17-pgvectorReplace 17 with your PostgreSQL server version. Restart or reload PostgreSQL according to your package and service routine, then continue to the extension step.
For a source build on Linux or macOS, compile against the PostgreSQL installation you actually run:
cd /tmp
git clone --branch v0.8.7 https://github.com/pgvector/pgvector.git
cd pgvector
make
make install # may need sudoIf the build cannot find postgres.h, install the PostgreSQL server development files for the same major version. On Ubuntu and Debian, the official notes point to the matching postgresql-server-dev package.
If several PostgreSQL versions exist on one machine, set PG_CONFIG to the target server’s pg_config before building. Installing into the wrong PostgreSQL installation is a common reason CREATE EXTENSION vector; later fails.
Step 2: enable the extension and verify it

Connect to the database where vectors will live. Extensions are enabled per database, not once for the whole server. Run:
CREATE EXTENSION IF NOT EXISTS vector;Verify the installed version:
SELECT extname, extversion
FROM pg_extension
WHERE extname = 'vector';If the command fails because the extension is not available, the server lacks pgvector files for that PostgreSQL installation. Fix the package, Docker image, or provider setting first.
Run a tiny smoke test before importing business documents:
CREATE TABLE pgvector_smoke (
id bigserial PRIMARY KEY,
embedding vector(3)
);
INSERT INTO pgvector_smoke (embedding)
VALUES ('[1,2,3]'), ('[4,5,6]');
SELECT id, embedding
FROM pgvector_smoke
ORDER BY embedding <-> '[3,1,2]'
LIMIT 1;Drop the smoke table after the test if it was only a check. The point is to prove the extension, type, insert path, and distance operator all work before the real import begins.
Step 3: create your first table and insert data
Create a table that stores the source text, the embedding, and the fields your business rules need. The example below uses 1,536 dimensions; replace it with your model’s dimension.
CREATE TABLE documents (
id bigserial PRIMARY KEY,
customer_id bigint NOT NULL,
title text NOT NULL,
content text NOT NULL,
source_url text,
status text NOT NULL DEFAULT 'current',
embedding vector(1536) NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);Add ordinary indexes for the filters you will use often:
CREATE INDEX documents_customer_idx ON documents (customer_id);
CREATE INDEX documents_status_idx ON documents (status);Generate embeddings with one model and insert them beside the source chunk. Keep the chunk text or a durable source reference in the row so results can be audited later.
INSERT INTO documents (customer_id, title, content, source_url, embedding)
VALUES (
42,
'Refund policy',
'Damaged items can be returned within 30 days...',
'https://example.com/refunds',
'[0.012, -0.034, 0.056]'
);The vector literal is shortened for readability. Real inserts must contain the full dimension count, usually passed from code as a parameter.
Load a small judged set first: documents whose correct answers you already know. Save the questions you will use to judge retrieval.
For bulk loading, use COPY or your application’s batch insert path. Add vector indexes after the initial load when possible, because building an index after loading is usually faster than maintaining it during a large import.
Step 4: run AI search with filters and joins

Start with exact search. Encode the user’s question with the same embedding model, then order by distance:
SELECT id, title, content, embedding <=> $1 AS distance
FROM documents
WHERE customer_id = $2
AND status = 'current'
ORDER BY embedding <=> $1
LIMIT 5;The query returns the closest current documents for one customer. The filter is not an afterthought; it is the business rule that keeps another customer’s documents out of the answer.
Use joins when the vector row points to richer business data, such as customers, products, or orders, to enforce account state or ownership in the same query.
Return the distance with the result during development. Judge the passages, not the number alone. A correct passage at a modest distance is better than a wrong passage with a flattering score.
Set a threshold only after testing. Cosine distance thresholds are model- and corpus-specific. A threshold copied from another project can hide good answers or admit weak ones.
Parameterize queries from application code. Never build SQL by string-concatenating user text or embeddings.
Save your judged questions and expected passages. Rerun them after changing chunking, embeddings, filters, indexes, or search settings.
Step 5: add an HNSW or IVFFlat index
Add an index when exact search is too slow for your table size and query load. Create the index for the distance operator you actually query.
For cosine distance with HNSW:
CREATE INDEX documents_embedding_hnsw_idx
ON documents USING hnsw (embedding vector_cosine_ops);For L2 distance, use vector_l2_ops. For inner product, use vector_ip_ops. An index built for one operator class does not serve a different distance operator.
HNSW defaults are m = 16 and ef_construction = 64. Keep the defaults first. Raise ef_construction only when measured recall is weak and you accept slower builds and inserts.
At query time, hnsw.ef_search defaults to 40. Raise it for better recall at the cost of speed:
SET hnsw.ef_search = 100;Use SET LOCAL inside a transaction when only one query needs the higher setting. That keeps a costly recall setting from leaking into unrelated work.
IVFFlat is the alternative when build time and memory matter more than the best speed-recall trade-off. Create it after the table has data, choose lists deliberately, and tune probes:
CREATE INDEX documents_embedding_ivfflat_idx
ON documents USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);
SET ivfflat.probes = 10;The official starting point for lists is rows / 1000 up to one million rows, and sqrt(rows) above that. Probes often start near sqrt(lists). Measure recall against exact search.
In production, create large indexes concurrently when your workflow allows it, and watch build progress and server memory during the first large build.
First-run security steps you must not skip
Treat the database as the security boundary. pgvector does not add a separate login system; PostgreSQL roles, network rules, TLS, grants, and row-level policies do that work.
Create a dedicated application role with only the privileges it needs. Do not let the web application connect as a superuser or as the table owner. A leaked application credential should not become full database control.
Keep PostgreSQL off the public internet unless there is a deliberate, reviewed reason to expose it. Prefer private networking or a firewall allowlist, require TLS for remote connections, and use strong unique credentials.
Enable row-level security when one table holds multiple customers or tenants. Do not rely only on application code remembering a customer_id filter.
Be careful with shared approximate indexes across tenants. The pgvector guidance warns that a shared approximate index can let one tenant’s vectors affect another tenant’s recall and speed. For strict isolation, use list partitioning by tenant or separate tables.
Protect source documents as carefully as embeddings. Retrieved chunks often contain the sensitive content itself, so apply the same retention, access, and deletion rules to vector rows.
Test the lockdown before importing sensitive data. A wrong password should fail, an application role should not read another tenant’s rows, and a restore should not silently widen access. An untested security step is a hope, not a control.
Make pgvector useful for real work
Design the schema around the questions you will filter by. Store customer, product, language, status, source, and date fields before the big import. Retrofitting a filter field means updating or re-importing rows later.
Chunk documents the way answers are used. A support passage should answer one question completely, with its source attached. Chunks that split a procedure in half retrieve half an answer, and the language model may improvise the rest.
Keep one embedding model per vector column. Vectors from different models do not share a meaningful neighbourhood, even when the dimension count happens to match. Store the model name and version in your application configuration or a metadata table.
Add hybrid search when exact terms matter. Product codes, invoice numbers, error strings, and names are keyword problems wearing a semantic costume. PostgreSQL full-text search can rank exact terms while pgvector ranks meaning; combine the two result sets deliberately.
Use metadata filters inside SQL, not after the application receives a shortlist. Filtering after ranking can leave the user with a weaker result set than the database could have produced.
Watch recall after adding an approximate index. Compare approximate results with exact search on your judged questions. If the right passage disappears, raise hnsw.ef_search, adjust IVFFlat probes, or enable iterative index scans for filtered queries.
For local embeddings, our guide to install Ollama on Ubuntu covers a private route that keeps document text on your machine.
Backup and update routine
Back up PostgreSQL, not only the vector table. pgvector data lives in normal tables, so your backup must cover the database, roles, configuration, and the extension files needed to restore it.
Use pg_dump for logical backups. A full dump includes extension creation commands, but the destination server must have pgvector files available when the dump is loaded. Keep the pgvector version in your restore runbook.
Test restores into a throwaway database. Confirm the extension version, run the smoke query, and rerun judged search questions.
For production systems, combine logical dumps with your normal PostgreSQL point-in-time recovery strategy. Logical dumps are portable and useful for migrations; WAL-based recovery is what protects you when the failure happens between dumps.
Update pgvector deliberately. Install the newer extension files with the same method used originally, then run the extension update in each database:
ALTER EXTENSION vector UPDATE;Check the version before and after the update. Run the update on staging first, especially when the same maintenance window also changes PostgreSQL major versions, Docker images, or managed-provider settings.
After an update, rebuild or reindex only when release notes or tests require it. Do not change index parameters, embedding models, and extension versions in the same window.
Keep a rollback plan that is honest: the pre-update backup restored into a compatible environment, tested before the production window.
Common errors and fixes
extension "vector" is not available. PostgreSQL cannot find pgvector files for that server. Install the matching package, use the pgvector Docker image, or choose a provider that includes pgvector.
type "vector" does not exist. The extension has not been enabled in this database, or the session is connected to a different database. Run CREATE EXTENSION IF NOT EXISTS vector; in the target database and verify with the pg_extension query.
Dimension mismatch on insert. The column expects one dimension and the embedding has another. Fix the model output, recreate the column with the correct dimension, or re-embed the content. There is no partial fix; the numbers must match exactly.
The query does not use the index. The query needs ORDER BY on the distance operator in ascending order and a LIMIT. Also check that the index operator class matches the distance operator.
Fewer results after adding HNSW. Results are limited by hnsw.ef_search, which defaults to 40, and filters can reduce matches further. Raise ef_search, enable iterative scans, or compare against exact search.
Fewer results after adding IVFFlat. The index may have been built with too little data for its list count, or probes may be too low. Load representative data first, rebuild with a better list count, and raise ivfflat.probes while measuring recall.
Filtered search returns the wrong tenant’s documents. Move the tenant condition into SQL, add row-level security, and consider partitioning or separate tables for strict isolation.
Index build is slow or memory-hungry. Raise maintenance_work_mem for the build session within safe limits, increase parallel workers carefully, and build after the initial load.
Restore fails on a new server. The dump expects pgvector, but the destination server does not have the extension files installed. Install pgvector for that PostgreSQL version before restoring, then verify the extension version after restore.
Tips and tricks that save money
Start exact, then index. For a small table, exact search is simple and gives perfect recall. Add HNSW only when measured latency or load says you need approximate search.
Use the smallest embedding dimension that still answers well. Storage grows linearly with dimensions, and larger vectors also cost more memory and compute. Test a shorter model output before committing to the largest option.
Consider halfvec after the first quality test. Half-precision vectors take 2 * dimensions + 8 bytes, about half the raw payload of vector. Measure recall before switching production data.
Keep bulky source files outside the vector table when possible. Store the chunk text needed for answers and citations, plus a durable reference to the full source.
Prototype on a free managed plan before buying hardware. Neon Free’s 1 GB storage and 100 CU-hours per project are enough to test schema, filters, and retrieval quality.
Re-embed rarely and deliberately. A model change forces a new vector column or table and a full re-embed. Choose a model you can live with, version it, and treat a change as a planned migration with the test set rerun.
The real cost maths

Self-hosted pgvector has a $0 licence fee under the PostgreSQL License. That is the whole licence story. The operating story is the PostgreSQL server, storage, memory for indexes, embedding generation, backups, monitoring, and a named person who owns updates.
Neon Free costs $0 a month. It includes 100 projects, 100 CU-hours per project, 1 GB of PostgreSQL storage per project up to 20 GB total, and 5 GB of public network transfer per project. pgvector is available on every Neon plan with no add-on required.
Neon Launch is usage-based with no monthly minimum. Compute costs $0.106 per CU-hour, and storage costs $0.35 per GB-month. Scale compute costs $0.222 per CU-hour, with the same $0.35 per GB-month storage rate.
Supabase Free gives two active free projects, with 500 MB database size per project. Supabase Pro is $25 a month before overages, with $10 in compute credits covering one default project. Additional projects start at about $10 a month. Pro and Team include 8 GB disk per project, then $0.125 per GB.
Take a realistic scenario: a support knowledge base with 100,000 document chunks at 1,536 dimensions. The raw vector payload is 100,000 × 6,152 bytes = 615,200,000 bytes, about 0.62 GB before text, metadata, indexes, and database overhead. With halfvec, the raw payload is about 0.31 GB.
Assume the full PostgreSQL database, including text, metadata, ordinary indexes, and the vector index, is 2 GB. On Neon Launch, storage is 2 × $0.35 = $0.70 a month. If the database averages 0.5 CU for 200 active hours, compute is 100 CU-hours × $0.106 = $10.60. The lean managed total is $11.30 a month, or $135.60 a year.
Now make the same database always on at 1 CU. Compute becomes 730 CU-hours × $0.106 = $77.38. Add the same $0.70 storage and the total is $78.08 a month, or $936.96 a year. The database did not change; the uptime pattern did.
On Supabase Pro, one default project is $25 a month, or $300 a year, before overages, extra projects, larger compute, or add-ons. That buys a managed platform, not only pgvector. Compare it with the whole backend you would otherwise operate.
Self-hosted on PostgreSQL you already run, the incremental licence line stays $0. The honest saving against the Supabase Pro one-project floor is $300 a year only when the existing server has capacity and a named operator already owns PostgreSQL. If you must rent a bigger server or buy admin time, subtract that first.
Embedding costs sit outside both columns. Price the embedding route separately, because re-embedding a large corpus can cost more than storing the vectors.
When not to self-host pgvector
Do not self-host when nobody owns PostgreSQL. pgvector is simple as an extension, but the server still needs patching, backups, restore tests, monitoring, and capacity planning. An unowned database is a future outage with a date you have not met yet.
Do not self-host when your application does not use PostgreSQL and you only need a small prototype. A managed free plan or embedded vector tool may teach you more, faster.
Do not self-host when you need contractual uptime that your single server cannot provide. Managed PostgreSQL, replicas, and point-in-time recovery exist for teams whose customers notice downtime in minutes.
Do not force pgvector into a workload that has outgrown it. Very large vector counts, strict latency targets, or specialized retrieval features may fit a dedicated vector database better. The honest test is measured recall, latency, memory, and operating cost on your own data.
Do not store sensitive documents before the security model is written. If tenant isolation, deletion, retention, and access rules are unclear, fix those first. Vector search makes sensitive text easier to retrieve, including by the wrong person.
Pros and cons
Pros
- Free and open source under the PostgreSQL License, with no licence fee for business use.
- Vectors live beside business rows, so SQL filters, joins, transactions, and backups stay in one system.
- Exact search is available by default, with HNSW and IVFFlat indexes when approximate search is worth the recall trade-off.
- Supports
vector,halfvec,bit, andsparsevectypes for different storage and recall needs. - Works with any language that has a PostgreSQL client, so the application stack does not need a separate vector API.
- Managed PostgreSQL routes exist, including Neon with pgvector on every plan and Supabase semantic search built on pgvector.
- Hybrid search can combine PostgreSQL full-text search for exact terms with pgvector for meaning.
Cons
- You own PostgreSQL security, backups, updates, monitoring, and uptime when self-hosting.
- The embedding dimension is fixed per column, and a model change means re-embedding the corpus.
- HNSW indexes can use significant memory and build time as vector counts grow.
- Filtered approximate search needs care, because filters apply after candidate rows are returned.
- Shared approximate indexes can affect tenant recall and speed; strict isolation may need partitioning or separate tables.
- pgvector retrieves records; it does not prove a retrieved passage supports the final answer.
- Managed plans remove server work but add usage meters, storage limits, compute choices, and overage rules.
Our verdict
Use pgvector when PostgreSQL is already your system of record and you want AI search without a second database. Enable the extension, prove retrieval on judged questions with exact search, add filters and row-level security before sensitive data, then add HNSW only when measured latency requires it. Self-hosting saves the $300-a-year Supabase Pro one-project floor only when your existing PostgreSQL server and operator can absorb the work; otherwise managed PostgreSQL is the cheaper honest answer.
FAQ
Is pgvector free for business use?
Yes. pgvector is released under the PostgreSQL License, which permits use, copying, modification, and distribution without a licence fee when the licence notices are kept. Hosting, embedding models, backups, and support still cost money.
How do I use pgvector in PostgreSQL?
Install pgvector for your PostgreSQL server or use a provider that includes it, then run CREATE EXTENSION IF NOT EXISTS vector; in the target database. Create a vector column sized to your embedding model, insert embeddings beside the source text, and query with <=>, <->, or <#> plus business filters.
Should I use HNSW or IVFFlat?
Start with exact search, then add HNSW when latency requires approximate search and recall matters. Choose IVFFlat when faster builds and lower memory matter more, and tune lists and probes against exact-search results.
Is pgvector secure for customer documents?
It can be, but only when PostgreSQL security is configured properly. Use least-privilege roles, TLS or private networking, row-level security for tenant data, tested backups, and strict isolation where shared indexes could affect recall or access.
Should I self-host pgvector or use Neon or Supabase?
Self-host when PostgreSQL already runs your application and a named operator owns backups and updates. Use Neon Free or Supabase Free to prototype, then compare Neon Launch usage pricing with Supabase Pro at $25 a month before overages when managed operations matter more than running the server yourself.
Strategic Pivot
pgvector removes the separate vector-database licence line, not hosting, embedding, backup, or admin costs. Price the full year with our free AI Cost Calculator before committing.
Sources
- Official pgvector GitHub repository: licence, install routes, operators, indexes, filtering, upgrades, and troubleshooting.
- Official Neon pgvector extension guide: extension enablement and version checks.
- Official Neon plans: Free, Launch, and Scale pricing.
- Official Supabase semantic search guide: pgvector operators, filtering, and indexes.
- Official Supabase billing overview: plan structure and database-size quotas.
- Official Supabase Billing FAQ: Pro Plan and compute-credit examples.
- Official PostgreSQL pg_dump documentation: logical backup formats and extension dumping.
Price note — updated December 2, 2026: Prices in this post were checked on December 2, 2026. When you are reading this, the price may be lower or higher — always check the official pricing page before you buy.
Pros
- Free PostgreSQL License software
- AI search stays in PostgreSQL beside business data
- SQL filters, joins, transactions, and row-level security stay available
- exact search gives a clean recall baseline
- HNSW and IVFFlat cover common scale paths
Cons
- You must operate PostgreSQL, backups, upgrades, and index tuning
- approximate indexes need recall testing
- embedding and chunking quality still decide answer quality
- not ideal when vector scale is the whole product
pgvector is the right first vector database when PostgreSQL already holds the business records your AI search must respect. Start exact, prove retrieval quality, then add HNSW only when latency or scale earns it. Choose a dedicated vector database when vector operations are the product, not a feature.
