| title | OpenEnv Customer Support Environment | |||||||
|---|---|---|---|---|---|---|---|---|
| emoji | ๐ซ | |||||||
| colorFrom | blue | |||||||
| colorTo | indigo | |||||||
| sdk | docker | |||||||
| pinned | false | |||||||
| license | mit | |||||||
| tags |
|
A real-world, multi-step customer support simulation environment built on the OpenEnv framework. Designed to train and evaluate AI agents on tasks that mirror genuine human support workflows.
Unlike toy RL environments, this system simulates a realistic customer support pipeline where an agent must:
- Classify support tickets by issue type
- Detect sentiment and apply policy-aware responses
- Ask clarifying questions when information is missing
- Use conversation memory across turns
- Decide whether to resolve or escalate issues
This makes it a high-value benchmark for evaluating multi-step reasoning, policy compliance, and stateful decision-making in AI agents.
my-env/
โโโ inference.py # Baseline agent โ runs all 3 tasks
โโโ models.py # Pydantic models: Action, Observation, Reward
โโโ openenv.yaml # OpenEnv spec metadata (name, tasks, spaces, rewards)
โโโ pyproject.toml # Project metadata and dependencies
โโโ requirements.txt # Python dependencies
โโโ uv.lock # Locked dependency versions
โโโ Dockerfile # Container definition
โโโ client.py # HTTP client for the environment
โโโ __init__.py # Root package
โโโ server/
โโโ __init__.py # Server package
โโโ app.py # FastAPI server (reset / step / state / health)
โโโ grader.py # Task graders with reward shaping
โโโ tasks.py # Task definitions (easy / medium / hard)
โโโ your_environment.py # Core SupportEnv class
This environment is fully compliant with the OpenEnv specification:
name: openenv-customer-support-env
version: "1.0.0"
tags: [openenv]
entrypoint: server.app:app
tasks:
- id: easy | difficulty: easy | max_steps: 6
- id: medium | difficulty: medium | max_steps: 6
- id: hard | difficulty: hard | max_steps: 8Validated via:
openenv validatereset(task: str) -> Observation # Initialize episode for given task
step(action: Action) -> (Observation, Reward, done, info) # Take one action
state() -> dict # Inspect full current episode state| Method | Endpoint | Description |
|---|---|---|
POST |
/reset?task=easy |
Start a new episode |
POST |
/step |
Submit an action |
GET |
/state |
Get current episode state |
GET |
/health |
Health check (returns 200) |
{
"tickets": [
{"id": 1, "text": "Customer message here"}
],
"current_ticket_id": 1,
"history": [
{"user": "...", "agent": "...", "action_type": "classify"}
]
}Action(
action_type: str, # "classify" | "respond" | "escalate" | "ask"
ticket_id: int, # ID of the ticket being handled
content: Optional[str] # Classification label or response text
)| Action | Purpose |
|---|---|
classify |
Categorize the issue: billing or technical |
respond |
Provide a resolution or acknowledgment |
ask |
Request missing information from the user |
escalate |
Hand off to a human agent |
Max steps: 6
Agent must classify the ticket and provide an appropriate response.
| Step | Action | Reward |
|---|---|---|
| 1 | Correct classification (billing/technical) |
+0.5 |
| 2 | Response with refund/sorry keywords | +0.4 |
| 2 | Urgency keyword bonus (urgent/immediately) | +0.1 |
Max achievable: 1.0
Max steps: 6
Agent must detect issue type, show empathy, and generate a policy-compliant response.
| Step | Action | Reward |
|---|---|---|
| 1 | Correct classification | +0.3 |
| 2 | Empathetic language (sorry/understand/apologize) | +0.3 |
| 2 | Policy-compliant response (fix/refund keywords) | +0.4 |
Max achievable: 1.0
Max steps: 8
Agent must follow the full sequence: classify โ ask โ respond, using conversation memory.
| Step | Action | Reward |
|---|---|---|
| 1 | Correct classification | +0.2 |
| 2 | Ask for missing info (transaction ID etc.) | +0.2 |
| 3+ | Response with correct keywords | +0.3 |
| 3+ | Memory bonus (asked_info was used) | +0.1 |
| Any | Efficiency bonus (resolved in โค3 steps) | +0.1 |
| Any | Correct escalation decision | +0.1 |
Penalties:
| Condition | Penalty |
|---|---|
| Respond at step 2 without asking first | โ0.3 |
| Unnecessary escalation | โ0.2 |
| Repeated action type | โ0.2 |
Max achievable: 1.0
This environment uses dense reward shaping โ agents receive meaningful signal at every step, not just at episode end.
- Partial credit for each correct intermediate action
- Efficiency bonuses for faster resolution
- Memory bonuses for using context from prior turns
- Penalties for skipping required steps, repeating actions, or escalating unnecessarily
- Episode ends early on near-perfect score (โฅ0.95) or after max steps
Achieved by the fallback rule-based agent (no LLM, no API key required):
| Task | Score | Success | Steps |
|---|---|---|---|
| Easy | 0.500 | โ | 2 |
| Medium | 0.500 | โ | 2 |
| Hard | 0.300 | โ | 3 |
| Aggregate | 0.433 |
A frontier LLM agent is expected to score significantly higher.
git clone <repo-url>
cd my-envpython -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/Macpip install -r requirements.txt| Variable | Required | Default | Description |
|---|---|---|---|
HF_TOKEN |
โ Yes | โ | Your Hugging Face API token |
API_BASE_URL |
No | https://router.huggingface.co/v1 |
LLM API endpoint |
MODEL_NAME |
No | Qwen/Qwen2.5-72B-Instruct |
Model identifier |
If no API key is set, the agent runs in fallback mode using rule-based actions. All 3 tasks still complete successfully.
python inference.pyRuns all 3 tasks in sequence and outputs:
[START] task=easy env=support_env model=Qwen/Qwen2.5-72B-Instruct
[STEP] step=1 action={...} reward=0.50 done=false error=null
[STEP] step=2 action={...} reward=0.50 done=true error=null
[END] success=true steps=2 rewards=0.50,0.50
[SUMMARY] task=easy score=0.500 success=true steps=2
...
[AGGREGATE] tasks=3 avg_score=0.433
docker build -t support-env .
docker run -p 7860:7860 support-envTest endpoints:
curl -X POST http://localhost:7860/reset?task=easy
curl http://localhost:7860/healthpip install openenv-core
openenv validateDeployed as a Hugging Face Docker Space โ fully containerized, CPU-friendly, and responds within the 20-minute inference runtime limit.
- Multi-ticket queue handling
- Memory persistence across episodes
- Advanced policy rule engine
- Human-in-the-loop simulation
- More task difficulty levels
MIT