Spaces:
No application file
Download PRD.md from Adi-19/SupportEnv: direct link, hf CLI and curl.
- Browser
- Download file 4.25 kB
-
https://huggingface.co/spaces/Adi-19/SupportEnv/resolve/main/PRD.md
- Command line
-
hf download hf://spaces/Adi-19/SupportEnv/PRD.md
-
curl -L -o PRD.md https://huggingface.co/spaces/Adi-19/SupportEnv/resolve/main/PRD.md
PRD: SupportEnv β AI Customer Support RL Environment
Overview
Build a complete OpenEnv-compliant environment that simulates a real-world customer support system where an AI agent can:
- Classify support tickets
- Search Knowledge Base (lookup_kb)
- Generate empathetic responses
- Decide escalation (de-escalate if possible)
- Resolve issues efficiently
Requirements
- Follow OpenEnv spec:
reset(),step(),state() - Include 3 tasks (easy β medium β hard)
- Include deterministic graders (0.0β1.0)
- Include baseline inference
- Deploy via Docker + Hugging Face Spaces
Task 1: Project Setup & Structure
Create full project structure:
SupportEnv/ βββ models.py # Typed Action, Observation, State βββ client.py # WebSocket client for external use βββ openenv.yaml # Environment metadata βββ pyproject.toml # Package dependencies βββ requirements.txt # Pip requirements βββ README.md # Documentation β βββ server/ β βββ init.py β βββ app.py # FastAPI application β βββ environment.py # Core RL logic β βββ tasks.py # Task definitions (easy/medium/hard) β βββ graders.py # Deterministic scoring β βββ reward.py # Reward computation β βββ ticket_generator.py # Realistic ticket generation β βββ utils.py # Helper functions β βββ Dockerfile # Container definition β βββ baseline/ β βββ init.py β βββ run_baseline.py # Baseline execution script β βββ policy.py # Rule-based baseline agent β βββ results.json # Saved baseline scores β βββ frontend/ β βββ init.py β βββ gradio_ui.py # Gradio interface β βββ tests/ β βββ init.py β βββ test_environment.py β βββ test_graders.py β βββ test_api.py β βββ test_baseline.py β βββ scripts/ βββ start_local.sh βββ validate.sh βββ deploy.sh
Requirements
- Follow OpenEnv structure
- All files created (no placeholders)
- Project runs locally without errors
Task 2: Define Typed Models
Action
action_type: classify | respond | escalate | resolve | lookup_kb | request_infocontent: string
Observation
ticket_texthistorycustomer_sentimentissue_category
State
episode_idstep_countresolved
Requirements
- Fully typed (Pydantic)
- OpenEnv compatible
- No missing fields
Task 3: Implement Ticket Generator
Features
Generate tickets for:
- Billing
- Technical
- Account
Include:
- Difficulty (easy / medium / hard)
- Sentiment score
- Keywords
Requirements
- Minimum 20 tickets
- Include ambiguous hard cases
- Deterministic with seed
Task 4: Implement Environment Core
reset()
- Generate new ticket
- Initialize state
- Clear history
step(action)
Handle:
- classify
- respond
- escalate
- resolve
Return:
- observation
- reward
- done
state()
- Return metadata
Requirements
- Multi-step interaction supported
- Episode ends correctly
- No crashes on invalid input
Task 5: Implement Reward System
Rewards
- Correct classification β +0.25
- Hybrid Semantic Response Quality β +0.30
- Appropriate KB usage β +0.15
- Correct escalation decision β +0.35
- Successful resolution β +0.40
- Wrong escalation β -0.20
- Missed mandatory escalation β -0.35
- Harmful response β -0.40
Requirements
- Step-level rewards
- Not purely binary
- Penalizes bad behavior
Task 6: Implement Grader System
Evaluate
- Classification accuracy
- Response quality (Semantic + Keyword)
- Escalation correctness (with mandatory de-escalation for hard tasks)
- Resolution Alignment
- Efficiency (Penalizing superficial handling of hard tasks)
Output
- Scalar score [0.0, 1.0]
- Detailed breakdown by difficulty
- Passing status (score > 0.8)