CoolFace
Apppublic

Sharvandeep/ticket-routing-openenv

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

๐Ÿš€ 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

EndpointMethodDescription
/resetPOSTStart new episode
/stepPOSTSubmit agent action
/stateGETCurrent state
/tasksGETTask metadata
/graderGETEvaluation
/baselineGETBaseline score

๐Ÿ“ฅ 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.