TanujInsane/document-classification-env
๐ Void Walkers: Intelligent Routing Environment
A premium, Gymnasium-compatible Document Classification Environment designed for AI Agentic Learning.
๐ Overview
Void Walkers represents a state-of-the-art Partially Observable Markov Decision Process (POMDP) where agents learn to classify, route, and interact with complex customer support payloads. Unlike static datasets, this environment enforces real-world constraints: SLA Time Pressure, Processing Costs, and Tool-Mediated Metadata Retrieval.
๐ Key Enhancements (v1.1)
- Synchronized Category Space: Standardized 22 fine-grained categories across the environment, agent, and spec.
- Dynamic Reward Architecture: Implemented real-time Speed Bonuses and Resource Costs in the
step()loop. - Rich State API: Deep telemetry including
action_historyandreward_historyfor diagnostic observability. - Live RL Training: Integrated PyTorch-based Reinforcement Learning loop demonstrating agent improvement over time.
๐ ๏ธ System Architecture
1. Environment: DocumentClassificationEnv
The core logic resides in environment.py, implementing the standard step(), reset(), and state() API.
- Obs Space: Dictionary containing raw
content,features(100d),urgency, andsla_remaining. - Action Space: Discrete(24) โ 22 labels + 2 tools (
Request Metadata,Escalate). - Reward Function: $$R = \text{Accuracy} + \text{Speed Bonus} - \text{SLA Penalty} - \text{Processing Cost}$$
2. Agent: TicketAgent
A hybrid intelligence system:
- Baseline: TF-IDF + Logistic Regression (pre-trained).
- RL Agent: A neural policy that learns to map features to categories based on environment feedback.
๐ Benchmarks & Learning
๐ Quick Start
1. Initialize Sandbox
from environment import DocumentClassificationEnv
env = DocumentClassificationEnv(task_difficulty="medium")
obs, info = env.reset()2. Execute Action
action = 1 # "Billing"
obs, reward, done, truncated, info = env.step(action)3. Observe State
telemetry = env.state()
print(f"Total Reward: {telemetry['total_reward']}")๐ฅ๏ธ UI & Visualization
Run the Gradio dashboard for interactive testing:
python app.pyNavigate to the Reinforcement Learning tab to witness the neural training sequence.
๐ Documentation & Spec
Full specifications are defined in openenv.yaml. This project adheres to the OpenEnv v1.0 Standard.
Developed for Advanced AI Agentic Coding Research.
