https://github.com/tnickster/ai-analyst-agent
Ask questions about your business data in plain English, Get automatic SQL queries and visualizations, Receive AI-powered insights and recommendations, No SQL knowledge required
https://github.com/tnickster/ai-analyst-agent
ai-assistant business-analytics business-intelligence data-analysis data-analyst data-visualization database-query gpt-4 langchain llm mysql natural-language-processing openai plotly python sql-generation streamlit
Last synced: 16 days ago
JSON representation
Ask questions about your business data in plain English, Get automatic SQL queries and visualizations, Receive AI-powered insights and recommendations, No SQL knowledge required
- Host: GitHub
- URL: https://github.com/tnickster/ai-analyst-agent
- Owner: tnickster
- License: mit
- Created: 2025-05-12T17:04:51.000Z (17 days ago)
- Default Branch: main
- Last Pushed: 2025-05-12T18:12:07.000Z (17 days ago)
- Last Synced: 2025-05-12T18:25:14.395Z (17 days ago)
- Topics: ai-assistant, business-analytics, business-intelligence, data-analysis, data-analyst, data-visualization, database-query, gpt-4, langchain, llm, mysql, natural-language-processing, openai, plotly, python, sql-generation, streamlit
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Business Insights Agent
An intelligent business analytics platform powered by LLMs that translates natural language questions into SQL queries, creates visualizations, and provides actionable insights.
## 📸 Screenshots
### 1. Asking a question
### 2. Employees per department
### 3. Overall gender distribution & Follow-up
## Features
- 💬 **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## Tech Stack
- **Backend**: Python, MySQL, LangChain
- **LLM Integration**: OpenAI GPT-4
- **Data Processing**: Pandas
- **Visualization**: Plotly
- **Frontend**: Streamlit## How It Works
1. User asks a business question in natural language
2. LLM agent interprets the question and generates appropriate SQL queries
3. Queries are executed against the MySQL database
4. Results are processed and visualized
5. LLM provides insights, analyses, and recommendations based on the data## Getting Started
### Prerequisites
- Python 3.8+
- MySQL database with your business data
- OpenAI API key### Installation
1. Clone this repository
```bash
git clone https://github.com/tnickster/ai-analyst-agent.git
cd ai-analyst-agent
```2. Install dependencies
```bash
pip install -r requirements.txt
```3. Create a `.env` file with your configuration
```
OPENAI_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
```### Running the Application
#### Streamlit Web Interface
```bash
streamlit run app.py
```#### Command Line Interface
```bash
python main.py
```## Project Structure
```
├── 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
```## Demo
Soon to be implemented
## Future Improvements
- Support for additional databases (PostgreSQL, SQLite, etc.)
- Custom visualization options
- Data export functionality
- User authentication and access controls
- Multi-tenant support for multiple databases## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.
## Contact
Nicholas Tarazi - [email protected]
Project Link: [https://github.com/tnickster/ai-analyst-agent](https://github.com/tnickster/ai-analyst-agent)