pgvector
Vector similarity search inside PostgreSQL. pgvector is an open-source PostgreSQL extension that stores embeddings as a column type and searches them by similarity. It supports exact search and approximate indexes such as HNSW and IVFFlat. It lets teams build retrieval-augmented generation and semantic search without adding a separate vector database.
When it is the right choice
- You already run PostgreSQL and want vector search next to your existing data
- You need to filter vector results by normal columns such as tenant, date or permissions
- Your collection size is in the range a well-tuned Postgres handles comfortably
- Consider a dedicated vector store only if you outgrow Postgres after measuring, not before
How we use it
- Design schemas that keep embeddings, source text and access rules together
- Choose and tune indexes against real queries, measuring recall and latency
- Run pgvector on managed Postgres such as RDS or Cloud SQL, or on Kubernetes with backups and replicas
- Monitor query times and re-embed content automatically when the embedding model changes
Related articles
Fine-Tuning or Prompting? A Decision Guide for Small TeamsWhen prompting, RAG or fine-tuning is the right way to adapt a language model, and what each one costs a small engineering team.
RAG in Production: The Boring Parts That MatterIngestion, chunking, refresh, evaluation and access control: the unglamorous work that decides whether a RAG system can be trusted.pgvector: frequently asked
Do we need a separate vector database for RAG?
Often not. pgvector handles many RAG workloads well and keeps your stack simpler. We measure performance with your data before recommending anything else.
Is pgvector available on managed Postgres?
Yes, the major managed services, including Amazon RDS, Aurora, Google Cloud SQL and Azure Database for PostgreSQL, offer it. Check which extension version your service supports.
Running pgvector, or deciding whether to? Tell us what you have; the first consultation is free.
Let's talk »

