Connecting to Supabase

This guide walks you through connecting Agent M to your Supabase PostgreSQL database using the recommended Session pooler method.

Prerequisites

  • A Supabase account (sign up free)
  • A Supabase project (existing or new)

Step-by-Step Guide

1Open Supabase Dashboard

Go to supabase.com/dashboard and sign in to your account.

2Select or Create a Project

  • • Select an existing project from your dashboard, or
  • • Click New Project to create a new one

3Open the Connection Dialog

Click the Connect button at the top of the project page.

Supabase Connect Button Location

4Select Session Pooler Method

In the connection popup:

  1. Click on the Method dropdown
  2. Change from "Direct connection" to Session pooler
Supabase Session Pooler Selection

Why Session Pooler?
Session pooler is recommended when connecting via IPv4 networks. It provides connection pooling which is more efficient for applications like Agent M.

5Copy the Connection String

Copy the connection string (URI format) shown in the dialog. It will look like:

postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-[REGION].pooler.supabase.com:5432/postgres

6Add Your Password

Replace [YOUR-PASSWORD] in the connection string with your actual database password.

Forgot your password?
You can reset it in your project's Settings → Database.

7Connect in Agent M

  1. Open Agent M
  2. Create a new connection
  3. Select Supabase as the database type
  4. Enter a name for your connection
  5. Paste the complete connection string with your password
  6. Click Connect
Agent M Supabase Connection Form

Connection String Format

The Supabase Session pooler connection string format is:

postgresql://postgres.[PROJECT-REF]:[PASSWORD]@aws-0-[REGION].pooler.supabase.com:5432/postgres
ComponentDescription
postgres.[PROJECT-REF]Your username (includes project reference)
[PASSWORD]Your database password
aws-0-[REGION]Supabase regional server
5432PostgreSQL port
postgresDefault database name

Troubleshooting

Password Issues

If you've forgotten your database password, go to your Supabase project, navigate to Settings → Database, and click Reset database password.

Connection Timeouts

  • Ensure you're using the Session pooler method (not Direct connection)
  • Check that your network allows outbound connections on port 5432

Authentication Errors

  • Verify the password is correct and properly inserted in the connection string
  • Ensure special characters in the password are URL-encoded

Additional Resources

Next Steps