This project is an AI-powered chatbot that allows users to ask questions in natural language about a t-shirt inventory stored in a MySQL database. The chatbot automatically translates these questions into SQL queries using LangChain, and displays the answer—no SQL knowledge needed!
- 💬 Ask natural language questions (e.g., "How many red Nike shirts in size M?")
- 🤖 Automatic SQL generation using LangChain + LLM (LLaMA via Ollama)
- 🧠 Uses few-shot learning with semantic similarity to improve prompt quality
- 📊 SQL database with randomized t-shirt inventory and discounts
- 🖥️ Simple and interactive Streamlit web interface
├── main.py # Streamlit UI for user interaction
├── Builder.py # Core logic: builds the LangChain SQL chain
├── few_shots.py # Few-shot examples to improve SQL generation
├── tshirt_db_creation.sql # SQL script to set up and populate the database
-
streamlit
-
langchain
-
langchain-community
-
langchain-experimental
-
huggingface-hub
-
chromadb
-
pymysql
-
sentence-transformers
-
ollama
Quick.example.mp4