An AI-powered data analysis tool that lets you query Excel/CSV files and MySQL databases using natural language in any language. Get insights, visualizations, and SQL queries through a simple chat interface.
- Multilingual Support: Ask questions in any language (Hindi, Spanish, French, etc.) and get responses in the same language
- Dual Database Support: Work with MySQL databases or upload Excel/CSV files
- Smart Visualizations: Automatic chart generation with insights
- Natural Language to SQL: Convert questions to SQL queries automatically
- Existing Table Access: Connect to MySQL and use existing tables instantly
- File Upload: Upload Excel/CSV files for analysis
- Interactive Web Interface: Clean Streamlit-based UI
- Python 3.8+
- Ollama with Llama3 model:
# Install Ollama curl -fsSL https://ollama.ai/install.sh | sh # Pull Llama3 model ollama pull llama3 # Start Ollama server ollama serve
- MySQL (optional): For database connectivity
-
Clone the repository:
git clone <repository-url> cd llm-data-analyst
-
Install dependencies:
pip install -r requirements.txt
-
Start the application:
streamlit run web_interface.py
-
Open your browser: Navigate to
http://localhost:8501
- Enter MySQL credentials in the sidebar
- Click "Connect to MySQL"
- View existing tables in the dropdown
- Ask questions about your data
- Click "Work with Files Only" or just upload files
- Upload Excel/CSV files
- Enter table names for your files
- Click "Load" for each file
- Ask questions about your data
English:
- "What are the top 5 products by sales?"
- "Show me revenue by region"
- "Which customers bought the most?"
Hindi:
- "सबसे ज्यादा बिकने वाले उत्पाद कौन से हैं?"
- "क्षेत्रवार आय दिखाएं"
Spanish:
- "¿Cuáles son los productos más vendidos?"
- "Muestra los ingresos por región"
PIE-CHART:what is the distribution of sales by region line-GRAPH:- "सबसे ज्यादा बिकने वाले उत्पाद कौन से हैं?"
llm-data-analyst/
├── web_interface.py # Main Streamlit app
├── data_analyst_mysql.py # Core analysis engine
├── enhanced_visualizer.py # Chart generation
├── requirements.txt # Dependencies
└── README.md # This file
- Ollama URL: Default
http://localhost:11434 - MySQL Settings: Host, Port, Username, Password, Database
- File Upload: Supports .xlsx, .xls, .csv formats
- English, Hindi, Spanish, French, German, Italian, Portuguese, Russian, Chinese, Japanese, Korean, Arabic, and many more
- Automatic language detection and translation
- Responses in the same language as input
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
##COMMANDS TO RUN ollama --version ##to check ollama version
ollama pull llama3 ## to install ollama
ollama pull llama2
python setup_mysql.py ##to setup mysql
pip install -r requirements.txt ##Install all dependencies
streamlit run web_interface.py ## run the project on streamlit
