Spaces:
Sleeping
Sleeping
metadata
title: Customer Support AI API
emoji: ๐ค
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
๐ฎ AI Customer Support Simulator
A strict, deterministic RL-style environment for training and evaluating AI agents on customer support tasks.
๐๏ธ Architecture
โโโ models.py # Core data models (Episode, StepResult, Task)
โโโ environment.py # Strict step enforcement + fail logic
โโโ inference.py # Rule-based agent + CLI runner
โโโ app.py # Gradio UI
โโโ tasks/
โ โโโ easy_task.py # Delayed delivery complaint
โ โโโ medium_task.py # Billing double-charge
โ โโโ hard_task.py # Angry VIP threatening legal action
โโโ graders/
โ โโโ base_grader.py # BaseGrader + HardTaskGrader
โโโ tests/
โโโ test_cases.py # 4 mandatory test scenarios
๐ฏ Step Flow
Empathy โ Collect Info โ Investigate โ Resolution
Each step must be completed correctly before advancing.
๐ Reward Formula
reward = base_score + step_bonus โ penalty
| Component | Value |
|---|---|
| Base (correct) | 1.00 |
| Base (wrong) | 0.20 |
| Step bonus | 0.20 |
| Max per step | 1.20 |
| Episode max | 4.80 |
โ ๏ธ Penalties
| Trigger | Penalty |
|---|---|
| Wrong action in step | โ0.30 |
| Repeated response | โ0.20 |
| Early solution | โ0.25 |
| Angry customer ignored | โ0.25 |
| Generic / too-short response | โ0.15 |
| Wrong assumption | โ0.20 |
| Skipped step | โ0.30 |
๐ฅ Fail Conditions
- More than 3 wrong steps across episode
- Total reward below 1.5
- Agent stuck in loop: 3 consecutive failures at same step
- Single-step penalty โฅ 0.80
๐ Local Setup
pip install -r requirements.txt
python inference.py --task all --agent rule # CLI test
python app.py # Gradio UI
python tests/test_cases.py # Run tests