raunakratan/priority-mind-lite
๐ง PriorityMind-Lite
LLM-Rewarded Customer Support Ticket Triage Environment
Meta PyTorch OpenEnv Hackathon 2026 | Team Axiom (IIT Madras)
  
๐ฏ One-Line Pitch
An OpenEnv reinforcement learning environment where AI agents learn to triage customer support tickets using rewards evaluated by Llama โ not hardcoded rules โ enabling nuanced behaviors like empathy, strategic escalation, and contextual judgment.
โจ Key Innovation
Traditional RL requires you to define "good" mathematically. How do you encode empathy as a number? You don't โ you let Llama judge it.
๐ Quick Start
# Install dependencies
pip install -r requirements.txt
# Run mock benchmark (no API key needed)
python inference.py --mock --verbose
# Run with live LLM evaluation (requires HF_TOKEN)
export HF_TOKEN=hf_your_token_here
python inference.py --verbose
# Run interactive demo for judges
python demo.py --live
# Launch Gradio web interface
python app.py๐ What's Included
Core Components
Supporting Files
Validation & Testing
๐ฎ Task Definitions
Each difficulty level includes 6 different ticket variations to simulate real-world diversity. The environment randomly selects a variation on each reset, ensuring robust training and evaluation.
Task 1: Easy โ Simple Billing Inquiries (6 variations)
- Sample Tickets:
- "My bill is higher than expected"
- "I was charged twice for my subscription"
- "Can you explain the charges on my latest invoice?"
- "My payment failed but I was still charged"
- "I need a refund for the overcharge on my account"
- "Why did my monthly fee increase without notice?"
- Sentiment Range: -0.1 to -0.5 (mildly negative)
- True Category: billing
- Max Steps: 3
- Success: Correctly categorize + assign appropriate priority
Task 2: Medium โ Frustrated Technical Issues (6 variations)
- Sample Tickets:
- "App keeps crashing! I'm so frustrated!"
- "The app freezes every time I try to upload a photo"
- "Login page shows error 500 constantly"
- "My notifications stopped working after the update"
- "The search function returns no results even for items I know exist"
- "App drains my battery in just 2 hours"
- Sentiment Range: -0.65 to -0.8 (frustrated)
- True Category: technical
- Max Steps: 5
- Success: Recognize frustration, prioritize high/urgent, empathetic response
Task 3: Hard โ Complex Multi-Issue Complaints (6 variations)
- Sample Tickets:
- "I've waited 3 days for a refund AND your app deleted my data. This is unacceptable!"
- "Your service has been down for 2 days and I'm losing business. I want compensation!"
- "I've been transferred 5 times and no one has solved my problem. This is terrible service!"
- "My account was hacked and your support team is not responding fast enough!"
- "You charged me for a year subscription but I only wanted monthly. Refund the difference NOW!"
- "My personal data was exposed in your data breach and I haven't heard from you in a week!"
- Sentiment Range: -0.88 to -0.97 (very angry)
- True Category: complaint
- Max Steps: 8
- Success: De-escalate, coordinate multi-step resolution, maintain empathy
๐ Benchmark Results
Verified with python inference.py --mock --verbose using the seeded offline benchmark. Live scores depend on the configured HF model and fallback rate, so only the deterministic mock baseline is pinned in the repo.
See RESULTS.md for detailed benchmark methodology and the verified mock baseline.
๐ง Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HIGH-LEVEL FLOW โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ 1. Environment Reset โ
โ โข Generate ticket: text + sentiment + true_category โ
โ โข Return typed Observation (Pydantic model) โ
โ โ
โ 2. Agent Takes Action โ
โ โข Uses OpenAI-compatible client (HF Router) โ
โ โข Action types: categorize/prioritize/respond/escalate/resolve โ
โ โ
โ 3. Hybrid Grader Evaluates โ
โ โโ Try LLM Evaluation (60% of reward) โ
โ โ โข Prompt Llama with state + action + criteria โ
โ โ โข Llama returns: score (0-10) + reasoning + sub-scoresโ
โ โ โข Normalize to [0.0, 1.0] โ
โ โ โ
โ โโ Cache Result (exact-match caching) โ
โ โ โข Reduces API calls for repeated queries โ
โ โ โ
โ โโ Fallback to Programmatic (40% of reward) โ
โ โข Deterministic rules if LLM fails โ
โ โ
โ 4. Return Reward + New State + Done Flag โ
โ โข Reward = 0.4*programmatic + 0.6*llm_normalized_score โ
โ โข Partial signals: empathy, efficiency, strategy โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐ Live Demo
Try the interactive demo on Hugging Face Spaces:
๐ [https://huggingface.co/spaces/raunakratan/priority-mind-lite](https://huggingface.co/spaces/raunakratan/priority-mind-lite)
๐จ Gradio Web Interface
A user-friendly web interface for interacting with the PriorityMind environment and testing ticket triage workflows.
Features
- Interactive Ticket Input: Input customer support tickets and get immediate triage suggestions
- Environment Simulation: Select difficulty levels (easy, medium, hard) and run full episode simulations
- Real-time Feedback: View LLM evaluations, reward breakdowns, and reasoning
- Episode History: Track and review past triage decisions with metrics
- Configuration UI: Adjust model parameters, timeouts, and evaluation settings without code changes
Quick Start
# Launch Gradio interface (default: http://localhost:7860)
python app.py
# Run on specific port
python app.py --port 8000
# Enable live LLM evaluation (requires HF_TOKEN)
export HF_TOKEN=hf_your_token_here
python app.pyUsage
- Select Task Difficulty: Choose from easy (billing), medium (technical), or hard (complaints)
- Input Ticket: Enter a customer support ticket or use a sample
- Run Triage: Click "Triage Ticket" to send to environment
- View Results: See category prediction, priority level, and LLM reasoning
- Review Metrics: Check empathy, efficiency, and strategy scores
Interface Components
โ๏ธ Configuration
Environment Variables
.env File
# Hugging Face API Configuration
HF_TOKEN=hf_your_token_here
# API Configuration - Use HF Router for Inference
API_BASE_URL=https://router.huggingface.co/v1
MODEL_NAME=meta-llama/Llama-3.1-8B-Instruct
HF_TIMEOUT_SECONDS=12๐งช Testing & Validation
# Run all tests
python -m pytest tests/ -v
# Run pre-submission validation
python scripts/validate_submission.py
# Validate OpenEnv spec
openenv validate . --verbose
# Run mock inference (validates output format)
python inference.py --mock๐ Project Structure
priority-mind-lite/
โโโ openenv.yaml # OpenEnv metadata
โโโ environment.py # PriorityMindEnv class
โโโ grader.py # HybridGrader + ProgrammaticGrader
โโโ inference.py # Benchmark runner
โโโ models.py # Pydantic models
โโโ demo.py # Judge-facing demo
โโโ app.py # Gradio web interface
โโโ Dockerfile # Container configuration
โโโ requirements.txt # Dependencies
โโโ LICENSE # MIT License
โโโ README.md # This file
โโโ RESULTS.md # Benchmark results
โโโ .huggingface/ # HF Spaces config
โ โโโ README.md
โโโ scripts/
โ โโโ validate_submission.py
โโโ server/
โ โโโ app.py # OpenEnv HTTP server
โโโ tests/
โโโ test_environment.py๐ฌ 90-Second Demo Flow
- Problem Statement (15s): "How do you mathematically define empathy?"
- Solution (15s): "Let Llama judge what good looks like"
- Live Demo (30s): Run hard task with visible LLM reasoning
- Results (15s): Show metrics table with empathy improvement
- Insight (15s): "We taught the agent to satisfy a judge that values empathy"
Run with: python demo.py --live
๐ Why This Wins
- Perfect Requirement Alignment: Customer support explicitly allowed, 3 tasks, <20min runtime, exact output format
- Research-Grade Innovation: First OpenEnv environment with LLM-as-reward-function
- Meta Stack Alignment: OpenEnv + Llama + PyTorch + HF Spaces
- Demo-Ready Design: Visible LLM reasoning, clear metrics, memorable takeaway
- Production-Thinking: Fallback grader, smart caching, pinned dependencies
๐ License
MIT License - see LICENSE for details.
๐ฅ Team
Team Axiom - IIT Madras
- Rauank Ratan
- Akash Deep
- Sangam Jha
๐ Links
Built on OpenEnv. Judged by Llama.
