A Retrieval-Augmented Generation (RAG) project that converts natural language into SQL queries — allowing users to query structured databases conversationally.
RAG SQL Assistant enables users to ask questions in plain English such as:
“List all customers from Delhi older than 30.”
The system:
- Uses an LLM (Groq API) to convert the query into SQL.
- Executes the SQL query on the connected database (SQLite).
- Returns the structured results to the user.
- Handles ambiguity by asking clarification questions (e.g., when multiple tables are found).
This project showcases how RAG + LLMs + databases can create a bridge between human language and structured data.
- 🗣️ Natural Language Querying — Converts plain text to SQL.
- 🔍 Retrieval-Augmented Generation (RAG) — Uses ChromaDB and embeddings for semantic retrieval and context grounding.
- 🧠 Clarification Handling — LLM intelligently asks follow-up questions when multiple tables exist.
- 💾 Database Integration — Currently supports SQLite, easily extendable to MySQL/PostgreSQL.
- ⚙️ Modular Codebase — Separate layers for database connector, RAG pipeline, and API integration.
| Layer | Technologies |
|---|---|
| Language Model | Groq API (LLM inference) |
| Embeddings | HuggingFace (sentence-transformers/all-MiniLM-L6-v2) |
| Vector Store | ChromaDB |
| Framework | FastAPI |
| Database | SQLite (extendable to MySQL/PostgreSQL) |
| Language | Python 3.10+ |