Loading...
Loading...
Configure pgvector extension for vector search in Supabase - includes embedding storage, HNSW/IVFFlat indexes, hybrid search setup, and AI-optimized query patterns. Use when setting up vector search, building RAG systems, configuring semantic search, creating embedding storage, or when user mentions pgvector, vector database, embeddings, semantic search, or hybrid search.
npx skill4agent add vanman2024/ai-dev-marketplace pgvector-setupbash scripts/setup-pgvector.sh [SUPABASE_DB_URL]# Copy template and customize for your use case
cat templates/embedding-table-schema.sqlpsql $SUPABASE_DB_URL < templates/embedding-table-schema.sqlbash scripts/create-indexes.sh hnsw [TABLE_NAME] [DIMENSION]bash scripts/create-indexes.sh ivfflat [TABLE_NAME] [DIMENSION]-- See templates/match-function.sql for complete example
create or replace function match_documents(
query_embedding vector(1536)
match_threshold float
match_count int
) returns setof documents ...const { data } = await supabase.rpc('match_documents', {
query_embedding: embedding
match_threshold: 0.78
match_count: 10
});bash scripts/setup-hybrid-search.sh [TABLE_NAME]select * from hybrid_search(
'search query text'
query_embedding
match_count := 10
full_text_weight := 1.0
semantic_weight := 1.0
);bash scripts/test-vector-search.sh [TABLE_NAME]<=><#><->EXPLAIN ANALYZEscripts/setup-pgvector.shscripts/create-indexes.shscripts/setup-hybrid-search.shscripts/test-vector-search.shtemplates/embedding-table-schema.sqltemplates/hnsw-index-config.sqltemplates/ivfflat-index-config.sqltemplates/hybrid-search-function.sqltemplates/match-function.sqlexamples/embedding-strategies.mdexamples/vector-search-examples.mdexamples/document-search-pattern.mdexamples/preference-matching-pattern.mdexamples/product-recommendations-pattern.md