Natural Language → SQL → Instant Results on Your Database
-> Create a live MySQL database
-> Generate accurate SQL queries using an LLM (Hugging Face)
-> Execute them instantly
-> Fix errors if needed
-> Display results and insights — all from a clean web UI
Python (Flask) – Web Framework
LangGraph / LangChain – Agentic Reasoning
Hugging Face LLM – Query Understanding & Generation
MySQL – Dynamic Database Execution
git clone https://github.com/ashwinibhardwaj/AI-SQL-ASSISTANT.git
cd AI-SQL-ASSISTANT
python -m venv .venv
.venv\Scripts\activate # Windows
or
source .venv/bin/activate # macOS/Linux
pip install -r requirements.txt
FLASK_APP=app.py
HUGGINGFACEHUB_ACCESS_TOCKEN=your_huggingface_api_key
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_PASSWORD=yourpassword
MYSQL_PORT = 3306
python app.py
👉 http://127.0.0.1:5000
### Upload a .sql dump file
### Ask questions in plain English
### The AI creates a temp database, writes SQL, and executes it
### View results + natural language explanations in the UI
🧠 AI-generated SQL Queries
⚙️ Auto Database Creation from SQL Dumps
💬 Conversational Query Interface
🔁 Error Handling & SQL Fixing
📊 Smart Result Visualization
🧩 Built on LangGraph for Agentic Workflow
Rudra Pratap Singh