abi2209mj/Ticker_RL_Environment
0
๐ซ Customer Support Ticket Resolution โ RL Environment
A real-world reinforcement learning environment where an agent resolves customer support tickets through multi-turn dialogue.
Built for the OpenEnv Hackathon โ fully OpenEnv-compliant.
๐ Key Features (Beyond Baseline)
1. ๐ง Dynamic LLM Ticket Generator
Every reset() calls Claude to generate a fresh, realistic ticket โ different industries, emotions, and complexity. No two episodes are the same.
2. ๐ค Sentiment Escalation Engine
Customer sentiment degrades dynamically in response to bad agent behavior:
- Repeated questions โ sentiment worsens
- Wrong solution โ sentiment worsens
- Correct resolution โ sentiment improves
- Sentiment state:
happy โ neutral โ frustrated โ angry โ demands_supervisor
3. โฑ๏ธ SLA Step Budget Penalty
Each task has a step budget (Easy: 3, Medium: 5, Hard: 8). Steps over budget incur a -0.05 per-step penalty, rewarding efficiency.
4. ๐ Live Gradio Dashboard
Deployed on HuggingFace Spaces โ interactive browser UI with:
- Live conversation replay
- Real-time reward breakdown table
- Cumulative reward chart
- Sentiment timeline chart
- Session leaderboard
๐ Observation Space
โก Action Space
๐ฏ Reward Function
๐ฆ Tasks
๐ Setup & Usage
# Install
pip install -r requirements.txt
# Set API keys
export ANTHROPIC_API_KEY=your_key # for LLM ticket generation
export HF_TOKEN=your_hf_token # for baseline inference
# Run the dashboard
python ui/dashboard.py
# Run baseline inference
python scripts/baseline_inference.py๐ณ Docker
docker build -t support-rl-env .
docker run -p 7860:7860 -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY support-rl-env๐ค HuggingFace Spaces
Deploy by pushing to a HuggingFace Space with gradio SDK. Tag the space with openenv for discoverability.
