Supabase

Connect your Supabase database to Memex for AI-powered data access and analysis.

What is Supabase?

Supabase is an open-source Firebase alternative that provides a full PostgreSQL database along with authentication, storage, and real-time capabilities. It's a popular choice for building modern applications quickly.

When you connect Supabase to Memex, you can query your database, analyze your data, and build visualizations—all through natural conversation.

What You'll Need

To connect Supabase to Memex, you'll need two pieces of information from your Supabase project:

Credential
Description
Example

SUPABASE_URL

Your project's API URL

https://abcdefgh.supabase.co

SUPABASE_KEY

Your project's API key

sb_publishable_... or sb_secret_...

circle-info

URL Format: Supabase project URLs follow the pattern https://[project-ref].supabase.co where [project-ref] is your unique project reference ID.

Finding Your Credentials

Step 1: Open Your Supabase Dashboard

Go to supabase.comarrow-up-right and sign in to your account. Select the project you want to connect.

Step 2: Find Your Project URL

  1. Click on Settings in the left sidebar (the gear icon)

  2. Select Data API from the settings menu

  3. Copy the URL shown under "Project URL"

Supabase API Settings showing Project URL

Step 3: Find Your API Key

  1. In Settings, select API Keys from the settings menu

  2. Copy either the Publishable key or Secret key

Supabase API Keys page showing Publishable and Secret keys
circle-info

Which key should you use?

  • Publishable key (sb_publishable_...): Safe to use in browsers if you have enabled Row Level Security (RLS) for your tables and configured policies. This key has low privileges and respects RLS.

  • Secret key (sb_secret_...): Allows privileged access to your project's APIs. Bypasses RLS and has full database access. Use this in servers, functions, workers, or other backend components. Never expose it in client-side code.

Legacy keys: If you have an older project, you may see a "Legacy anon, service_role API keys" tab. These legacy JWT-based keys (anon and service_role) still work but Supabase recommends migrating to the new key format. Legacy keys will be deprecated in late 2026.

Connecting to Memex

  1. Open the Memex Hub from the sidebar

  2. Click on the Connectors tab

  3. Click on the Supabase card

  4. Enter a Connection Name (e.g., "My App Database")

  5. Paste your SUPABASE_URL

  6. Paste your SUPABASE_KEY

  7. Click Add Connection

Your Supabase database is now connected! Memex can access it across all your conversations.

Verifying Your Connection

After connecting, try asking Memex:

If Memex returns your table names, the connection is working correctly.

Using Your Connection

Once connected, you can ask Memex to work with your Supabase data naturally:

Security Considerations

Row Level Security (RLS)

If you use Row Level Securityarrow-up-right, the Publishable key respects your policies while the Secret key bypasses them entirely.

Protecting Your Keys

  • Your keys are stored securely in Memex's encrypted storage

  • Never share your Secret key publicly

  • If you suspect a key has been compromised, rotate it in your Supabase dashboard

circle-exclamation

Troubleshooting

If you run into issues, ask the Memex agent to help debug the problem.

"Invalid API key" Error

  • Double-check that you copied the entire key without extra spaces

  • Ensure you're using a key from the correct project

  • Verify the key hasn't been rotated or revoked in Supabase

"Connection refused" Error

  • Confirm your Supabase project is active and not paused (free-tier projects pause after 7 days of inactivity)

  • Check that your project URL is correct

  • Ensure your network allows connections to Supabase

Can't See Certain Tables

  • If using the Publishable key, check that your RLS policies allow access

  • Try using the Secret key to verify the tables exist

  • Ensure the tables are in the public schema

Learn More

Last updated

Was this helpful?