Skip to content

Latest commit

 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Data Analyst Assistant

Python Streamlit SQLite Ollama LLM


🚀 What is this?

An AI-powered Data Analyst Assistant that converts natural language questions into SQL queries and generates real-time insights from CSV/Excel datasets.

Instead of manually writing SQL queries, users can simply ask business questions in plain English and the assistant automatically:

  • Generates SQL queries
  • Executes them on structured data
  • Displays results instantly
  • Creates automatic visualizations

✨ Features

✅ Upload CSV or Excel datasets
✅ Ask business questions in plain English
✅ Automatic SQL query generation
✅ SQLite in-memory execution
✅ Real-time data visualization
✅ Local LLM integration (Ollama – gemma3)
✅ No cloud API required


🧠 How It Works

User Question
→ LLM converts question to SQL
→ SQLite executes SQL
→ Streamlit displays results
→ Automatic visualization generated

This completely removes the need for manual SQL writing.


📊 Example Queries

  • Top 5 customers by sales
  • Total revenue by month
  • Average order value
  • Sales by region
  • Monthly growth trend

🛠 Tech Stack

Layer Technology
UI Streamlit
Data Processing Pandas
Database SQLite (In-Memory)
LLM Ollama (gemma3 local model)
Visualization Streamlit Charts

💻 Quick Setup

1️⃣ Clone the Repository

git clone https://github.com/YOUR_USERNAME/LLM-Data-Analyst-Assistant.git
cd LLM-Data-Analyst-Assistant

2️⃣ Install Dependencies

pip install streamlit pandas openpyxl requests

3️⃣ Install Ollama (Local LLM)

Download from:

https://ollama.com/download

Make sure Ollama Desktop is running.

4️⃣ Ensure Model is Available

Use an installed model such as:

gemma3:4b

Check available models:

Invoke-RestMethod http://localhost:11434/api/tags

5️⃣ Run the App

streamlit run app.py

Open in browser:

http://localhost:8501

📊 Example Use Case

👨‍💼 Business Manager asks:

Which customer generated the highest revenue this quarter?

The Assistant:

  • Converts question into SQL
  • Aggregates data
  • Sorts by revenue
  • Returns top customer instantly
  • Displays a visualization

🎯 Why This Project?

  • This project demonstrates:

  • LLM + SQL integration

  • Local AI deployment (No OpenAI API required)

  • Real-time analytics

  • Business intelligence automation

  • Practical AI application for decision-making

About

AI-powered data analyst assistant that converts natural language questions into SQL, analyzes CSV/Excel datasets, and generates real-time insights using a local LLM with Ollama.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages