DEV Community

Cover image for Chat with your Supabase Database using Natural language and Supercog
Emmanuel Onwuegbusi
Emmanuel Onwuegbusi

Posted on

Chat with your Supabase Database using Natural language and Supercog

This article will teach you how to interact with your Supabase database using natural language through Supercog.

Supercog is an advanced AI platform that transforms productivity by connecting directly to your business systems and automating tasks. It enables real-time data analysis, generates insights, and empowers teams to create customizable AI solutions tailored to their needs.

Outline

  • Get your Supabase Database URL
  • Sign up on Supercog
  • Create an Agent or Click Supercog
  • Add tools
  • Enter query
  • Conclusion

Get your Supabase Database URL

Go to your supabase Project Settings -> Database -> Connection string
Copy your connection string. You will need it to connect to your supabase database.

Sign up on Supercog

Go to Supercog's page https://app.supercog.ai/ and sign up:

supercog signup/login page

Create an Agent or click Supercog

Click the Supercog tab to start chatting quickly or Create a New Agent for the task you want to accomplish. We will click on the Supercog tab for this article to chat quickly.

supercog homepage

Add tools

  • From the right, click on the Add Tool button:

add tool button

  • From there, click on the Connectors tab, you will see Database as an option. Click on the '+' button then Make a connection:

supercog database tool

  • Once you click on the Make connection button, you will be shown the New Connection: Database pop up:

New Connection: Database
You will need to put in the connection string you copied from supabase to The Connection URL for the database input box, then you click Save.

  • Add The Charting tools. Click on Dev Tools Tab, then click the '+' button to add the Charting tool. We will use this to create our plot.

supercog tools-charting

Enter query

We can now start chatting with our connected supabase database. You can ask any question you want about your database.

For me, I entered the following prompt:
What were the top 3 products sold in the month of August? Make a plot of the result. Use the product_data table and sales_data table but first get their schema

since I have a product table and a sales table. I wanted to know my top 3 products sold in August and also see the plot๐Ÿ˜Š Super interesting, right?๐Ÿš€:

I got the following output. It shows my top 3 products sold in the month of August and also the plot:

supercogdatabasetoolresult

Conclusion

Interacting with your database is just one of those things you can do with supercog. You can also:

  • Automate Repetitive Tasks: Set up agents to handle routine processes on a scheduled or on-demand basis.
  • Connect to various business systems like HubSpot, Postgres, and Jira for seamless data flow
  • Do advanced Data Analysis
  • Generate Reports & Insights
  • Connect to Popular SaaS Applications: Utilize integrations with popular applications for enhanced functionality.
  • Process File Data: Read and process various file types to extract and utilize relevant information. etc.

Top comments (0)