An AI-powered SQL analyst that converts natural language queries into SQL and visualizes results.
This project demonstrates how to build a smart agent using LangChain, LangGraph, and OpenAI, which understands English questions, translates them into SQL, runs them on a local SQLite database, and returns both raw data and charts.
- ✅ Natural Language → SQL query conversion
- ✅ Execution on a local SQLite database
- ✅ Result visualization (bar charts)
- ✅ Streamlit-based web interface
- ✅ Modular code structure (
agent.py,db_utils.py,visualizer.py)
- LangChain – For LLM integration
- LangGraph – For building the agent workflow
- OpenAI – As the LLM backend
- SQLite3 – Lightweight local database
- Streamlit – For the web UI
- [Pandas & Matplotlib](https://pandas.pydata.org/ & https://matplotlib.org/ ) – For data manipulation and charting
Make sure you have Python 3.9+ installed.
- Clone the repo:
git clone https://github.com/EloiRamos/mini-sql-analyst.git cd mini-sql-analyst