Skip to content

mritunjayk-ops/SQL-RAG-Assisitant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL-RAG-Assisitant

A Retrieval-Augmented Generation (RAG) project that converts natural language into SQL queries — allowing users to query structured databases conversationally.


🚀 Overview

RAG SQL Assistant enables users to ask questions in plain English such as:

“List all customers from Delhi older than 30.”

The system:

  1. Uses an LLM (Groq API) to convert the query into SQL.
  2. Executes the SQL query on the connected database (SQLite).
  3. Returns the structured results to the user.
  4. 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.


🧩 Key Features

  • 🗣️ 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.

🧰 Tech Stack

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+

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages