hyperlinken/triage
๐ซ IT Helpdesk Triage & Incident Management โ OpenEnv
   
A production-grade OpenEnv RL training environment that simulates a real enterprise IT Service Desk. An AI agent receives incoming IT support tickets and must make triage decisions across five dimensions โ culminating in the management of a cascading database outage spanning seven simultaneous tickets.
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OpenEnv Interface โ
โ POST /reset โโโบ Observation (first ticket in queue) โ
โ POST /step โโโบ StepResult (obs + reward + done) โ
โ GET /state โโโบ EnvironmentState (full snapshot) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โ ITTriageEnvironment (core) โ
โ โ
โ Task Registry โ
โ โโ basic_triage (easy) โ
โ โโ priority_routing (medium) โ
โ โโ incident_escalation (hard) โ
โ โ
โ Dense Reward Engine โ
โ โโ Category score (exact) โ
โ โโ Priority score (partial) โ
โ โโ Routing score (exact) โ
โ โโ Incident score (bonus) โ
โ โโ Escalation score โ
โ โโ Resolution score (NLP) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐๏ธ Environment Description
Real-world motivation
Every enterprise runs an IT service desk. Triage quality โ getting the right ticket to the right team at the right priority โ directly affects business continuity, SLA compliance, and employee productivity. Training AI agents on realistic triage tasks produces models immediately applicable to production helpdesk automation.
Episode structure
Each episode processes a queue of IT support tickets. The agent sees one ticket per step and must return a TriageAction. The episode ends when the queue is exhausted or max_steps is reached.
๐ Action Space
class TriageAction(BaseModel):
ticket_id: str # Ticket being triaged
category: TicketCategory # hardware|software|network|security|access|database|performance|other
priority: TicketPriority # P1|P2|P3|P4
assigned_team: AssignedTeam # infrastructure|application_support|network_ops|security_ops|database_admin|helpdesk
is_part_of_incident: bool # Incident linkage flag
incident_id: str | None # e.g. "INC-MAJOR-01"
resolution_steps: list[str]|None # Ordered remediation steps (P1 hard-task)
escalate_to_management: bool # Page senior management๐๏ธ Observation Space
class Observation(BaseModel):
task_id: str # Active task
current_ticket: Ticket | None # Ticket to triage (None = queue empty)
queue_remaining: int # Tickets still waiting
processed_count: int # Tickets processed this episode
step_number: int
action_feedback: str | None # Correctness feedback on previous action
cumulative_score: float # Running mean reward (0.0-1.0)
episode_done: bool
active_incidents: list[str] # Incident IDs declared so far
hints: list[str] # Task-level guidance๐ฏ Tasks
Hard task: INC-MAJOR-01
The hard task simulates a PostgreSQL WAL-corruption event at 14:32. Five of seven tickets are incident symptoms (primary DB down, auth service failing, e-commerce checkout dead, analytics frozen, reporting job failed). Two tickets are unrelated noise (team lunch reminder, routine cert renewal). The agent must distinguish signal from noise, group the five linked tickets under INC-MAJOR-01, and provide specific remediation steps for each P1 ticket.
๐ฐ Reward Function
Rewards are dense โ computed per step (not just at episode end). All values are strictly bounded to [0.0, 1.0].
Weight profiles by difficulty
Priority partial credit: adjacent level (e.g., P2 when P1 expected) scores 0.5 instead of 0.0, providing a learning gradient rather than a cliff.
Resolution scoring: Uses keyword-recall + step-level recall over domain-critical tokens, rewarding agents that cover the right remediation concepts even with paraphrased wording.
Penalties: Escalating a P4 cosmetic ticket to senior management incurs a -0.15 penalty.
๐ Quick Start
Local development
# Clone and set up
git clone https://huggingface.co/spaces/<your-username>/it-triage-env
cd it-triage-env
pip install -r requirements.txt
# Start the server
uvicorn app:app --host 0.0.0.0 --port 7860 --reload
# In a separate terminal โ run the baseline agent
export OPENAI_API_KEY="sk-..."
export API_BASE_URL="http://localhost:7860"
export MODEL_NAME="gpt-4o"
python inference.pyDocker
docker build -t it-triage-env .
docker run -p 7860:7860 \
-e OPENAI_API_KEY="sk-..." \
-e MODEL_NAME="gpt-4o" \
it-triage-envInteract manually with curl
# Reset to the hard task
curl -X POST http://localhost:7860/reset \
-H "Content-Type: application/json" \
-d '{"task_id": "incident_escalation"}'
# Submit a triage action
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{
"ticket_id": "TKT-H001",
"category": "database",
"priority": "P1",
"assigned_team": "database_admin",
"is_part_of_incident": true,
"incident_id": "INC-MAJOR-01",
"escalate_to_management": true,
"resolution_steps": [
"Promote db-prod-replica-01 using pg_promote()",
"Update all app DB_HOST configs to replica",
"Preserve original primary for WAL forensics"
]
}'๐ Baseline Scores
๐ API Reference
๐ฆ File Structure
it-triage-env/
โโโ models.py # Pydantic Action / Observation / State models
โโโ environment.py # Core environment logic + reward engine + graders
โโโ app.py # FastAPI server (OpenEnv REST interface)
โโโ client.py # Typed HTTP client
โโโ inference.py # Baseline LLM inference script
โโโ openenv.yaml # OpenEnv specification file
โโโ requirements.txt
โโโ Dockerfile
โโโ README.mdโ๏ธ Environment Variables
๐ Citation
@misc{it-helpdesk-triage-openenv,
title = {IT Helpdesk Triage & Incident Management โ OpenEnv},
year = {2024},
url = {https://huggingface.co/spaces/<username>/it-triage-env}
}