Skip to main content
Evalion is a voice-agent evaluation platform that simulates real user interactions and normalizes results across scenarios, enabling teams to detect regressions, compare runs over time, and validate an agent’s readiness for production. Their platform enables teams to test voice agents by creating autonomous testing agents that conduct realistic conversations: interrupting mid-sentence, changing their mind, and expressing frustration just like real customers. This cookbook demonstrates how to evaluate voice agents by combining Evalion’s simulation capabilities with Braintrust. Voice agents require assessment beyond simple text accuracy: they must handle real-time latency constraints (< 500ms responses), manage interruptions gracefully, maintain context across multi-turn conversations, and deliver natural-sounding interactions. By the end of this guide, you’ll learn how to:
  • Create test scenarios in Braintrust datasets
  • Orchestrate automated voice simulations with Evalion’s API
  • Extract and normalize voice-specific metrics (latency, CSAT, goal completion)
  • Track evaluation results across iterations

Prerequisites

Getting started

Export your API keys to your environment:
Install the required packages:
Best practice is to export your API key as an environment variable. However, to make it easier to follow along with this cookbook, you can also hardcode it into the code below.
Import the required libraries and set up your API credentials:

Creating test scenarios

We’ll create test scenarios for an airline customer service agent. Each scenario includes the customer’s situation (input) and success criteria (expected outcome). These range from straightforward bookings to high-stress cancellation handling. We’ll add all the scenarios to a dataset in Braintrust.

Creating scorers

Evalion provides objective metrics (latency, duration) and subjective assessments (CSAT, clarity). We’ll normalize all scores to 0-1 for consistent tracking in Braintrust.

Evalion API integration

The EvalionAPIService class handles all interactions with Evalion’s API for creating agents, test setups, and running simulations. The task function orchestrates the workflow: creating agents in Evalion, running simulations, and extracting results. This enables reproducible evaluation across iterations. The function performs the following steps:
  1. Creates a hosted agent in Evalion with your prompt
  2. Sets up test scenarios and personas
  3. Runs the voice simulation
  4. Polls for completion and retrieves results
  5. Cleans up temporary resources
Then, we’ll define the agent prompt that will be evaluated:
Finally, we’ll run the evaluation with Braintrust:

Analyzing results

After running evaluations, navigate to Experiments in Braintrust to analyze your results. You’ll see metrics like average latency, CSAT scores, and goal completion rates across all test scenarios. braintrust-results.png

Next steps

Now that you have a working evaluation pipeline, you can:
  1. Expand test coverage: Add more scenarios covering edge cases
  2. Iterate on prompts: Adjust your agent’s prompt and compare results
  3. Monitor production: Set up online evaluation for live traffic
  4. Track trends: Use Braintrust’s experiment comparison to identify improvements
For more agent cookbooks, check out: