Sharvandeep/ticket-routing-openenv
๐ Ticket Routing OpenEnv Environment
๐ Overview
This project simulates a real-world customer support ticket routing system, where an AI agent classifies user complaints into the correct department, assigns priority, and decides escalation.
It is built as an OpenEnv-compatible environment to evaluate intelligent agents on realistic enterprise workflows.
๐ฏ Motivation
Customer support systems handle thousands of tickets daily. Incorrect routing causes delays and poor user experience.
This environment models that challenge and helps:
- Train AI agents
- Evaluate decision-making
- Benchmark automation systems
โ๏ธ Core Features
- Real-world task simulation
- Multi-step environment
- 3 difficulty levels (easy, medium, hard)
- Deterministic grading (0.0โ1.0)
- Reward-based learning system
- REST API endpoints
- Hugging Face deployment
๐ง Task Design
Each ticket must be classified into:
- Department โ billing / technical / account / general
- Priority โ low / medium / high
- Escalation โ yes / no
Difficulty levels:
- Easy โ clear tickets
- Medium โ moderate ambiguity
- Hard โ complex interpretation
๐งฎ Reward Function
Reward is calculated per step:
- Correct department โ +0.4
- Correct priority โ +0.3
- Correct escalation โ +0.3
Total reward range: 0.0 to 1.0
This ensures:
- Partial learning signals
- Continuous feedback
- Realistic evaluation
๐ API Endpoints
๐ฅ Example
Reset: POST /reset
Step: { "department": "technical", "priority": "high", "escalation": "yes" }
๐ค Baseline Agent
A baseline agent is provided in inference.py.
It uses a hybrid approach:
- Rule-based logic (stable)
- Optional LLM (adaptive)
This ensures:
- Reliability
- Reproducibility
- Compatibility with evaluation
๐งช Setup (Local)
pip install -r requirements.txt uvicorn app.main:app --reload
๐ณ Docker
docker build -t ticket-env . docker run -p 7860:7860 ticket-env
Agent
The inference script uses an LLM (via OpenAI-compatible API) with a fallback rule-based system to ensure stability and consistent performance.
๐ Evaluation
- Works with OpenEnv validation
- Deterministic grading
- Runs within constraints
๐ก Highlights
- Real-world use case
- Clean design
- Strong reward system
- Fully deployable
- Agent evaluation ready
๐ Conclusion
This environment provides a practical benchmark for AI agents in customer support automation, combining real-world relevance with structured evaluation.
