Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👕 T-Shirt Inventory Chatbot with LangChain & Streamlit

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!


🚀 Features

  • 💬 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

🗂️ Project Structure

├── 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

Required packages include:

  • streamlit

  • langchain

  • langchain-community

  • langchain-experimental

  • huggingface-hub

  • chromadb

  • pymysql

  • sentence-transformers

  • ollama

Note: You must have Ollama installed and running a compatible model like llama3.

🎥 Demo Video

Quick.example.mp4

SQL QUERY Verification:

Image

Answer verification using MySQL

Capture d'écran 2025-10-03 104912

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages