Integration guide

RAG & DataOpen sourceUpdated 2026

Supabase Integration

Open-source Firebase alternative built on Postgres that can support AI app data, auth, storage, and pgvector-backed retrieval.

IntermediateSetup
PartialLocal runtime
3Related paths

Recommended path

Supabase local AI quick start

  1. 1. Choose one embedding model and dimensionPick the embedding model before creating the schema, record its output dimension, and use that exact dimension for the pgvector column. Mixed dimensions cannot share the column.
  2. 2. Generate and store a small verified corpusGenerate embeddings locally or with Supabase.ai.Session for gte-small, insert them with their source records, and verify row-level security before indexing private content.
  3. 3. Retrieve first, then call a separate chat modelRun a similarity query, inspect the returned rows and scores, then pass only the useful context to a generation model. Supabase supplies retrieval, not the final LLM answer.

Best for

Builders who want Postgres, auth, storage, edge functions, and vector search close to an AI app.

Model support

The direction here is the reverse of the other entries: Supabase does not call your model, it stores what your model produces. Its AI and Vectors toolkit uses Postgres with pgvector to store, index and query embeddings, and Edge Functions expose a small built-in inference session for one embedding model.

Choose models by role

Vector generation

Qwen3 Embedding

Use one dedicated embedding model consistently for indexing and queries. Its output dimension must match the database column, and changing it requires re-embedding the corpus.

Open the model profile →

Answer generation

Instruction-following chat model

Use a separate chat model to answer from the retrieved rows. Keep retrieval and generation as distinct steps so each can be tested and replaced independently.

How to use this integration

  • Store embeddings from a local model and query them with SQL alongside your application data
  • Build retrieval-augmented search over private documents without a separate vector database
  • Keep the retrieval half of a RAG stack self-hosted while the model runs on your own hardware
  • Use row-level security to scope vector search results to the right user

Connecting a local model

Generate embeddings with your own local model, for example through Ollama's /api/embed, and insert the vectors into a pgvector column. If you would rather not run an embedding model at all, Supabase.ai.Session in an Edge Function can produce them, but only for the gte-small model.

Tradeoffs

Supabase does not host your LLM, and the built-in path is deliberately narrow: only the gte-small text embedding model is supported in the Edge Runtime, so anything else means generating vectors yourself. Self-hosting also costs managed features, with branching, advanced metrics, managed backups and point-in-time recovery, analytics, ETL and the platform management API unavailable, and Studio limited to a single project.

Source

Supabase vector-column docs