Evals quickstart
Overview
This quickstart shows how to check an assistant or squad’s next decision using a mock conversation. You’ll define the context, choose a judge, and inspect the result.
Evals run at the text and model layer. They don’t test speech recognition, audio quality, or turn-taking. Use Simulations for complete conversations, then controlled real calls for the phone path and live integrations.
For operator-focused guidance on choosing checkpoints and writing durable checks, see test decisions with Evals.
What are Evals?
Evals is Vapi’s AI agent testing framework that enables you to systematically test assistants and squads using mock conversations with automated validation. Test your agents by:
- Creating mock conversations - Define user messages and expected assistant responses
- Validating behavior - Use exact match, regex patterns, or AI-powered judging
- Testing tool calls - Verify function calls with specific arguments
- Running automated tests - Execute tests and receive detailed pass/fail results
- Debugging failures - Review full conversation transcripts with evaluation details
When are Evals useful?
Evals help you maintain quality and catch issues early:
- Pre-deployment testing - Validate new assistant configurations before going live
- Regression testing - Ensure prompt or tool changes don’t break existing behaviors
- Conversation flow validation - Test multi-turn interactions and complex scenarios
- Tool calling verification - Validate function calls with correct arguments
- Squad handoff testing - Ensure smooth transitions between squad members
- CI/CD integration - Automate quality gates in your deployment pipeline
What you’ll build
Focused Evals for an appointment-booking assistant that test:
- Asking for missing information
- Tool call requests with specific arguments
- Response pattern matching with regex
- Semantic validation using AI judges
- Decisions at selected conversation checkpoints
These are separate saved Evals, not a native Eval suite. Group and run them yourself or use custom automation.
Prerequisites
Sign up at dashboard.vapi.ai
Get a Vapi API key
You’ll also need an existing assistant or squad to test. You can create one in the Dashboard or use the API.
Step 1: Create your first evaluation
Start with a booking assistant whose policy requires a timezone before booking. This example checks whether it asks for the missing timezone. Include prior messages establishing any other prerequisites, such as verified identity, so asking for the timezone is the appropriate next decision. Choose an equivalent decision from your own assistant’s requirements if it doesn’t handle bookings.
Dashboard
cURL
Configure basic settings
- Name: Enter “Asks for missing timezone”
- Description: Add “Ask for the timezone before booking”
- Type: Automatically set to “chat.mockConversation”
Add conversation turns
- Click Add Message
- Select User message type
- Enter content: “I want to book for January 20, 2027 at 2pm.”
- Click Add Message again
- Select Assistant message type
- Click Enable Evaluation toggle
- Select AI Judge, then choose OpenAI and
gpt-4.1 - Enter:
Context: {{messages}}. Evaluate the last assistant message. Pass only if it asks the caller to specify their timezone before proceeding. Fail if it assumes a timezone or proceeds to book. Respond only with pass or fail. - Click Save Evaluation
Run this Eval against assistants or squads with the same booking requirement. Before relying on the judge, check that it accepts a response asking for the timezone and rejects one that chooses a timezone without asking.
Message structure: Each conversation turn has a role (user, assistant,
system, or tool). Assistant messages with judgePlan define what to validate.
Step 2: Run your evaluation
Execute the evaluation against your assistant or squad.
Dashboard
cURL
Open your evaluation
- Navigate to Evals in the sidebar
- Click on “Asks for missing timezone” from your evaluations list
You can also run evaluations with transient assistant or squad configurations
by providing assistant or squad objects instead of IDs in the target.
Step 3: Understand test results
Learn to interpret evaluation results and identify issues.
Successful evaluation
When all checks pass, you’ll see:
Pass criteria:
statusis “ended”endedReasonis “mockConversation.done”results[0].statusis “pass”- All
judge.statusvalues are “pass”
Failed evaluation
When validation fails, you’ll see details:
Failure indicators:
results[0].statusis “fail”judge.statusis “fail”judge.failureReasonexplains why validation failed
If endedReason is not “mockConversation.done”, the test encountered an error
(like “assistant-error” or “pipeline-error-openai-llm-failed”). Check your
assistant configuration.
Step 4: Test tool/function calls
Validate that your assistant calls functions with correct arguments.
Basic tool call validation
Test appointment booking with exact argument matching. This fixture uses an explicit date and an assistant configured to use America/Los_Angeles for bookings. Its bookAppointment tool accepts date and time. Supply any other required identity, availability, or policy context for your assistant before the checkpoint. Use a date your test environment accepts and keep the request and expected arguments in sync.
Dashboard
cURL
- Create new evaluation: “Appointment Booking Test”
- Add user message: “Book me an appointment for January 20, 2027 at 2pm Pacific time”
- Add assistant message with evaluation enabled
- Select Exact Match judge type
- Click Add Tool Call
- Enter function name: “bookAppointment”
- Add arguments:
date: “2027-01-20”time: “14:00”
- Add tool response message:
- Type: Tool
- Content:
{"status": "success", "confirmationId": "APT-12345"}
- Add a final assistant message with the AI judge below to check how it reports the mocked success
- Save evaluation
Tool call validation modes
The mock response doesn’t create an appointment. Verify external calendar state separately using a sandbox integration. Add a paired Eval where the tool returns an error and the assistant must not claim success, plus a case where missing information should prevent the tool call.
Exact match - Full validation:
Validates both function name AND all argument values exactly.
Partial match - Name only:
Validates only that the function was called (arguments can vary). Use this only when the name alone is the requirement. Keep argument checks when a wrong date, account ID, or other value would make the action incorrect.
Multiple tool calls:
Validates multiple function calls in sequence.
Tool calls are validated in the order they’re defined. Use type: "exact" for
strict validation or type: "regex" for flexible validation.
Step 5: Use regex for flexible validation
When responses vary slightly (like names, dates, or IDs), use regex patterns for flexible matching.
Common regex patterns
Greeting variations:
Matches: “Hello, I can help…”, “Hi I’ll help…”, “Hey let me help…”
Responses with variables:
This checks a format, not booking success. It also matches “Your appointment is not confirmed. Failed request reference APT-12345.” Use an AI judge to check meaning and tool checks to validate the requested action.
Date patterns:
Matches responses mentioning weekdays.
Case-insensitive matching:
The (?i) flag makes matching case-insensitive.
Example: Flexible booking confirmation
Dashboard
cURL
- Add assistant message with evaluation enabled
- Select Regex as judge type
- Enter pattern:
.*appointment.*(confirmed|booked).*\d{1,2}:\d{2}.* - This matches various confirmation phrasings with time mentions
Regex tips: - Use .* to match any characters - Use (option1|option2)
for alternatives - Use \d for digits, \s for whitespace - Use .*? for
non-greedy matching - Test your patterns with sample responses first
Step 6: Use AI judge for semantic validation
For complex validation criteria beyond pattern matching, use AI-powered judges to evaluate responses semantically.
AI judge structure
Writing effective judge prompts
Template structure:
Template variables:
{{messages}}- The entire conversation history (all messages exchanged){{messages[-1]}}- The last assistant message only
Example: Check for a clarifying question
Dashboard
cURL
- Add assistant message with evaluation enabled
- Select AI Judge as judge type
- Choose provider: OpenAI
- Select model: gpt-4o
- Enter evaluation prompt (see template above)
- Customize pass/fail criteria for your use case
Supported AI judge providers
Models: gpt-4o, gpt-4-turbo, gpt-3.5-turbo
Best for general-purpose evaluation
Models: claude-3-5-sonnet-20241022, claude-3-opus-20240229 Best for nuanced evaluation
Models: gemini-1.5-pro, gemini-1.5-flash Best for multilingual content
Models: llama-3.1-70b-versatile, mixtral-8x7b-32768
Best for fast evaluation
Custom LLM:
AI judge best practices
Tips for reliable AI judging: - Be specific with pass/fail criteria (avoid
ambiguous requirements) - Use “ALL pass criteria must be met” logic - Use “ANY
fail criteria triggers fail” logic - Include conversation context with {{ messages }} syntax - Request exact “pass” or “fail” output (no
explanations) - Test criteria with known good/bad responses before production
- Use consistent evaluation standards across similar tests
Step 7: Control flow with Continue Plan
Define what happens after an evaluation passes or fails using continuePlan.
Exit on failure
Stop the test immediately if a critical check fails:
Use case: Skip expensive subsequent tests when initial validation fails.
Override responses on failure
Provide fallback responses to continue testing even when validation fails:
Use case: Test error recovery paths or force specific tool calls for subsequent validation.
Example: Multi-step with exit control
This example assumes the assistant is required to say “This call may be recorded.” exactly. Don’t exact-match ordinary conversational wording. The later override supplies context for debugging; it doesn’t turn a failed checkpoint into a pass or prove that the booking happened.
Dashboard
cURL
- Create evaluation with multiple conversation turns
- For each assistant message with critical validation:
- Enable evaluation
- Configure judge plan (exact, regex, or AI)
- Toggle Exit on Failure to stop test early
- For non-critical checks, leave Exit on Failure disabled
If exitOnFailureEnabled is true and validation fails, the test stops
immediately. Subsequent conversation turns are not executed. Use this for
critical checkpoints.
Step 8: Test complete conversation flows
Validate multi-turn interactions that simulate real user conversations.
Fixed-path booking checkpoints
This example checks selected decisions along a supplied path. It isn’t an end-to-end booking test. Use a Simulation to explore different paths to the outcome. Use the tool and timezone setup from Step 4, and supply the caller’s test email in the mock context before expecting sendEmail.
Dashboard
cURL
Check each selected decision:
- Turn 1 - Initial request:
- User: “I need to schedule an appointment”
- Assistant evaluation: AI judge checking acknowledgment
- Turn 2 - Provide details:
- User: “January 20, 2027 at 2pm Pacific time”
- Assistant evaluation: Exact match on tool call
bookAppointment
- Turn 3 - Tool response:
- Tool:
{"status": "success", "confirmationId": "APT-12345"}
- Tool:
- Turn 4 - Confirmation:
- Assistant evaluation: AI judge checking that the reply accurately reports the tool result and confirmation ID
- Turn 5 - Follow-up:
- User: “Can I get that via email?”
- Assistant evaluation: Exact match on tool call
sendEmail
System message injection
Inject system prompts mid-conversation to test dynamic behavior changes:
Keep only the context needed for each decision and choose the simplest judge that proves its requirement. Include relevant tool results. Use exit-on-failure when later checkpoints depend on an earlier one passing. Use a Simulation for the complete conversation outcome.
Step 9: Manage evaluations
List and update individual Evals. Organize groups in your own tracker or automation.
List all evaluations
Dashboard
cURL
- Navigate to Evals in the sidebar
- View all evaluations in a table with:
- Name and description
- Created date
- Last run status
- Actions (Edit, Run, Delete)
- Use search to filter by name
- Sort by date or status
Update an evaluation
Dashboard
cURL
- Navigate to Evals and click on an evaluation
- Click Edit button
- Modify conversation turns, judge plans, or settings
- Click Save Changes
- Previous test runs remain unchanged
Delete an evaluation
Dashboard
cURL
- Navigate to Evals
- Click on an evaluation
- Click Delete button
- Confirm deletion
Deleting an evaluation does NOT delete its run history. Past run results remain accessible.
View run history
Dashboard
cURL
- Navigate to Evals
- Click on an evaluation
- View Runs tab showing:
- Run timestamp
- Target (assistant/squad)
- Status (pass/fail)
- Duration
- Click any run to view detailed results
Expected output
Successful run
Indicators of success:
- ✅
statusis “ended” - ✅
endedReasonis “mockConversation.done” - ✅
results[0].statusis “pass” - ✅ All
judge.statusvalues are “pass”
Failed run
Indicators of failure:
- ❌
results[0].statusis “fail” - ❌
judge.statusis “fail” - ❌
judge.failureReasonprovides specific details
Full conversation transcripts show both expected and actual values, making debugging straightforward.
Common patterns
Multiple validation types in one eval
Choose a judge for each checkpoint’s requirement, not to include every judge type in one test. Use exact matching for required tool arguments or mandated wording, regex for a stable format, and an AI judge for a decision’s meaning. Split independent questions into separate checks so a failure is easy to explain. Use a Simulation when you want to test a complete journey through different valid paths.
Test squad handoffs
Validate smooth transitions between squad members:
Regression tests
Keep Evals for important behavior and issues you have fixed. For example, create separate Evals for formal, casual, and multilingual greetings, each with its own expected response or judge criterion.
Run each relevant Eval after changing the greeting behavior. You can select individual Evals in the dashboard or use the API to run them from your own automation. See test decisions with Evals for guidance on turning real failures into regression coverage.
Troubleshooting
Common errors
“mockConversation.done” not reached:
- Check
endedReasonfor actual error (e.g., “assistant-error”, “pipeline-error-openai-llm-failed”) - Verify assistant configuration (model, voice, tools)
- Check API key validity and rate limits
Judge validation fails unexpectedly:
- Review actual vs expected output in
failureReason - For exact match: Check for extra spaces, punctuation, or case differences
- For regex: Test pattern with online regex validators
- For AI judge: Verify prompt clarity and binary pass/fail logic
Tool calls not validated:
- Ensure tool is properly configured in assistant
- Check argument types match exactly (string “14:00” vs number 14)
- Verify tool function names are spelled correctly
If you see endedReason: "assistant-error", your assistant configuration has
issues. Test the assistant manually first before running evals.
Next steps
Learn testing patterns, best practices, and CI/CD integration
Create and configure assistants to test
Build custom tools and validate their behavior
Complete API documentation for evals
Tips for success
Best practices for reliable testing: - Start simple with exact matches, then add complexity - One behavior per evaluation turn keeps tests focused - Use descriptive names that explain what’s being tested - Test both happy paths and edge cases - Version control your evals alongside assistant configs - Run critical tests first to fail fast - Review failure reasons promptly and iterate - Document why each test exists (use descriptions)
Get help
Need assistance? Try these resources: