What problem does it solve?
This skill provides clear, actionable guidance to implement and optimize vector similarity search and to store AI-generated embeddings in PostgreSQL/Supabase using the pgvector extension, addressing slow similarity queries, embedding dimension mismatches, and missing vector indexes.
Core Features & Use Cases
- Enable and verify pgvector: steps to install or confirm the pgvector extension in Supabase and self-hosted PostgreSQL.
- Schema and embedding storage: patterns for creating tables with vector columns, storing metadata, and generating embeddings from AI models.
- Indexing and performance tuning: recommendations for IVFFlat and HNSW indexes, VACUUM ANALYZE, and tuning probes/ef_search for production workloads.
- Similarity and hybrid queries: examples for cosine, L2, and inner-product searches and combining vector search with metadata filters for hybrid relevance.
- Operational best practices: upserts, batch inserts, dimension validation, stored functions for reusable search, and Supabase-specific deployment tips.
Quick Start
Generate embeddings for your documents, store them in a documents table with a vector column, create an appropriate vector index, and run a cosine similarity query to return the top matching rows.