RevOps / README.md
Jyo-K's picture
Add Hugging Face Space configuration parameters to README.md
2f58bba
metadata
title: RevOps Agent
emoji: 🏢
colorFrom: blue
colorTo: green
sdk: docker
pinned: false

RevOps-Agent

RevOps-Agent is an OpenEnv-compliant reinforcement learning environment that simulates a real B2B Revenue Operations (RevOps) inbox.

In this environment, an AI agent receives inbound sales leads (from web forms, ads, etc.) and must perform full qualification and routing workflows that a trained human RevOps specialist would execute in a CRM.

Motivation & Domain

Every B2B company receives raw inbound leads that must be scored against their Ideal Customer Profile (ICP), checked against existing CRM data, and correctly prioritized. This operational layer is critical; bad routing results in lost sales equivalent to billions in wasted pipeline annually. This environment bridges the gap by providing a meaningful, real-world task evaluation platform for tool-using LLMs.

Features

  • Trajectory-Shaped Reward: Meaningful rewards are provided for interim operational steps like enrich_lead and check_crm rather than sparse binary rewards.
  • Strict Validations: Penalizes actions that ignore basic protocols (e.g. scoring a lead before enriching it when necessary, or routing to a representative without checking the CRM).
  • Docker & Fast API Ready: Exposes /step, /reset, /state, /tasks, /grader, and /baseline. Supported standard OpenEnv validation tool.

State & Spaces

Observation Space

The observation space (RevOpsObservation) is fully typed and represents what a RevOps analyst sees on screen:

  • lead: Raw incoming lead information (name, email, message, etc.)
  • enrichment: Firmographic data like company size, industry, revenue, region.
  • crm: Current CRM status (existing accounts, active/closed opportunities for the lead).
  • reps: A dictionary containing the roster of reps and their routing constraints.
  • icp_criteria: Document explaining how to score and route leads based on segments and capacity.
  • last_action_feedback: Human-readable string confirming the success or failure of the latest operation.

Action Space

The action space (RevOpsAction) simulates RevOps workflows through discrete, typed operations:

  • enrich_lead
  • check_crm
  • update_lead_score (requires score)
  • route_to_rep (requires rep_id)
  • merge_with_account (requires account_id)
  • flag_reengagement (requires opportunity_id)
  • disqualify
  • add_to_nurture, request_more_info, escalate_to_manager

Tasks

Tasks natively support progressive evaluation.

  1. task_easy: Direct Match Routing. Requires enrichment, simple scoring, and routing to the right Mid-Market rep.
  2. task_medium: Enrichment-Gated ICP Scoring. Lead has only an email; requires enrichment before scoring to avoid a penalty, and proper Enterprise assignment.
  3. task_hard: CRM Conflict. This lead corresponds to a closed-lost opportunity. The agent must merge accounts and re-assign to the original representative while dodging multiple concurrent junk leads.

Setup & Execution

Requirements

  • Python 3.11+
  • uv for fast dependency sync.

Local Installation

# Optional: Setup openenv
uv pip install -e .

# Validate environment compliance
uv run openenv validate

Running the API locally

You can rapidly boot the API for external agent inference scripts:

uv run uvicorn server.app:app --host 0.0.0.0 --port 8000

Docker

docker build -t revops-env -f server/Dockerfile .
docker run -p 8000:8000 revops-env

Endpoints

The backend supports all standard OpenEnv mechanisms and adds:

  • POST /reset - Resets and spawns the specific Task Scenario
  • POST /step - Pushes a RevOpsAction to the state iteration
  • GET /tasks - Lists tasks and JSON Action schemas
  • GET /grader - Return final Grader Score [0.0 - 1.0]

Baseline Tests

Included is an automated baseline evaluator utilizing the OpenAI/NVIDIA NEMOTRON client. Provide OPENAI_API_KEY via .env.

uv run python baseline.py

This triggers the three difficulties via a single agent loop and aggregates grader scores.