←back to tutorials
Getting started with Supabase AI Agents
Learn how to build Supabase AI agents using ChatBotKit. This tutorial guides you through logging in, obtaining credentials, creating a blueprint, and testing your bot to query a Supabase database effectively.
In this tutorial you we will learn how to build Supabase AI agents using ChatBotKit. Our goal is to set up an AI agent that can query a Supabase database and deliver the results.
Step 1: Log Into Your Supabase Account
Before we start, you need to log in to your Supabase account where your database resides. If you don’t have a Supabase account, you can create one at Supabase.
Step 2: Obtain Supabase Credentials
To find your Supabase URL and credential:
- Click on “Connect” button in Supabase dashboard.
- Change the tab to “App Frameworks”.
- Here, you'll find your Supabase URL and the public anon key. These are the two key pieces of information you need to copy for setting up your integration.
Step 3: Log Into Your ChatBotKit Account
Log into your ChatBotKit account. If you don’t have one, you can create an account at ChatBotKit.
Step 3: Create a New Blueprint
To create a new blueprint:
- Click on 'Blueprints' then on 'Create new blueprint'.
- Start from a Blank template that includes just one bot and skillset.
- Next, drag the 'Execute Supabase SQL Query' ability into your blueprint. It will get automatically connected to your Skillset.
Step 4: Configure the API credentials
To set up the Supabase SQL query ability:
- Fill in the Supabase URL field with the URL you copied from your Supabase account.
- Find the secret and fill in the Supabase credential field with the anon key you copied from your Supabase account.
Step 6: Name and Build Your Solution
- Give your bot a name.
- Click 'Build' to save everything.
Step 8: Test Your Bot
To test your bot:
- Click on the button with two lines at the bottom of the screen. This will open the Colabo application.
- Type the bot's name and ask a question.
- If everything is set up correctly, the bot should generate the most appropriate SQL query and return results.
And that's all! You have successfully built a Supabase AI agent using ChatBotKit that retrieves data from a Supabase database.