UtkarshTheAIMaster/ai-ticket-routing-pro
๐ซ AI Ticket Routing Pro (OpenEnv Environment)
An advanced OpenEnv-compatible Reinforcement Learning environment for simulating real-world customer support systems.
This project challenges an AI agent to intelligently:
- Classify support tickets
- Assign appropriate priority
- Decide escalation
- Generate professional responses
๐ Why This Project?
Customer support automation is a real-world, high-impact problem used by:
- SaaS companies
- E-commerce platforms
- Enterprise support systems
This environment replicates real-world complexity including:
- Multi-step decision making
- Ambiguous user intent
- Escalation handling
- Human-like response generation
๐ง Core Features
๐น OpenEnv Compatible
Fully follows OpenEnv standards:
/reset,/step,/state,/tasks,/grader,/baseline
๐น Multi-Decision Action Space
The agent must output:
๐น Rich Observation Space
The agent receives:
- Ticket message
- Conversation history
- Difficulty level (easy/medium/hard)
- Feedback from previous attempt
- Reward signals
- Hints after failures
๐น Realistic Task Design
- 15 curated tasks
- Balanced across difficulty:
- Easy (5)
- Medium (5)
- Hard (5)
Includes:
- Billing issues
- Technical failures
- Fraud detection
- Enterprise outages
- Legal threats
๐น Advanced Reward System (0.0 โ 1.0)
โ Partial credit for near-correct answers โ Bonus for strong decisions โ Feedback-driven learning
๐น ๐ Interactive Web Dashboard
A modern UI dashboard allows real-time interaction:
- View tickets
- Submit agent actions
- See rewards + feedback instantly
๐ Open in browser:
http://localhost:7860๐๏ธ Project Structure
ai-ticket-routing-pro/
โ
โโโ server/
โ โโโ app.py # FastAPI server + endpoints + UI serving
โ โโโ environment.py # Core RL logic + tasks + reward system
โ
โโโ models.py # Pydantic schemas
โโโ client.py # Python RL client
โ
โโโ frontend/ # Web dashboard
โ โโโ index.html
โ โโโ style.css
โ โโโ script.js
โ
โโโ baseline/
โ โโโ inference.py # LLM + rule-based agent
โ
โโโ openenv.yaml # OpenEnv metadata
โโโ Dockerfile # Deployment
โโโ requirements.txt
โโโ README.mdโ๏ธ Setup & Run
1๏ธโฃ Install dependencies
pip install -r requirements.txt2๏ธโฃ Run server
uvicorn server.app:app --host 0.0.0.0 --port 78603๏ธโฃ Open UI
http://localhost:7860๐งช API Usage
๐น Reset Environment
POST /reset๐น Take Action
POST /stepExample:
{
"category": "billing",
"priority": "medium",
"response": "We sincerely apologize for the inconvenience. Your refund will be processed within 3-5 business days.",
"escalate": false
}๐ค Baseline Agent
Includes:
- Rule-based agent
- Optional LLM (Groq / OpenAI)
Run:
python baseline/inference.py๐ Learning Objectives
This environment helps train and evaluate agents on:
- Decision making under uncertainty
- Priority reasoning
- Customer empathy
- Escalation judgment
- Real-world workflow simulation
๐ณ Deployment (HuggingFace Spaces)
- SDK: Docker
- Port:
7860 - Auto-deploy supported
๐ค Author
Utkarsh Meta PyTorch OpenEnv Hackathon x Scaler School of Technology
๐ก Final Note
This project goes beyond a simple classification task โ it simulates a real-world AI support system with structured decision-making and human-like interaction.
