Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🛒 E-commerce Chat Bot

An AI-powered shopping assistant that helps users discover products, ask FAQs, and chat naturally — all in a clean Streamlit UI. The bot routes each message to the best handler (FAQ, SQL, or Small Talk) and responds fast using a mix of semantic search (RAG), LLM reasoning (Groq Llama 3.3), and a local SQLite database for product lookups.

ChromaDB Groq pandas python-dotenv Semantic Router Streamlit Sentence Transformers pysqlite3-binary


Why this project?

Most e-commerce search bars only accept rigid filters. This project lets shoppers ask in plain language (e.g., “show me running shoes under ₹2000 with 500+ reviews”) and get relevant, explainable results. On top of product search, it also answers store FAQs (returns, shipping, warranty) and keeps the conversation friendly with small talk.


✨ Key Features

  • Intent-aware chat via a Semantic Router that classifies each message into:
    • faq → platform/policy questions (answered with RAG)
    • sql → structured product search (answered via SQLite)
    • smalltalk → friendly, general conversation
  • RAG for FAQs using ChromaDB + Sentence Transformers.
  • Natural language → SQL: converts user requests into SQL and executes on a local SQLite database.
  • Streamlit UI: dynamic responses with product listings, FAQs, or small talk.
  • Zero external backend — everything runs locally.
  • Config via .env: easily switch API keys or models.

💻 Tech Stack

  • Frontend/UI: Streamlit
  • LLM Runtime: Groq (Llama-3.3-70B-versatile)
  • Vector Store: ChromaDB
  • Embeddings: Sentence Transformers
  • Router: semantic_router
  • Database: SQLite (built from CSV)
  • Data Handling: pandas
  • Environment: python-dotenv

🚀 Launch App

https://ecommerce-chat-assistant.streamlit.app/

App Screenshot

App Screenshot

Installation Steps

  1. Clone the Repository

    git clone https://github.com/MindMatrixPro/E_Commerce_Chatbot.git
    cd "E-Commerce Chat bot"
  2. Install Dependencies

    pip install -r requirements.txt
  3. Install Dependencies

    GROQ_API_KEY=your_api_key_here
    GROQ_MODEL=llama-3.3-70b-versatile
  4. Run the Streamlit App

    streamlit run app/main.py

⚙️ How It Works

🔹 Intent Detection (Semantic Router)

  • Every user message is first passed through the Semantic Router, which identifies what type of request it is. Queries are sorted into three intent categories:
    • FAQ → questions about policies, returns, and general platform info
    • SQL → product searches that rely on structured database queries
    • Small Talk → light, conversational inputs for engagement

🔹 Routing Logic

  • FAQ Handling → Uses ChromaDB with Sentence Transformers to perform semantic search across stored FAQs, returning accurate answers through a RAG pipeline.
  • SQL Handling → Translates natural language into SQL commands, runs them against the SQLite product database, and fetches relevant results.
  • Small Talk → Generates simple, human-like responses to casual or non-technical messages.

🔹 Streamlit Response Layer

  • SQL Queries → Show product cards/tables with names, prices, ratings, and links.
  • FAQ Queries → Deliver clear answers backed by FAQ data stored in CSV files.
  • Small Talk Queries → Respond in a conversational style to keep the chat engaging.

Contributing

To Contribute, please submit issues or pull requests for enhancements or fixes.


License

Licensed under the Apache 2.0 License.


About

An AI-powered shopping assistant that helps users discover products, ask FAQs, and chat naturally — all in a clean Streamlit UI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages