pgvector for Postgres
Add vector similarity search to Postgres with pgvector. Generates schemas with HNSW/IVFFlat indexes, embedding columns, hybrid keyword+vector queries, and pooling-friendly patterns for production RAG.
Use Postgres as your vector database. This skill writes pgvector migrations, picks the right index (HNSW vs IVFFlat) for your dataset size, tunes lists/ef_construction, builds hybrid search queries combining tsvector and embeddings, and handles dimension changes safely.
When to use
Use when you want to avoid running a separate vector DB and keep embeddings next to your relational data — RAG over Postgres, semantic product search, recommendation features, or duplicate detection.
Examples
Hybrid keyword + vector search
Combine tsvector full-text and embedding similarity in one query
Build a Postgres query that returns products ranked by a weighted blend of pgvector cosine similarity and tsvector BM25 score
Pick the right index
Choose between HNSW and IVFFlat for your workload
I have 5M embeddings of 1536 dimensions with heavy write traffic — pick an index, set parameters, and write the migration