An intelligent business analytics platform powered by LLMs that translates natural language questions into SQL queries, creates visualizations, and provides actionable insights.
- 💬 Natural Language Interface: Ask questions in plain English about your business data
- 📊 Automatic Visualizations: Generates appropriate charts based on query results
- 🔍 Root Cause Analysis: Identifies underlying factors contributing to business trends
- 📈 Actionable Recommendations: Suggests next steps based on data insights
- 🔄 Follow-up Questions: Recommends additional queries to deepen your analysis
- Backend: Python, MySQL, LangChain
- LLM Integration: OpenAI GPT-4
- Data Processing: Pandas
- Visualization: Plotly
- Frontend: Streamlit
- User asks a business question in natural language
- LLM agent interprets the question and generates appropriate SQL queries
- Queries are executed against the MySQL database
- Results are processed and visualized
- LLM provides insights, analyses, and recommendations based on the data
- Python 3.8+
- MySQL database with your business data
- OpenAI API key
-
Clone this repository
git clone https://github.com/tnickster/ai-analyst-agent.git cd ai-analyst-agent
-
Install dependencies
pip install -r requirements.txt
-
Create a
.env
file with your configurationOPENAI_API_KEY=your_openai_api_key DB_HOST=your_db_host DB_PORT=your_db_host DB_USER=your_db_user DB_PASSWORD=your_db_password DB_NAME=your_db_name
streamlit run app.py
python main.py
├── app.py # Streamlit web interface
├── main.py # Command line interface
├── tools.py # Core functionality, SQL processing, visualization
├── prompt.txt # System prompt for the LLM agent
├── requirements.txt # Python dependencies
└── README.md # This file
Soon to be implemented
- Support for additional databases (PostgreSQL, SQLite, etc.)
- Custom visualization options
- Data export functionality
- User authentication and access controls
- Multi-tenant support for multiple databases
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Nicholas Tarazi - Nicholas.Tarazi7@gmail.com
LinkedIn: https://www.linkedin.com/in/nicholas-tarazi/
Project Link: https://github.com/tnickster/ai-analyst-agent