How to set up supabase local API in V2 Supabase RAG AI Agent?

Hello,

I’m trying to configure V2 Supabase RAG AI Agent following the Run Supabase 100% LOCALLY for Your AI Agents video ( https://youtu.be/pOsO40HSbOo ).

I’m stuck on Delete Old Doc Rows which requires the correct host for Supabase API.

I’ve tried :

But I still get the error message “Couldn’t connect with these settings” “Couldn’t connect with these settings
ECONNREFUSED”

What are the possible errors?
a) I’m entering the wrong url. Supabase is installed via docker via local-ai-packaged. What credential do you use for “Delete Old Doc Rows”?

b) I’ve entered the wrong Service Role Secret? I took what I had put in .env for SERVICE_ROLE_KEY

c) My supabase isn’t ready: I’ve just logged in, but haven’t done anything on it yet. Maybe the first tables need to be created, I don’t know. I wonder how well it works. If, for example, I go to API Docs I get this message: “Something went wrong :face_with_head_bandage:
Sorry about that, please try again later or feel free to reach out to us if the problem persists.”

Does anyone have any ideas on how to solve this problem?

Thanks a lot !

1 Like

Try http://kong:8000

kong is the name of the dashboard service in the Supabase Docker Compose stack, so you want to use that name to communicate with the container directly!

If that doesn’t work I’d check to see if there are any containers for Supabase that aren’t running or are constantly restarting.

1 Like

Thank you very much for your reply.

I have tried the following:
http://kong:8000
http://supabase-kong:8000 (as shown in this video https://youtu.be/Vwy9rrXaz_E )

But It couldn’t connect.

Yes, you’re right, there are containers for Supabase that restart constantly:
supabase/storage-api:v1.19.3 “docker-entrypoint.s…” 2 days ago Restarting (1) 24 seconds ago
supabase/storage-api:v1.19.3 “docker-entrypoint.s…” 2 days ago Restarting (1) 24 seconds ago supabase-storage
supabase/postgres-meta:v0.86.1 “docker-entrypoint.s…” 2 days ago Up 3 hours (healthy) supabase-meta
supabase/studio:20250224-d10db0f “docker-entrypoint.s…” 2 days ago Up 3 hours (healthy) supabase-studio
kong:2.8.1 “bash -c 'eval "echo…” 2 days ago Up 3 hours (healthy) supabase-kong
supabase/supavisor:2.4.12 “/usr/bin/tini -s -g…” 2 days ago Restarting (1) 3 seconds ago supabase-pooler
supabase/realtime:v2.34.40 “/usr/bin/tini -s -g…” 2 days ago Up 3 hours (healthy) realtime-dev.supabase-realtime
supabase/gotrue:v2.170.0 “auth” 2 days ago Restarting (2) 24 seconds ago supabase-auth
supabase/edge-runtime:v1.67.2 “edge-runtime start …” 2 days ago Up 3 hours supabase-edge-functions

I’ll try to investigate this.

This may be due to passwords containing incorrect characters %, ?, "… I’ll try to make a clean new installation of the local ai package with cleaner passwords.

Yes, it was due to passwords containing incorrect characters %, ?, "

I tried to change them but without success. So I deleted everything and started form scatch with a new configuration.

And it works with both urls:

http://kong:8000

http://supabase-kong:8000

I don’t know if it’s the same thing or if it’s better to choose kong or supabase-kong but it works :slight_smile: Let’s follow with the video https://youtu.be/Vwy9rrXaz_E

2 Likes

Both are ok, thats cause of the docker-compose of supabase:

The default would be “kong” but we gave it another one to with container_name attribute, which is supabase-kong.

2 Likes

Ok thanks a lot for your reply :slight_smile:

1 Like

I’ve tried both http://kong:8000 and http://supabase-kong:8000 with no connection. Also, my supabase-kong Docker container shows TWO active ports - 8000 and 8443. The 8443 port displays “400 Bad Request. The plain HTTP request was sent to HTTPS port”

Hello,

First, check if there are any containers for Supabase that aren’t running or are constantly restarting.

If yes, have you checked your passwords in.env ? Maybe there is special characters ( % à è ? "…) ?