Build an intelligent, multilingual customer support chatbot for e-commerce platforms that leverages NLP and machine learning to provide instant, accurate responses in both English and Urdu.
- Framework: React with TypeScript
- Build Tool: Vite
- Styling: CSS with design tokens (glassmorphism)
- State Management: Zustand
- HTTP Client: Axios
- Runtime: Bun.js
- Framework: Hono.js
- Language: TypeScript
- Database: MongoDB (Mongoose)
- Cache: Redis
- LLM Integration: Groq API
- Agent Framework: Custom multi-agent orchestration
- Containerization: Docker & Docker Compose
- Logging: Pino
┌─────────────────────────────────────────────────────────┐
│ Frontend (React) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Chat Widget │ │ Order Track │ │ Product Info │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└────────────────────────┬────────────────────────────────┘
│ REST API
┌────────────────────────▼────────────────────────────────┐
│ Backend (Hono.js + Bun) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ AI Agent Orchestrator │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Intent │ │ FAQ │ │ Order │ │ │
│ │ │ Agent │ │ Agent │ │ Agent │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ │ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Product │ │ Language │ │ │
│ │ │ Agent │ │ Agent │ │ │
│ │ └──────────┘ └──────────┘ │ │
│ └──────────────────────────────────────────────────┘ │
└────────────┬────────────────┬──────────────────────────┘
│ │
┌────────▼────────┐ ┌───▼──────┐
│ MongoDB │ │ Redis │
│ (Conversations, │ │ (Cache, │
│ Products, FAQs)│ │ Sessions)│
└─────────────────┘ └──────────┘
Analyzes user message and determines intent:
- greeting
- faq_query
- order_tracking
- product_inquiry
- complaint
- feedback
- other
- Detects language (Urdu/English)
- Translates if needed
- Maintains conversation context
- Searches FAQ database
- Semantic matching
- Returns answer in user's language
- Order lookup by ID, email, or phone
- Status updates
- Tracking information
- Product search
- Details retrieval
- Availability check
Coordinates between agents:
- User Message → Language Agent
- Translated Message → Intent Agent
- Route to Specialized Agent
- Generate Response
- Translate back if needed
- Return to User
POST /api/v1/chat/message- Process user messagePOST /api/v1/chat/session- Create new sessionGET /api/v1/chat/session/:id- Get historyDELETE /api/v1/chat/session/:id- End session
GET /api/v1/orders- List ordersGET /api/v1/orders/:id- Get order detailsGET /api/v1/orders/track/:tracking- Track order
GET /api/v1/products- List productsGET /api/v1/products/search- Search productsGET /api/v1/products/:id- Get product
GET /api/v1/faqs- List FAQsGET /api/v1/faqs/search- Search FAQs
- sessionId, userId, platform
- messages (role, content, language, timestamp)
- status, sentiment
- question (en, ur)
- answer (en, ur)
- category, keywords, priority
- name (en, ur), description (en, ur)
- category, price, stock, images
- orderId, userId, status
- items, total, shipping info, tracking
- Automatic language detection
- Translation between English and Urdu
- RTL support for Urdu
- Context preservation
- Semantic search
- Category filtering
- Confidence scoring
- Fallback to general AI
- Multiple search methods
- Real-time status
- Visual timeline
- NLP-based search
- Recommendations
- Stock information
- Voice support
- Image recognition
- Live agent handoff
- Analytics dashboard
- More languages
- Shopify/WooCommerce integration