SQL Agent
This guide provides detailed steps to create an agent that leverages Composio to perform SQL queries and file operations to perform sql queries and File operations and plot insightful graphs on the data in the db
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.
Imports and Environment Setup
In your Python script, import the necessary libraries and set up your environment variables.
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.
Define the Task and Execute SQL Query
Define the task to execute a SQL query and write the output to a file.
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
Was this page helpful?