CoolFace
Apppublic

pragyamandal/novamart-customer-service

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

NovaMart Customer Service Environment

An OpenEnv-compatible RL environment for training agents to resolve customer service issues under real policy constraints.

Overview

This environment simulates a customer service agent at NovaMart, a fictional electronics retailer. The novel mechanic is constraint negotiation — the agent must find the best possible resolution when the obvious answer is blocked by policy. Unlike existing environments, NovaMart features a ranked solution space where multiple valid resolutions exist with different quality scores. The agent must investigate, reason about policies, and navigate ambiguity to maximize customer satisfaction within the boundaries of what is actually allowed.

Environment Description

  • —Simulated company: NovaMart sells consumer electronics (phones, laptops, earbuds, smartwatches)
  • —8 available tools: lookup_order, check_policy, verify_defect, check_loyalty, process_refund, issue_store_credit, process_exchange, escalate_to_manager
  • —3 policy paths:
  • —Standard return — 30-day window, full refund, item must be unopened
  • —Defective item — 90-day window, full refund, defect must be verified
  • —Loyalty goodwill — 60-day window, store credit, silver or gold tier only

Tasks

TaskDifficultyDescriptionMax Steps
easy_refundEasyStandard return within 30 days, all tools work perfectly10
defect_resolutionMediumDefect claim outside standard return window, agent must find the defect policy path10
loyalty_negotiationHardGold tier customer outside all standard windows, ambiguous defect claim, multiple constrained resolution paths10

Observation Space

FieldTypeDescription
customer_idstringUnique identifier for the customer
customer_namestringFull name of the customer
issue_descriptionstringThe customer's complaint or request
order_idstringOrder being discussed
days_since_purchaseintegerNumber of days since the order was placed
customer_tierstringLoyalty tier: standard, silver, or gold
conversation_historylist[string]All messages exchanged so far
available_actionslist[string]Actions the agent can take this step
step_numberintegerCurrent step in the episode
max_stepsintegerMaximum steps allowed for this task
tools_usedlist[string]Tools the agent has already called
last_tool_resultdictOutput from the most recent tool call

Action Space

Action TypeDescription
lookup_orderRetrieve order details by order ID
check_policyCheck eligibility under a specific return policy
verify_defectVerify whether a product defect is confirmed
check_loyaltyCheck customer loyalty tier and goodwill eligibility
process_refundProcess a monetary refund for an order
issue_store_creditIssue store credit to the customer's account
process_exchangeExchange the product for a different item
escalate_to_managerEscalate the case to a manager for review
respond_to_customerSend a message to the customer without taking a tool action

Reward Structure

  • —step_reward: Given at every step, not just at the end of the episode
  • —resolution_score: How close the agent's resolution is to the optimal outcome (0.0–1.0)
  • —tool_use_score: Whether the right tool was called with correct parameters
  • —communication_score: Quality of the customer-facing message
  • —penalty: Deductions for incorrect actions
  • —−0.3 for choosing the wrong resolution type
  • —−0.4 for promising a refund the customer is not eligible for

Setup and Usage

Run with Docker

bash
docker build -t novamart-env .
docker run -p 7860:7860 novamart-env

Run inference

bash
cp .env.example .env
# Edit .env with your API credentials
python inference.py

Environment Variables

VariableDescription
API_BASE_URLLLM API endpoint (OpenAI-compatible)
MODEL_NAMEModel identifier
HF_TOKENYour API key

Baseline Scores

TaskExpected Score Range
easy_refund0.7 – 1.0
defect_resolution0.5 – 0.8
loyalty_negotiation0.3 – 0.6