Voice Agent Testing Tutorial
Learn how to use Hamming AI to automatically test your AI voice agent
Example: Sam’s Car Dealership 🚗
Sam’s Car Dealership offers a range of vehicle services, including maintenance and repairs for customers, while also providing leasing options and selling both new and used cars. Their agent can schedule appointments and collect customer information.
In this example, we will build a Hamming test agent taking on the role of the customer to evaluate how well Sam’s AI voice agent schedules appointments for Sam’s customers.
Components of the Voice Test Agent
Dataset
A dataset is a collection of customer phone call scenarios that you want Hamming’s test agent to simulate. You can upload an existing dataset in CSV or JSON format or create a new one from the UI. Each dataset you create has a dataset_id.
Scoring Prompts
Scorer
The scorer wraps a scoring prompt and adds configuration knobs to control how your voice agent is evaluated.
Hamming Test Agent
To test your AI voice agent, the Hamming test agent will simulate multiple interactions using the scenarios provided in your dataset. Remember, Hamming’s test agent takes on the role of your customers!
Step-by-Step Tutorial
Create A Dataset
Pro Tip: Hamming accepts CSV & JSON files up to 10MB.
- Visit app.hamming.ai/datasets to create a dataset.
- Click on +Add New Dataset. You can either upload an existing dataset or create an empty dataset and then use the JSON editor to build one. The dataset should contain all phone calls scenarios you’d like Hamming’s test agent to simulate.
- Enter a dataset name and description.
- Select the input columns. The input columns are the data points you’d like the Hamming test agent to reference.
Create A Scoring Prompt
Pro Tip: We recommend using gpt-4o with temperature 0 to get the best results.
- Visit app.hamming.ai/prompts to create a scoring prompt. The prompt should contain concise instructions for the scorer.
- Click on +Add Prompt.
- Enter a prompt name and description.
- Select the model that you want to use to evaluate your AI voice agent.
- Add a system prompt.
- Add a user prompt.
Important: The result of the prompt should be structured as an XML format, as outlined below.
- Save the prompt and deploy to production.
Create A Scorer
Important: Ensure that the values in the scorer align with the labels from your scoring prompt. For example, if the value “0” represents “No” in your prompt, make sure the scorer also labels “0” as “No.”
- Visit app.hamming.ai/evals to create a scorer, which simply acts as a wrapper for the scoring prompt.
- Click on +Add Scorer.
- Enter a scorer name and description.
- Add values and labels which will be used to display the results of the test.
- Select the scoring prompt you created in Step 2 and set the prompt label to production.
- Change the Variable Mappings field to Output and enter transcript in the field on the right.
Create A Hamming Test Agent
Pro Tip: If you want to speak to Hamming’s test agent, you can enter your own phone number and Hamming’s test agent will call you.
- Visit app.hamming.ai/voice-agents to set up a Hamming test agent (customer).
- Click on +Add Voice Agent.
- Enter a name.
- Select Function from the Scoring dropdown and select the scorer you created in the previous step.
- Configure a prompt for the Hamming test agent with input variables from your dataset, allowing it to simulate a variety of customer situations.
It is critical that you specify the input variables from your dataset created in the Test Agent (Customer) prompt as shown in the template below. This ensures that the Hamming Test agent references the input variables when speaking to your voice agent.
Configure post-call webhooks
If your agent doesn’t have any function calling, then you can skip to the next step.
Most voice agents are dynamic and perform actions during the call. To evaluate the performance of your voice agent, you need to configure a post-call webhook so we can capture the output of the call. (audio file, transcript, traces, etc.)
- For the Hamming test agent you created in the previous step, click on Edit.
- Find the Retell and Vapi webhooks and copy the webhook URL.
- Log-in to your Retell or Vapi account and put our webhook URL in the Post-call webhook field.
- This will allow Hamming to capture the complete output of the call (what was said and what was done) and evaluate the performance of your voice agent.
Run Hamming Test Agent
- Under dataset, select the dataset you created in Step 1.
- Click on Run.
- Enter the phone number of your ai voice agent.
- Click on Run Calls.
- Once your calls have finished, you will be able to see the results in the evaluation column.