Database Overview
PIP AI uses Supabase as its backend platform, providing:
- PostgreSQL with the pgvector extension for semantic search
- Authentication with email/password and JWT custom claims
- Row Level Security (RLS) for fine-grained access control
- Storage for document uploads (PDFs, images)
- Realtime subscriptions for live UI updates
Supabase Project
| Setting | Value |
|---|---|
| Platform | Supabase (hosted PostgreSQL) |
| Extensions | pgvector, uuid-ossp, pgcrypto |
| Table Prefix | pip_ai_ |
| Embedding Model | OpenAI text-embedding-3-small (1536 dimensions) |
Key Concepts
- Brand Isolation — All data is scoped by
brand_name. Users can only access specs for brands they have projects in. - Idempotent Processing — All N8N workflows can be safely retried without duplicating data, thanks to unique constraints.
- Processing Queue — Document processing is managed via a durable job queue (
pip_ai_upload_jobs). - SECURITY DEFINER Functions — Admin checks use
SECURITY DEFINERfunctions to avoid RLS infinite recursion.
Sections
- Schema — Full database schema with ERD
- Migrations — Migration files and running order
- RLS Policies — Row Level Security policies
- Storage — Storage buckets and policies
- Vectors — pgvector setup and search functions