pgvector

PostgreSQL extension that adds a vector data type and approximate nearest neighbor index methods (ivfflat and hnsw) for vector similarity search directly inside PostgreSQL.

Evaluated Mar 06, 2026 (0d ago) vcurrent
Homepage ↗ Repo ↗ Other vector-database postgresql sql open-source ivfflat hnsw embeddings self-hosted
⚙ Agent Friendliness
59
/ 100
Can an agent use this?
🔒 Security
88
/ 100
Is it safe for agents?
⚡ Reliability
82
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
82
Error Messages
80
Auth Simplicity
82
Rate Limits
70

🔒 Security

TLS Enforcement
90
Auth Strength
88
Scope Granularity
90
Dep. Hygiene
88
Secret Handling
85

Inherits PostgreSQL's mature security model including row-level security, SSL/TLS enforcement, SCRAM-SHA-256 auth, and audit logging; no additional attack surface beyond PostgreSQL itself.

⚡ Reliability

Uptime/SLA
75
Version Stability
85
Breaking Changes
83
Error Recovery
85
AF Security Reliability

Best When

Your stack already includes PostgreSQL and you need vector search colocated with relational data without adding infrastructure.

Avoid When

Vector search is your primary workload at scale exceeding tens of millions of vectors, or you need a managed API with no database administration.

Use Cases

  • Agent memory systems for teams already running PostgreSQL who want vector search without adding a separate database service
  • RAG pipelines where vector search results need to be joined with relational metadata in a single SQL query
  • Transactional agent workflows that require ACID guarantees across vector upserts and relational updates in one transaction
  • Multi-tenant SaaS agent backends using PostgreSQL row-level security to isolate tenant vector data
  • Hybrid text+vector search using PostgreSQL full-text search (tsvector) and pgvector in a single query plan

Not For

  • Very large vector datasets (100M+) where a purpose-built ANN engine like Qdrant or Weaviate will outperform PostgreSQL
  • Teams without PostgreSQL operational experience who want a zero-admin managed vector search API
  • Workloads requiring advanced vector operations like sparse+dense hybrid search or built-in embedding generation

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
No
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Uses standard PostgreSQL authentication (md5, scram-sha-256, certificate, LDAP, etc.); no pgvector-specific auth layer; access controlled via PostgreSQL GRANT/REVOKE and row-level security.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

PostgreSQL extension licensed under PostgreSQL License (permissive); all managed PostgreSQL providers that support extensions can run pgvector.

Agent Metadata

Pagination
offset
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • HNSW index must be created after data is loaded for best build performance; creating the index on an empty table and then inserting data builds the index incrementally, which is slower and produces lower quality graphs
  • The <-> (L2), <#> (inner product), and <=> (cosine) distance operators are not interchangeable — using the wrong operator for your embedding model's similarity function silently returns incorrect rankings
  • IVFFlat requires setting the number of lists at creation time based on dataset size (sqrt(n) heuristic); too few lists reduces recall, too many increases index build time with no query benefit
  • pgvector does not support indexing vectors with more than 2000 dimensions in the current HNSW implementation; OpenAI text-embedding-3-large at 3072 dimensions requires dimensionality reduction first
  • Approximate nearest neighbor searches skip the index and perform exact sequential scans if the query planner estimates a small result set — agents relying on ANN speed may get exact-scan latency unexpectedly on filtered queries

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for pgvector.

$99

Scores are editorial opinions as of 2026-03-06.

5173
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered