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.

Note: This is a Python only example. JS version coming soon!

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

Imports and Environment Setup

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

2

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.

3

Define the Task and Execute SQL Query

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

4

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