Skip to main content
In this cookbook, we’ll explore a more effective approach to evaluating multi-turn customer support agents. Traditional evaluation methods that use a single input-output pair are insufficient for agents that need to adapt their tool usage as conversations evolve. Instead, we’ll implement a simulation-based approach where an LLM evaluates our agent against specific success criteria.

The Problem with Traditional Evaluation

Traditional evaluation methods for customer support agents often use a dataset where:
  • Input: Customer ticket/query
  • Output: Expected sequence of tool calls
This approach has significant limitations:
  1. It assumes a fixed, predetermined path to resolution
  2. It doesn’t account for new information discovered during the conversation
  3. It focuses on the exact sequence of tools rather than achieving the desired outcome

A Better Approach: Simulation-Based Evaluation

Instead of predicting exact tool sequences, we’ll define success criteria that focus on what the agent must accomplish, regardless of the specific path taken. For example:
This approach:
  • Focuses on outcomes rather than specific steps
  • Allows for multiple valid solution paths
  • Better reflects real-world customer support scenarios

Requirements

Before we start, make sure you have the necessary packages installed:

Define Tools

Let’s implement this simulation-based evaluation approach using mock tools for an e-commerce customer support scenario.

Define Agents

Now we’ll define our agents. We’ll create both a Planner and an Executor agent. The Planner agent is responsible for creating a plan to achieve the user’s goal, while the Executor agent is responsible for executing the plan. We also define a helper function to generate a response from the tool outputs.

Evaluator Agent

The Evaluator Agent evaluates our multi-turn agent behavior using binary success criteria over full simulated conversations. This method moves beyond traditional input/output (I/O) pair evaluation, addressing the stochastic and flexible nature of agent workflows.

Simulation Function

Below we define a method to simulate conversations between our agent and a user. The outputs will be evaluated by our Evaluator Agent.

Running the Simulation

Now, let’s define a test ticket and our success criteria, then run the simulation:

Simulation Output

Here’s an example of the output you would see when running this simulation:

Conclusion

Traditional evaluation methods that rely on fixed input-output pairs are insufficient for multi-turn conversational agents. By simulating complete conversations and evaluating against outcome-based criteria, we can better assess an agent’s ability to handle real-world customer support scenarios. Key benefits of this approach include:
  1. Flexibility in solution paths: The agent can take different valid approaches to solve the same problem
  2. Focus on outcomes: Evaluation is based on what the agent accomplishes, not how it gets there
  3. Adaptability to new information: The agent can adjust its strategy based on information discovered during the conversation
  4. Realistic assessment: The evaluation better reflects how agents would perform in real-world scenarios
As you develop your own multi-turn agents, consider implementing this simulation-based evaluation approach to get a more accurate picture of their performance and to identify specific areas for improvement. For the full notebook, check it out on: GitHub.