CoolFace
Apppublic

Neerav02/email-openenv

sourceHugging Facemitupdated 6mo agoView on Hugging Face
1likes
App README

Email Triage OpenEnv

![OpenEnv](https://openenv.ai) ![Python 3.11](https://python.org) ![License: MIT](LICENSE)

A real-world OpenEnv environment where AI agents learn to manage professional email inboxes. Agents classify priority, draft replies for urgent messages, and archive junk — simulating a task every knowledge worker does daily.


Environment description and motivation

Email triage is one of the most universal professional tasks. It requires:

  • Reading comprehension — understanding urgency from natural language
  • Prioritization judgment — server outage vs lunch invite
  • Professional communication — contextually appropriate replies
  • Workflow efficiency — clearing the inbox under a step budget

Observation space

FieldTypeDescription
inboxList[Email]All emails in the episode
processedList[EmailState]Agent decisions so far
current_emailEmail or nullNext unclassified email
step_numberintSteps taken so far
max_stepsintStep budget for this task
task_idstrtask1 / task2 / task3
task_descriptionstrFull natural language objective
available_actionsList[str]Valid action types

Email fields: id, sender, subject, body, timestamp


Action space

Send JSON to POST /step:

`action_type`Required fieldsDescription
classifyemail_id, priorityLabel email priority
replyemail_id, reply_textDraft reply (min 10 words)
archiveemail_idArchive the email
deleteemail_idDelete the email
reademail_idNeutral read action
skipemail_idNeutral skip action

Priority values: urgent | high | normal | low | spam


Task descriptions with expected difficulty

TaskDifficultyInboxStepsScoring
task1Easy10 emails20100% classification accuracy
task2Medium15 emails4050% classify + 50% reply coverage
task3Hard20 emails6040% classify + 35% reply + 25% archive

Setup and usage instructions

Quick start (local)

bash
git clone https://github.com/Neerav02/email-triage-openenv
cd email-triage-openenv
pip install flask requests openai PyYAML
python api/server.py

Docker

bash
docker build -t email-triage-openenv .
docker run -p 7860:7860 -e HF_TOKEN=your-token -e API_BASE_URL=https://api.example.com/v1 -e MODEL_NAME=grok-3-mini email-triage-openenv

Test all endpoints

bash
curl http://localhost:7860/health
curl -X POST http://localhost:7860/reset -H "Content-Type: application/json" -d '{"task_id":"task1"}'
curl http://localhost:7860/tasks
curl -X POST http://localhost:7860/grader

API endpoints

MethodPathDescription
GET/Info + endpoint list
GET/healthHealth ping
POST/resetStart episode
POST/stepExecute action
GET/stateCurrent episode snapshot
GET/tasksAll tasks + action schema
POST/graderScore current episode
POST/baselineRun baseline (needs HFTOKEN, APIBASEURL, MODELNAME)

Baseline scores (grok-3-mini / xAI Grok)

TaskDifficultyScore
task1Easy0.82
task2Medium0.68
task3Hard0.55

Running tests

bash
python tests/test_env.py

All 68 tests pass.


License

MIT