Skip to content

umerkhalil02/shopquick-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopQuick Support Agent 🛍️

An AI-powered customer support chatbot for an e-commerce store, built with a hybrid RAG + tool-calling architecture.

Live Demo → https://shopquick-chatbot.streamlit.app/


Architecture

User Query
    │
    ▼
┌─────────────────────┐
│   Query Classifier  │  is_policy_question()
└─────────────────────┘
    │               │
    ▼               ▼
Policy Q?       Order/Inventory Q?
    │               │
    ▼               ▼
┌────────┐     ┌──────────┐
│  RAG   │     │  Tools   │
│        │     │          │
│Chunks  │     │order_tool│
│from    │     │inventory │
│ChromaDB│     │_tool     │
└────────┘     └──────────┘
    │               │
    └───────┬───────┘
            ▼
    ┌───────────────┐
    │  Groq LLaMA   │
    │  3.3 70B       │
    └───────────────┘
            │
            ▼
        Response

Why hybrid?

  • RAG handles unstructured policy documents (return policy, shipping, refunds) — data that changes rarely and lives in text files
  • Tools handle structured live data (order status, inventory) — data that changes constantly and lives in a database
  • A classifier routes queries to the right path, avoiding unnecessary embedding calls on structured queries

Features

  • Answer return, refund, exchange & shipping policy questions via RAG
  • Look up order status by order ID via tool calling
  • Check product availability by size via tool calling
  • Conversation memory within a session
  • Clickable suggested questions
  • Clean chat UI with Streamlit

Tech Stack

Component Technology
LLM Groq (LLaMA 3.3 70B) — free
Embeddings sentence-transformers (local) — free
Vector DB ChromaDB (local) — free
UI Streamlit
Language Python 3.10+

Run Locally

1. Clone the repo

git clone https://github.com/your-username/ecom-support-agent.git
cd ecom-support-agent

2. Install dependencies

pip install -r requirements.txt

3. Add your Groq API key

cp .env.example .env
# Edit .env and add your key from https://console.groq.com

4. Run the app

streamlit run app.py

The policy document is ingested automatically on first run.


Project Structure

ecom-support-agent/
├── app.py                   # Streamlit UI + agent logic
├── main.py                  # Terminal version (alternative)
├── requirements.txt
├── .env.example
├── data/
│   ├── policy.txt           # Store policy document (RAG source)
│   └── mock_db.py           # Mock orders and inventory
├── tools/
│   ├── order_tool.py        # get_order_status() + OpenAI-compatible schema
│   └── inventory_tool.py    # check_inventory() + schema
├── rag/
│   ├── ingest.py            # Chunk → embed → store in ChromaDB
│   └── retriever.py         # Embed query → retrieve top-k chunks
└── .streamlit/
    └── secrets.toml         # API keys for deployment (not committed)

Sample Queries

Query Path taken
"What is your return policy?" RAG → policy chunks → LLM
"Status of order ORD-1002?" Tool → mock DB → LLM
"Is Classic White Tee in size M available?" Tool → mock DB → LLM
"Can I exchange a damaged item?" RAG → policy chunks → LLM

About

An AI-powered customer support chatbot for an e-commerce store, built with a hybrid RAG + tool-calling architecture.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages