Skip to main content
All integrationsDatabase

Supabase Integration

Managed Postgres, Auth, and Storage — drop Supabase in as your backend.

FastAPI AI Kit works seamlessly with Supabase. Point DATABASE_URL at your Supabase Postgres instance and everything — SQLAlchemy, Alembic migrations, pgvector — works out of the box. Optionally use Supabase Auth and Storage instead of the kit's built-in layers.

Setup in 4 steps

  1. 1Copy your Supabase Postgres connection string as DATABASE_URL in .env
  2. 2Enable the pgvector extension in Supabase SQL editor: CREATE EXTENSION vector
  3. 3Run alembic upgrade head — all migrations apply cleanly against Supabase Postgres
  4. 4Optionally set SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY to use Supabase Auth

What's included

  • Supabase Postgres as a drop-in replacement for self-hosted Postgres
  • pgvector extension supported — RAG pipeline works without changes
  • Supabase Auth usable in place of the kit's built-in JWT layer
  • Supabase Storage for file/document ingestion instead of local disk
  • Realtime subscriptions available for streaming job status updates

Code example

example.py
# .env — point to Supabase Postgres
DATABASE_URL=postgresql+asyncpg://postgres.xxxx:password@aws-0-us-east-1.pooler.supabase.com:6543/postgres

# Enable pgvector in Supabase SQL editor once:
# CREATE EXTENSION IF NOT EXISTS vector;

# Then run migrations — nothing else changes
$ alembic upgrade head
# ✓ All tables and vector indexes created on Supabase

# Optional: Supabase Auth client for RLS-aware queries
from supabase import create_client
supabase = create_client(SUPABASE_URL, SUPABASE_KEY)

Full documentation: /docs/project-structure

Supabase integration pre-wired and ready.

FastAPI AI Kit ships with Supabase configured out of the box. No manual setup required.

Ready to ship your AI backend this weekend?

Join developers who skipped weeks of boilerplate and went straight to building.

Read the docs
No subscriptions · One-time payment · Lifetime updates