/supabase:pgvector-setupfrom supabase
Configures pgvector extension in Supabase for vector search: embedding storage, HNSW/IVFFlat indexes, hybrid search setup, and AI-optimized query patterns. For RAG systems and semantic search.
Ships in supabase. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill provides complete pgvector setup for Supabase databases, enabling vector search capabilities for AI applications, RAG systems, and semantic search.
Run the setup script to enable pgvector:
bash scripts/setup-pgvector.sh [SUPABASE_DB_URL]
This creates the pgvector extension and sets up basic embedding tables.
Choose your embedding dimensions based on your model:
Use the embedding table template:
# Copy template and customize for your use case
cat templates/embedding-table-schema.sql
Customize the schema:
Apply the schema:
psql $SUPABASE_DB_URL < templates/embedding-table-schema.sql
Choose index type based on your data size:
HNSW (Recommended for most cases):
bash scripts/create-indexes.sh hnsw [TABLE_NAME] [DIMENSION]IVFFlat:
bash scripts/create-indexes.sh ivfflat [TABLE_NAME] [DIMENSION]Performance Tuning:
Create the match function:
-- 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 ...
Query from application:
const { data } = await supabase.rpc('match_documents', {
query_embedding: embedding
match_threshold: 0.78
match_count: 10
});
For combining keyword and semantic search:
Run hybrid search setup:
bash scripts/setup-hybrid-search.sh [TABLE_NAME]
This configures:
Use the hybrid search function:
select * from hybrid_search(
'search query text'
query_embedding
match_count := 10
full_text_weight := 1.0
semantic_weight := 1.0
);
Run validation tests:
bash scripts/test-vector-search.sh [TABLE_NAME]
This verifies:
Distance Metric Selection:
<=>): Safe default, handles varying vector magnitudes<#>): Faster for normalized vectors (OpenAI embeddings)<->): Use when absolute distances matterIndex Choice:
Dimension Size:
Pattern 1: Document Search
Pattern 2: User Preference Matching
Pattern 3: Product Recommendations
Slow queries (> 100ms):
EXPLAIN ANALYZEPoor recall (missing relevant results):
High memory usage:
Insert performance issues:
Row Level Security (RLS):
API Key Protection:
Scripts:
scripts/setup-pgvector.sh - Enable extension and create base tablesscripts/create-indexes.sh - Create HNSW or IVFFlat indexesscripts/setup-hybrid-search.sh - Configure hybrid searchscripts/test-vector-search.sh - Validate setupTemplates:
templates/embedding-table-schema.sql - Table structure with metadatatemplates/hnsw-index-config.sql - HNSW index with tuningtemplates/ivfflat-index-config.sql - IVFFlat index configurationtemplates/hybrid-search-function.sql - Hybrid search with RRFtemplates/match-function.sql - Basic semantic search functionExamples:
examples/embedding-strategies.md - Index selection guideexamples/vector-search-examples.md - Common search patternsexamples/document-search-pattern.md - Full document search implementationexamples/preference-matching-pattern.md - User matching systemexamples/product-recommendations-pattern.md - Recommendation enginePlugin: supabase Version: 1.0.0 Last Updated: 2025-10-26
QUICK_START.md (opens in a new tab)README.md (opens in a new tab)examples/document-search-pattern.md (opens in a new tab)examples/embedding-strategies.md (opens in a new tab)examples/vector-search-examples.md (opens in a new tab)scripts/create-indexes.sh (opens in a new tab)scripts/setup-hybrid-search.sh (opens in a new tab)scripts/setup-pgvector.sh (opens in a new tab)scripts/test-vector-search.sh (opens in a new tab)templates/embedding-table-schema.sql (opens in a new tab)templates/hnsw-index-config.sql (opens in a new tab)templates/hybrid-search-function.sql (opens in a new tab)templates/ivfflat-index-config.sql (opens in a new tab)templates/match-function.sql (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pgvector, vector-search, supabase, rag, semantic-search, hnsw
npx claudepluginhub vanman2024/ai-dev-marketplace --plugin supabase8 skills in this plugin
/agentic-platform-schemaAgentic Platform Contract tables for AI agent applications - runs, events, artifacts, and tool calls tracking. Use when building AI agent backends that need structured run/event storage./auth-configsConfigure Supabase authentication providers (OAuth, JWT, email). Use when setting up authentication, configuring OAuth providers (Google/GitHub/Discord), implementing auth flows, configuring JWT settings, or when user mentions Supabase auth, social login, authentication setup, or auth configuration./e2e-test-scenariosEnd-to-end testing scenarios for Supabase - complete workflow tests from project creation to AI features, validation scripts, and comprehensive test suites. Use when testing Supabase integrations, validating AI workflows, running E2E tests, verifying production readiness, or when user mentions Supabase testing, E2E tests, integration testing, pgvector testing, auth testing, or test automation./rls-templatesRow Level Security policy templates for Supabase - multi-tenant patterns, user isolation, role-based access, and secure-by-default configurations. Use when securing Supabase tables, implementing RLS policies, building multi-tenant AI apps, protecting user data, creating chat/RAG systems, or when user mentions row level security, RLS, Supabase security, tenant isolation, or data access policies./rls-test-patternsRLS policy testing patterns for Supabase - automated test cases for Row Level Security enforcement, user isolation verification, multi-tenant security, and comprehensive security audit scripts. Use when testing RLS policies, validating user isolation, auditing Supabase security, verifying tenant isolation, testing row level security, running security tests, or when user mentions RLS testing, security validation, policy testing, or data leak prevention./schema-patternsProduction-ready database schema patterns for AI applications including chat/conversation schemas, RAG document storage with pgvector, multi-tenant organization models, user management, and AI usage tracking. Use when building AI applications, creating database schemas, setting up chat systems, implementing RAG, designing multi-tenant databases, or when user mentions supabase schemas, chat database, RAG storage, pgvector, embeddings, conversation history, or AI application database.Other plugins' skills for the same job