Pisces3dragon/email-triage-env
Email Triage Environment
An OpenEnv environment that simulates a real-world email triage task. An AI agent must categorize, prioritize, and draft replies to incoming emails — a task that knowledge workers perform daily.
Motivation
Email triage is one of the most common yet cognitively demanding productivity tasks. Workers spend hours daily deciding which emails need immediate attention, which can wait, and which are spam. This environment tests an agent's ability to:
- Classify emails into categories (urgent, normal, follow_up, spam)
- Prioritize appropriately (1=highest to 5=lowest)
- Compose relevant replies when needed
- Avoid unnecessary replies to spam/informational emails
This is directly useful for training and evaluating agents that assist with email management.
Action Space
Observation Space
Tasks
Easy (4 emails)
Obvious classification: clear spam (phishing, scam offers) vs clearly urgent (server down, direct orders from boss) vs routine HR announcements. Straightforward priority assignment.
Medium (5 emails)
Nuanced scenarios: client follow-ups with scheduling needs, security alerts requiring judgment, vendor support tickets, manager action items. Requires understanding context and urgency cues.
Hard (6 emails)
Complex multi-stakeholder situations: legal/NDA reviews with board meeting deadlines, budget reallocation requests needing VP approval, build failures blocking release pipelines, compliance deadlines with escalation threats. Requires synthesizing multiple signals and drafting substantive replies.
Reward Function
Each action is scored on three weighted components (total 0.0–1.0):
- Category accuracy (50%): Exact match with ground truth category
- Priority accuracy (30%): Full credit for exact match, partial credit for being off by 1 or 2
- Reply quality (20%): Based on whether a reply was needed and the substantiveness of the draft
The episode score is the average reward across all steps, normalized to [0, 1].
Baseline Scores
Using Qwen/Qwen2.5-72B-Instruct via HuggingFace Inference API:
Setup & Usage
Prerequisites
- Python 3.10+
- Docker (for containerized deployment)
pip install openenv-core
Run Locally
# Install dependencies
pip install -e .
# Start the server
uvicorn server.app:app --host 0.0.0.0 --port 7860 --reload
# Or using uv
uv run serverDocker Build & Run
cd server
docker build -t email-triage-env .
docker run -p 7860:7860 email-triage-envRun Inference
export API_BASE_URL="https://router.huggingface.co/v1"
export MODEL_NAME="Qwen/Qwen2.5-72B-Instruct"
export HF_TOKEN="your-hf-token"
export ENV_BASE_URL="http://localhost:7860"
python inference.pyDeploy to HF Spaces
openenv push --repo-id your-username/email-triage-envEnvironment Configuration
Required environment variables for inference:
API_BASE_URL— LLM API endpointMODEL_NAME— Model identifierHF_TOKEN— HuggingFace API key
Validation
openenv validate