$ au$-Bench
repository·main·Indexed 23 days ago
https://github.com/sierra-research/tau2-benchA simulation framework for benchmarking tool-using agents in real-world customer service scenarios. It supports text-based turn-taking and full-duplex voice interactions across domains including airline, retail, telecom, and banking knowledge. The framework includes a CLI for running evaluations, an Agent-to-Agent (A2A) protocol for agentified benchmarking via Green and White agents, and tools for hyperparameter experiments and result analysis.
What's inside tau2-bench
- Tau2 Gym is a Gymnasium-compatible environment designed for evaluating conversational agents within the $\tau$-bench framework. It provides a standardized interface that allows developers to run agents step-by-step in controlled simulation environments, following the standard Gymnasium API for reinforcement learning.
Overview of $\tau$-Bench domains and modes
main$\tau$-Bench is a simulation framework for evaluating customer service agents. Each domain consists of a policy (rules the agent must follow), tools (available to the agent), and tasks (evaluation scenarios).
Available Domains
mock: Basic testing domain.airline: Airline customer service.retail: Retail customer service.telecom: Telecom customer service.banking_knowledge: Knowledge-retrieval-based domain using RAG pipelines and document search.
Evaluation Modes
Mode Description Text (half-duplex) Turn-based chat with tool use. Voice (full-duplex) End-to-end audio via realtime providers (OpenAI, Gemini, xAI). How Audio Native Providers architecture works
mainAudio native providers use a
DiscreteTimeAdapterinterface to connect different voice AI services to the simulation framework.All providers (except
livekit, which uses a cascaded pipeline) extend theDiscreteTimeAdapterbase class. The base class manages core simulation logic including:TickResultcreation- Audio buffering and capping
- Proportional transcript distribution
- Barge-in buffer clearing
- Tool result queuing
- Tick timing enforcement
- Cumulative state tracking
Each provider implementation typically consists of three components:
provider.py: The WebSocket or API client responsible for connection, sending audio, and receiving events.events.py: Pydantic models defining provider-specific event types.discrete_time_adapter.py: Implements_execute_tick()to convert audio, send/receive data, and process events.
How voice ID resolution works
mainThe $\tau$-Bench framework resolves voice IDs for personas using a specific priority order:
- Environment Variable: It first looks for
TAU2_VOICE_ID_<PERSONA_NAME_UPPER>in the environment. - Built-in Default: If the environment variable is not set, it falls back to the default defined in
src/tau2/data_model/voice_personas.py.
Note on Pre-sampled Configs: If you are using
tasks_voice.jsonfiles in domain data directories, these files store persona names, not voice IDs. The voice ID is resolved dynamically at synthesis time based on the persona name, meaning you can update your.envwith new voice IDs without needing to regenerate your task configuration files.- Environment Variable: It first looks for
How to end a user simulation session
mainTo manage the lifecycle of a simulated conversation, you must use specific termination tokens based on the state of the interaction:
- Task Success: If the instruction goal is satisfied, generate the
###STOP###token. - Agent Transfer: If the agent clearly indicates you are being transferred to another representative, generate the
###TRANSFER###token. - Insufficient Information: If the scenario does not provide enough information to continue the conversation, generate the
###OUT-OF-SCOPE###token.
###STOP### ###TRANSFER### ###OUT-OF-SCOPE###- Task Success: If the instruction goal is satisfied, generate the
Retail Agent Operational Policy
mainAs a retail agent, you must adhere to the following operational constraints and procedures:
Authentication
- Mandatory Authentication: You must authenticate the user identity at the start of every conversation by locating their
user idviaemailor vianame + zip code. This is required even if the user provides theiruser idupfront. - Single User Constraint: You can only assist one user per conversation. Deny any requests related to other users.
Interaction Rules
- Confirmation Required: Before any database-updating action (cancel, modify, return, exchange), you must list the action details and obtain explicit user confirmation (e.g., 'yes').
- Tool Call Protocol: Make at most one tool call at a time. Do not respond to the user and make a tool call simultaneously. If you respond to the user, do not make a tool call in the same turn.
- Information Integrity: Do not invent information, procedures, or subjective recommendations. Use only provided tools and user input.
- Human Handoff: If a request is outside your scope, transfer to a human agent by:
- Calling the
transfer_to_human_agentstool. - Sending the exact message:
YOU ARE BEING TRANSFERRED TO A HUMAN AGENT. PLEASE HOLD ON.
- Calling the
- Mandatory Authentication: You must authenticate the user identity at the start of every conversation by locating their
How communication protocols work in tau2 agents
mainAgents in $\tau$-Bench operate under two distinct communication protocols, which determine how they interact with users and environments:
- Half-Duplex (
HalfDuplexAgent): Used for turn-based text conversations. Only one party (the agent or the user) speaks at a time. This is the standard for text-based evaluations. - Full-Duplex (
FullDuplexAgent): Used for streaming or tick-based interactions, such as voice. Both parties can speak simultaneously, and the agent processes input in discrete time intervals (ticks).
Choosing the correct base class is the first step in developing a new agent.
- Half-Duplex (
Understand the Tau2 Domain structure
mainEach Tau2 domain is organized into a specific folder structure containing data models, tools, and environment definitions.
Core Files
data_model.py: Implements a subclass ofDB(e.g.,FlightDB(DB)) to define the domain's database.user_data_model.py(Optional): Implements a subclass ofDBfor user-specific data.tools.py: Implements a subclass ofToolKitBase(e.g.,AirlineTools(ToolKitBase)) to define domain tools.user_tools.py(Optional): Implements a subclass ofToolKitBasefor user-facing tools.environment.py: The entry point for the domain. It must implement:get_environment(): Returns anEnvironmentinstance.get_tasks(): Returns a list of tasks.get_tasks_split(): Returns a dictionary mapping split names to lists of task IDs.
utils.py: Contains domain-specific utility functions (e.g., data paths).
Standard vs Custom Submissions
mainThe leaderboard distinguishes between two submission types based on whether you have modified the standard $\tau$-bench evaluation scaffold.
Standard Submissions (Default)
Use this if you are evaluating an off-the-shelf, general-purpose LLM using the default $\tau$-bench tools, prompts, and evaluation protocol.
- Configuration: You do not need to specify
submission_typein yoursubmission.json; it defaults to"standard".
Custom Submissions
Use this if your approach differs from the standard evaluation. This includes:
- Modified Scaffolds: Using multi-model routers, ensembles, additional tools, or modified orchestration/prompts.
- Domain-Specific Training: Models fine-tuned on $\tau$-bench domains or trained using $\tau$-bench tasks/reward signals.
Requirements for Custom Submissions:
- Set
submission_typeto"custom"insubmission.json. - Provide detailed explanations in
methodology.notes. - Link to your implementation (GitHub, paper, etc.) in the
referencesarray. - Set
methodology.verification.modified_promptstotrueif you modified any prompts.
- Configuration: You do not need to specify
Understand observations and the info dictionary
mainBoth
reset()andstep()return anobservation(string) and aninfo(dictionary).Observation Format
The observation is a string of the conversation history formatted as
"role: content"separated by newlines:user: ...: Messages from the user.assistant: ...: Messages from the agent (plain text or tool calls).tool: ...: JSON results from tool executions.
Note: In
solo_mode=True, the initial observation isNone.Info Dictionary
The
infodictionary contains metadata:tools: A list of available tools/actions in the current domain.policy: A string defining the agent's behavior and constraints.simulation_run: A JSON representation of the current simulation state.
# Example of accessing info contents observation, info = env.reset() # View available tools for tool in info['tools']: print(f"Tool: {tool.name}") print(f"Description: {tool.description}") print(f"Parameters: {tool.parameters}") # View agent policy print(f"Agent must follow this policy: {info['policy']}")Use AgentGymEnv to control an agent step-by-step
mainTo interact with the environment as an external controller (e.g., for Reinforcement Learning or manual testing), use
AgentGymEnv.Key Workflow
- Check Turn: Before providing an action, check
is_agent_turnto ensure the environment is waiting for input. - Provide Action: Use
set_action(action)to pass the agent's next move. This method will raise aRuntimeErrorif called when it is not the agent's turn. - Observe: Access the current conversation history via the
observationproperty, which returns a list of messages.
Thread Safety Rules
- Only call
set_action()whenis_agent_turnisTrue. - The orchestrator thread is a daemon; it will automatically terminate when the main thread exits.
- Check Turn: Before providing an action, check
How Green and White Agents work together
mainAgentification uses the A2A (Agent-to-Agent) protocol to turn a benchmark into a service. The system relies on two distinct agent roles:
- Green Agent 🟢 (Assessment Manager): Acts as the benchmark orchestrator. It receives evaluation requests, sets up the Tau-Bench environment, manages the conversation between the benchmark and the target agent, and reports the final scores.
- White Agent ⚪ (Target Agent): The agent being evaluated. It must implement the A2A protocol. It receives instructions and responds via tool calls or messages, remaining unaware that it is part of a benchmark.
Workflow:
- A request is sent to the Green Agent containing the White Agent's URL and the benchmark configuration.
- The Green Agent instantiates the Tau-Bench environment.
- The Green Agent forwards user messages to the White Agent and collects responses.
- The Green Agent evaluates the performance and returns the results.