Creating Vector Buckets
Set up vector buckets and indexes using the dashboard or JavaScript SDK.
This feature is in alpha
Expect rapid changes, limited features, and possible breaking updates. Share feedback as we refine the experience and expand access.
Vector buckets organize your vector data into logical units. Within each bucket, you create indexes that define how vectors are stored and searched based on their dimensions and distance metrics.
Creating a Vector bucket
You can create vector buckets using either the Supabase Dashboard or the JavaScript SDK.
Using the Supabase Dashboard
- Navigate to the Storage section in the Supabase Dashboard.
- Click Create Bucket.
- Enter a name for your bucket (e.g.,
embeddingsorsemantic-search). - Select Vector Bucket as the bucket type.
- Click Create.
Your vector bucket is now ready. The next step is to create indexes within it.
Using the JavaScript SDK
12345678import { } from '@supabase/supabase-js'const = ('https://your-project.supabase.co', 'your-service-key')// Create a vector bucketawait ...('embeddings').('✓ Vector bucket created: embeddings')Creating indexes
Indexes organize vectors within a bucket with consistent dimensions and distance metrics. For comprehensive index management documentation, see Working with Vector Indexes.
Quick start: Creating an index via Dashboard
- Open your vector bucket.
- Click Create Index.
- Enter an index name (e.g.,
documents-openai). - Set the dimension matching your embeddings (e.g.,
1536for OpenAI's text-embedding-3-small). - Select the distance metric (
cosine,euclidean, orl2). - Click Create.
Quick start: Creating an index via JavaScript SDK
1234567891011const bucket = supabase.storage.vectors.from('embeddings')// Create an indexawait bucket.createIndex({ indexName: 'documents-openai', dataType: 'float32', dimension: 1536, distanceMetric: 'cosine',})console.log('✓ Index created: documents-openai')Key details
- Dimension must match your embedding model (e.g., 1536 for OpenAI)
- Distance metric (
cosine,euclidean, orl2) is immutable after creation - Maximum indexes per bucket: 10
- Maximum batch size: 500 vectors per operation
For detailed information on distance metrics, embedding dimensions, managing multiple indexes, and advanced index operations, see Working with Vector Indexes.
Next steps
After creating your bucket and indexes, you can: