Multi-agent system powered by LangChain + LangGraph for seamless shopping experiences across mobile, web, chat, and physical stores.
This prototype demonstrates an AI-powered sales orchestration system that:
- ✅ Unifies customer context across all channels (mobile → WhatsApp → in-store kiosk → post-purchase)
- ✅ Uses 6 specialized AI agents coordinated by LangGraph
- ✅ Handles edge cases automatically (payment retry, out of stock, order modifications)
- ✅ Provides real-time agent visualization
- ✅ Maintains persistent memory across sessions
- ✅ Voice Input/Output with Indian English accent (Web Speech API)
- ✅ Multilingual Support for 7 Indian languages with backend translation
- ✅ In-Store Kiosk with barcode scanning, try-on reservations, and POS payment
- ✅ Post-Purchase Follow-up for customer engagement
┌─────────────────┐
│ Orchestrator │ ← Master coordinator (LangGraph)
└────────┬────────┘
↓
┌────┴────┐
│ Agents │
└─────────┘
├─ Recommendation Agent (Product suggestions)
├─ Inventory Agent (Stock management)
├─ Payment Agent (Transaction processing)
├─ Fulfillment Agent (Delivery scheduling)
├─ Loyalty Agent (Offers & points)
└─ Support Agent (Returns & issues)
Backend:
- FastAPI (async web framework)
- LangChain (AI framework)
- LangGraph (multi-agent orchestration)
- Claude API (Anthropic)
- WebSockets (real-time updates)
- Persistent file-based storage
- Google Translate API (multilingual support)
Frontend:
- HTML5, CSS3, JavaScript (Vanilla)
- WebSocket client
- Responsive design
- Web Speech API (voice input/output)
- localStorage (session persistence)
# Required
- Python 3.9+
- pip
- Claude API key (from console.anthropic.com)
# Optional
- Git- Clone/Download the project
git clone <your-repo>
cd retail-ai-orchestrator- Install Python dependencies
cd backend
pip install -r requirements.txt
# This includes:
# - fastapi, uvicorn
# - langchain, langgraph, langchain-anthropic
# - googletrans==4.0.0rc1 (for multilingual support)
# - websockets, aiofiles, httpx- Set up environment variables
Create backend/.env file:
# Claude API
ANTHROPIC_API_KEY=sk-ant-xxxxx
ANTHROPIC_MODEL=claude-sonnet-4-20250514
# Server
FASTAPI_HOST=0.0.0.0
FASTAPI_PORT=8000
DEBUG_MODE=True
# CORS
ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000- Create data files
cd backend
mkdir -p data
touch data/products.json data/customers.json data/stores.json data/sessions.jsonCopy the JSON data from the mock_data artifact into respective files.
- Start the backend server
cd backend
python main.py
# Or with uvicorn directly:
uvicorn main:app --reload --host 0.0.0.0 --port 8000You should see:
🚀 Starting AI Sales Orchestrator...
✅ System ready!
INFO: Uvicorn running on http://0.0.0.0:8000
- Start the frontend server
# In a new terminal
cd frontend
python -m http.server 3000- Open the demo
Visit: http://localhost:3000/index.html
-
Mobile App (
mobile.html)- Browse products
- Like 3 items (try the blue shirt!)
- Click "Continue on WhatsApp"
-
WhatsApp Chat (
whatsapp.html/chat.html)- AI remembers your likes
- Add items to cart
- Get recommendations
- Check store availability
- 🎤 Voice Input: Speak your queries (Indian English)
- 🔊 Voice Output: AI responses spoken aloud
- 🌐 Multilingual: Switch between 7 Indian languages
- Click "Visit Store" to continue in-store
-
In-Store Kiosk (
kiosk.html) ⭐ NEW- Scan product barcode (simulated)
- AI recognizes you and your cart
- Options:
- 🛍️ Reserve for Try-On (Room assignment)
- ➕ Add Liked Items to Cart
- 💳 Complete Purchase (In-Store POS)
- 🔔 Call Store Associate
- Real-time sync with store dashboard
-
Store Dashboard (
store-dashboard.html)- Store associate sees your online activity
- Your cart contents
- AI-powered recommendations
- Apply bundle offers
- Try-on room notifications
-
Checkout & Edge Cases (
agent-monitor.html)- Watch payment retry in action
- See out-of-stock handling
- Order modification demo
-
Post-Purchase Follow-up (
post-purchase.html) ⭐ NEW- Order confirmation
- Delivery tracking
- AI-powered support
- Product care recommendations
- Feedback collection
Scenario: Payment gateway fails → automatic retry
Gateway 1 (Razorpay) → FAILED (timeout)
↓
Gateway 2 (PayU) → FAILED (bank declined)
↓
UPI Direct → SUCCESS
↓
Total time: 2.7 seconds (automatic!)
Demo:
- Open Agent Monitor
- Click "💳 Payment Retry"
- Watch agents handle failures automatically
Scenario: Product unavailable → find alternatives
Check current store → OUT OF STOCK
↓
Scan 5 nearby stores → Found at 2 locations
↓
Find alternative products → 2 variants available
↓
Notify customer with 3 options
Demo:
- Open Agent Monitor
- Click "📦 Out of Stock"
- See inventory agent providing alternatives
Scenario: Customer changes quantity → recalculate everything
Change quantity 1 → 2
↓
Parallel execution:
├─ Inventory: Check stock ✓
├─ Loyalty: Recalculate offers ✓
└─ Payment: Update total ✓
↓
New discount applied automatically
Total time: 1.6 seconds
Demo:
- Open Agent Monitor
- Click "✏️ Order Modify"
- Watch parallel agent coordination
POST /api/session/create?customer_id=CUST001
GET /api/session/{session_id}POST /api/products/like
GET /api/products/recommendations/{session_id}POST /api/cart/add
POST /api/cart/updatePOST /api/store/check
POST /api/store/reservePOST /api/payment/processPOST /api/translate
# Body: {"text": "...", "source_lang": "auto", "target_lang": "hi"}
# Supported languages: en, hi, mr, gu, ta, te, bnPOST /api/chatWS /ws/{session_id}
The Agent Monitor shows:
- Real-time agent status (idle/processing/success/failed)
- Execution logs with timestamps
- Agent call counts
- Total orchestration metrics
Color Coding:
- 🔵 Blue: Orchestrator
- 🟡 Yellow: Recommendation
- 🟣 Purple: Inventory
- 🟢 Green: Payment Success
- 🔴 Red: Errors
Session Data (stored in data/sessions.json):
{
"session_id": "SESSION_abc123",
"customer_id": "CUST001",
"liked_products": ["VH001", "VH002"],
"cart": [{...}],
"conversation_history": [{...}],
"channel": "whatsapp",
"reserved_store": "Bandra Store"
}Mobile App → Likes products → Saved to session
↓
WhatsApp Chat → Reads session → Sees likes
↓
Store Visit → Reads session → Knows history
- Click 🎤 button in chat interface
- Speak your query in Indian English
- Auto-transcribes and sends message
- Supports natural language queries
- Browser compatibility: Chrome, Edge, Safari
- Automatic for all AI responses
- Indian English (en-IN) accent
- Cleans emojis and markdown before speaking
- Cancels previous speech when new message arrives
1. Click 🎤 → Say "Show me blue shirts" → Auto-sends
2. Listen to AI response in voice
3. Try different queries with voice
- English (en) - Default
- हिंदी Hindi (hi)
- मराठी Marathi (mr)
- ગુજરાતી Gujarati (gu)
- தமிழ் Tamil (ta)
- తెలుగు Telugu (te)
- বাংলা Bengali (bn)
- Select language from dropdown (top-right)
- Type in your preferred language
- Backend translates to English for AI processing
- Response translated back to your language
- Voice output speaks in selected language
User (Hindi): "मुझे नीली शर्ट दिखाओ"
↓ (Frontend → Backend /api/translate)
AI (English): "Show me blue shirts"
↓ (AI processes)
Response (English): "Here are blue formal shirts..."
↓ (Backend translates back)
User sees (Hindi): "यहां नीली फॉर्मल शर्ट हैं..."
- Barcode Scanning: Simulated product scanning with animation
- Session Recognition: AI identifies customer from mobile/WhatsApp journey
- Cart Display: Shows items added online
- Try-On Reservation: Assigns fitting room with store associate notification
- In-Store POS: Complete purchase at kiosk terminal
- Store Associate Call: Request human assistance
1. Complete steps 1-2 (Mobile + WhatsApp)
2. Click "Visit Store" in chat
3. Kiosk loads → Click "📷 Simulate Barcode Scan"
4. Choose action:
- Reserve for Try-On → Room assigned
- Add Liked to Cart → Updates cart
- Complete Purchase → POS payment flow
- Call Associate → Dashboard notification
Edit backend/data/products.json:
{
"product_id": "VH009",
"name": "Your Product Name",
"price": 2999,
"category": "Category",
"tags": ["tag1", "tag2"]
}- Create
backend/agents/your_agent.py:
from agents.base_agent import BaseAgent
class YourAgent(BaseAgent):
def __init__(self):
super().__init__("Your Agent", "Description")
async def _execute(self, state):
# Your logic here
return {"result": "data"}- Register in
backend/graph/orchestrator_graph.py
All frontend files are in frontend/:
index.html- Main controller/launchermobile.html- Mobile app viewchat.html- Enhanced chat with voice & multilingualwhatsapp.html- WhatsApp-style interfacekiosk.html- In-store kiosk terminalstore-dashboard.html- Store associate viewagent-monitor.html- Agent visualizationpost-purchase.html- Order confirmation & follow-upimages/- Product images
CSS is inline for easy customization.
# Check Python version
python --version # Should be 3.9+
# Install dependencies again
pip install -r requirements.txt
# Check port availability
lsof -i :8000 # Kill any process using port 8000- Check CORS settings in
backend/config.py - Ensure backend is running on port 8000
- Check browser console for errors
# Check API key
echo $ANTHROPIC_API_KEY
# Test API key
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01"- Use supported browser: Chrome, Edge, or Safari
- Allow microphone access when prompted
- Check HTTPS: Voice API requires secure context (or localhost)
- Browser console will show if Web Speech API is unavailable
# Verify googletrans is installed
pip install googletrans==4.0.0rc1
# Test translation endpoint
python test_translation.py
# Check backend logs for translation errors- Check
backend/data/sessions.jsonexists - Verify write permissions
- Check browser localStorage for
session_id
Expected Response Times:
- Session creation: <100ms
- Product like: <50ms
- AI chat response: 1-3s
- Agent orchestration: 0.5-2s
- Payment with retry: 2-3s
- WebSocket updates: <50ms
Agent Execution Times:
- Orchestrator: 0.1-0.3s
- Recommendation: 0.3-0.8s
- Inventory: 0.2-0.5s
- Payment: 0.5-2.5s (with retries)
- Loyalty: 0.2-0.4s
- Support: 0.2-0.5s
- LangGraph-based workflow
- 6 specialized agents
- Parallel execution
- Smart routing
- Cross-channel context
- File-based storage
- Session management
- Conversation history
- WebSocket updates
- Agent status monitoring
- Live logs
- Performance metrics
- Payment auto-retry
- Out-of-stock alternatives
- Dynamic recalculation
- Graceful failures
- Voice input (speech-to-text)
- Voice output (text-to-speech)
- 7 Indian languages supported
- Real-time translation
- Indian English accent
- Physical kiosk interface
- Barcode scanning simulation
- Try-on room reservations
- In-store POS payment
- Store associate notifications
- Seamless channel switching (5 touchpoints)
- Context preservation across all channels
- Natural conversations
- Professional UI
- Accessibility (voice, multilingual)
Key Talking Points:
- Problem: Fragmented customer experiences cost retailers billions, language barriers limit accessibility
- Solution: AI orchestrator unifying all touchpoints with voice & multilingual support
- Technology: LangChain + LangGraph + Web Speech API + Google Translate for intelligent coordination
- Impact: 15-25% conversion increase, better customer satisfaction, inclusive shopping experience
- Innovation: Real-time edge case handling, persistent memory, voice-enabled multilingual shopping
- Physical-Digital Bridge: In-store kiosk seamlessly continues online journey
Demo Script (Enhanced):
- Show mobile app - Browse & like products (30 sec)
- Switch to WhatsApp - Add to cart, demo voice input 🎤 (45 sec)
- Demo multilingual - Switch language, see translation (30 sec)
- In-store kiosk - Scan barcode, reserve try-on (45 sec)
- View store dashboard - Associate sees notifications (30 sec)
- Run agent monitor with edge cases (60 sec)
- Highlight key metrics & features (20 sec)
Total demo time: ~4 minutes
Wow Factors to Emphasize:
- 🎤 Speak to shop (voice input in Indian English)
- 🌐 7 languages supported (inclusivity)
- 🏪 Physical store knows your online journey
- 🤖 Intelligent edge case handling
- ⚡ Real-time everything
For issues or questions:
- Check this README
- Review inline code comments
- Check browser console for errors
- Review backend logs
You now have a fully functional AI Sales Orchestrator prototype. Good luck with Techathon 6.0! 🚀
Built with ❤️ using LangChain, LangGraph, and Claude AI