This project involves setting up and running a system of agents to conduct SQL queries, write the output to a file, and plot graphs based on the data. We use Composio to set up the tools and OpenAI GPT-4o to power the agents. Follow this guide to set up and run the project.

SQL Agent GitHub Repository

Explore the complete source code for the SQL Agent project. This repository contains all the necessary files and scripts to set up and run the SQL Agent system using Langchain and Composio.

1

Run the `setup.sh` file

Fork and Clone this repository, Navigate to the Project Directory

cd python/examples/sql_agent

Make the setup.sh Script Executable (if necessary): On Linux or macOS, you might need to make the setup.sh script executable:

2

Imports and Environment Setup

In your Python script, import the necessary libraries and set up your environment variables.

3

Initialize Language Model and Define Tools

Initialize the language model with OpenAI API key and model name, and set up the necessary tools for the agents.

4

Define the Task and Execute SQL Query

Define the task to execute a SQL query and write the output to a file.

5

Define and Execute Code Interpreter Task

Create and execute the agent for Code Interpreter operations to plot a graph based on the extracted data.

Putting it All Together