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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: OpenEnv Email Triage
|
| 3 |
+
emoji: ๐ง
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: "0.0.1"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# OpenEnv Email Triage Environment
|
| 13 |
+
|
| 14 |
+
## ๐ Overview
|
| 15 |
+
|
| 16 |
+
This project implements a real-world OpenEnv environment that simulates an email inbox triage workflow. An AI agent interacts with the environment to manage emails by deleting spam, keeping important messages, and organizing the inbox efficiently.
|
| 17 |
+
|
| 18 |
+
The environment follows the OpenEnv specification with structured observation, action, and reward models, along with step(), reset(), and state() APIs.
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## ๐ฏ Motivation
|
| 23 |
+
|
| 24 |
+
Email triage is a common real-world task. Automating inbox management using AI agents helps:
|
| 25 |
+
|
| 26 |
+
* Reduce manual effort
|
| 27 |
+
* Improve productivity
|
| 28 |
+
* Prioritize important communication
|
| 29 |
+
* Filter spam automatically
|
| 30 |
+
|
| 31 |
+
This environment provides a simplified but realistic simulation for training and evaluating AI agents.
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## ๐ง Environment API
|
| 36 |
+
|
| 37 |
+
### reset()
|
| 38 |
+
|
| 39 |
+
Initializes the environment and returns the starting observation.
|
| 40 |
+
|
| 41 |
+
### step(action)
|
| 42 |
+
|
| 43 |
+
Executes an action and returns:
|
| 44 |
+
|
| 45 |
+
* observation
|
| 46 |
+
* reward
|
| 47 |
+
* done
|
| 48 |
+
* info
|
| 49 |
+
|
| 50 |
+
### state()
|
| 51 |
+
|
| 52 |
+
Returns the current environment state.
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## ๐ฅ Observation Space
|
| 57 |
+
|
| 58 |
+
```
|
| 59 |
+
{
|
| 60 |
+
"emails": [
|
| 61 |
+
{
|
| 62 |
+
"id": int,
|
| 63 |
+
"text": string,
|
| 64 |
+
"type": "spam | important | normal"
|
| 65 |
+
}
|
| 66 |
+
],
|
| 67 |
+
"unread_count": int
|
| 68 |
+
}
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
## ๐ฎ Action Space
|
| 74 |
+
|
| 75 |
+
```
|
| 76 |
+
{
|
| 77 |
+
"type": "delete | keep",
|
| 78 |
+
"email_id": int
|
| 79 |
+
}
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
---
|
| 83 |
+
|
| 84 |
+
## ๐ Reward Function
|
| 85 |
+
|
| 86 |
+
| Action | Reward |
|
| 87 |
+
| -------------- | ------ |
|
| 88 |
+
| Delete spam | +0.3 |
|
| 89 |
+
| Keep important | +0.3 |
|
| 90 |
+
| Wrong action | -0.2 |
|
| 91 |
+
| Inbox cleared | +1.0 |
|
| 92 |
+
|
| 93 |
+
The reward function provides partial progress signals and penalizes incorrect actions.
|
| 94 |
+
|
| 95 |
+
---
|
| 96 |
+
|
| 97 |
+
## ๐งช Tasks
|
| 98 |
+
|
| 99 |
+
### Easy
|
| 100 |
+
|
| 101 |
+
* Small inbox
|
| 102 |
+
* Clear spam vs important emails
|
| 103 |
+
* Goal: clean inbox correctly
|
| 104 |
+
|
| 105 |
+
### Medium
|
| 106 |
+
|
| 107 |
+
* Mixed email priorities
|
| 108 |
+
* Requires decision making
|
| 109 |
+
|
| 110 |
+
### Hard
|
| 111 |
+
|
| 112 |
+
* Ambiguous messages
|
| 113 |
+
* Requires optimal sequence of actions
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## โถ๏ธ Baseline Inference
|
| 118 |
+
|
| 119 |
+
Run locally:
|
| 120 |
+
|
| 121 |
+
```
|
| 122 |
+
python run.py
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
Example output:
|
| 126 |
+
|
| 127 |
+
```
|
| 128 |
+
Score: 1.4
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
---
|
| 132 |
+
|
| 133 |
+
## ๐ณ Docker Support
|
| 134 |
+
|
| 135 |
+
Build container:
|
| 136 |
+
|
| 137 |
+
```
|
| 138 |
+
docker build -t openenv-email .
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
Run container:
|
| 142 |
+
|
| 143 |
+
```
|
| 144 |
+
docker run openenv-email
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
## โ๏ธ Requirements
|
| 150 |
+
|
| 151 |
+
```
|
| 152 |
+
pydantic
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
---
|
| 156 |
+
|
| 157 |
+
## ๐ Project Structure
|
| 158 |
+
|
| 159 |
+
```
|
| 160 |
+
.
|
| 161 |
+
โโโ env.py
|
| 162 |
+
โโโ tasks.py
|
| 163 |
+
โโโ run.py
|
| 164 |
+
โโโ Dockerfile
|
| 165 |
+
โโโ requirements.txt
|
| 166 |
+
โโโ openenv.yaml
|
| 167 |
+
โโโ README.md
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
---
|
| 171 |
+
|
| 172 |
+
## ๐ Deployment
|
| 173 |
+
|
| 174 |
+
This environment is containerized and deployed using Docker and hosted online.
|
| 175 |
+
|
| 176 |
+
---
|
| 177 |
+
|
| 178 |
+
## โ
Features
|
| 179 |
+
|
| 180 |
+
* Real-world task simulation
|
| 181 |
+
* OpenEnv API compliance
|
| 182 |
+
* Structured observation/action models
|
| 183 |
+
* Multi-task setup (easy โ hard)
|
| 184 |
+
* Reward shaping
|
| 185 |
+
* Docker container support
|
| 186 |
+
* Baseline scoring script
|
| 187 |
+
|
| 188 |
+
---
|
| 189 |
+
|
| 190 |
+
## ๐ Baseline Score
|
| 191 |
+
|
| 192 |
+
```
|
| 193 |
+
Score: 1.4
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
---
|
| 197 |
+
|
| 198 |
+
## ๐จโ๐ป Author
|
| 199 |
+
|
| 200 |
+
Indrajit Yadav.M
|
| 201 |
+
HariNandhan.P.S
|
| 202 |
+
Siddarth.M
|
| 203 |
+
---
|
| 204 |
+
|
| 205 |
+
## ๐ License
|
| 206 |
+
|
| 207 |
+
MIT License
|