Using AI Agents
Built-in Skills
SQL Agent

What is SQL Agent and how to use it?

The built-in SQL agent is a skill that you can leverage to run real-time analytics and queries against a real relational database. The agent can do all of the following:

  • list-databases: View its current connections and sources it can leverage.
  • list-tables: View all of the available tables within a database.
  • check-table-schema: Check the available columns of a table for types and possible value stores.
  • query: Run a valid SQL query on a database to product a set of rows that will later be used in your answer.
️🔧

Caution!

You should use the SQL agent with a read-only database user. While the agent is instructed to not provide anything other than SELECT statements, this does not prevent it from running other SQL commands that could modify your data!

Example 1:
@agent can you summarize all of the sales volume for May 2024 in the backend-office DB?

Example 2: (assuming you have the save-file skill enabled)
@agent can you grab the emails of the most recent 10 customers and save that to customer.csv?