Supabase

Supabase

Open source PostgreSQL development platform

Overview

Supabase is an open source alternative to Firebase that provides a complete backend solution with PostgreSQL at its core. This guide will walk you through connecting your Hypermode agent to Supabase, enabling powerful database operations and real-time interactions.

Prerequisites

Before connecting Supabase to Hypermode, you’ll need:
  1. A Supabase account
  2. A Supabase project with API credentials
  3. A Hypermode workspace

Setting up Supabase

Step 1: Create your Supabase account

If you haven’t already, sign up for a free Supabase account. Supabase signup

Step 2: Generate API credentials

Navigate to your project settings and create a new API key:
  1. Go to Settings β†’ API in your Supabase dashboard
  2. Create a new service role key (this bypasses Row Level Security)
  3. Copy your project URL to extract the subdomain ID
Create API key
The subdomain ID is the part before .supabase.co in the project URL. For example, if the URL is https://supa-project-id.supabase.co, then the subdomain ID is supa-project-id.

Creating your Supabase agent

Step 1: Create a new agent

From the Hypermode interface, create a new agent manually:
  1. Click the agent dropdown menu
  2. Select β€œCreate new Agent”
Navigate to create agent

Step 2: Configure agent settings

Use these recommended settings for your Supabase agent:
  • Agent Name: SupaAgent
  • Agent Title: Connects to Supabase
  • Description: SupaAgent issues queries
  • Instructions: You have a connection to Supabase and various other developer tools to streamline data access and awareness
  • Model: GPT-4.1
Create agent modal

Step 3: View your agent profile

Once created, navigate to your agent’s settings page to see the profile: Agent profile

Connecting to Supabase

Step 1: Add the Supabase connection

Navigate to the Connections tab and add Supabase:
  1. Click β€œAdd connection”
  2. Select β€œSupabase” from the dropdown
Add Supabase connection

Step 2: Configure credentials

Enter your Supabase credentials:
  • Subdomain ID: Your project reference supa-project-id
  • Service Key: Your service role key from Supabase
Supabase connection modal
Keep your service key secure! This key bypasses Row Level Security and should never be exposed in client-side code.

Setting up your database

The Supabase connector allows you to query and manipulate data but doesn’t modify schemas. You’ll need to create your database schema directly in Supabase.

Step 1: Create your schema

Navigate to the SQL editor in your Supabase dashboard and run this example schema:
-- 1. Movies Table
CREATE TABLE IF NOT EXISTS public."Movies" (
    id SERIAL PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    year INTEGER
);

-- 2. Actors Table
CREATE TABLE IF NOT EXISTS public."Actors" (
    id SERIAL PRIMARY KEY,
    name VARCHAR(255) NOT NULL
);

-- 3. MovieActors Join Table
CREATE TABLE IF NOT EXISTS public."MovieActors" (
    movie_id INTEGER NOT NULL REFERENCES public."Movies"(id) ON DELETE CASCADE,
    actor_id INTEGER NOT NULL REFERENCES public."Actors"(id) ON DELETE CASCADE,
    PRIMARY KEY (movie_id, actor_id)
);
Migrate database

Step 2: View your schema

Confirm your tables are created successfully: Database schema

Step 3: Update agent instructions

For your agent to understand your database structure, update its instructions with your schema information: Update agent prompt

Testing the connection

Test 1: Query empty tables

Start a new thread and test with a simple query:
Can you list the movies?
You should see a Supabase tool call in the chat history, confirming the connection works: Empty movies query

Test 2: Insert data

Now try adding data to your database:
Can you add The Matrix 1999 and Neo the actor into my Supabase database?
Add Matrix movie

What you can do

With your Supabase connection established, your agent can:
  • Query data with complex filters and joins
  • Insert, update, and delete records
  • Execute transactions for data consistency
  • Work with relationships between tables
  • Integrate with other tools like GitHub, Slack, and Stripe

Best practices

  1. Schema documentation: Keep your agent’s instructions updated with your current schema
  2. Security: Use Row Level Security policies for additional protection
  3. Performance: Create indexes for frequently queried columns
  4. Error handling: Your agent will handle common database errors gracefully

Learn more

Combine Supabase with other Hypermode connections to build powerful workflows. For example, use GitHub to track code changes that affect your database, or Slack to notify your team of important data updates.