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.
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.
- 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.
- 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
https://ecommerce-chat-assistant.streamlit.app/
-
Clone the Repository
git clone https://github.com/MindMatrixPro/E_Commerce_Chatbot.git cd "E-Commerce Chat bot"
-
Install Dependencies
pip install -r requirements.txt
-
Install Dependencies
GROQ_API_KEY=your_api_key_here GROQ_MODEL=llama-3.3-70b-versatile
-
Run the Streamlit App
streamlit run app/main.py
🔹 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.
To Contribute, please submit issues or pull requests for enhancements or fixes.
Licensed under the Apache 2.0 License.