Skip to main content
Vizra ADK is in maintenance mode. It continues to work and receives compatibility fixes, but no new features are planned. For evaluating AI agents — now built on the official Laravel AI SDK — check out Vizra Evals, its successor for the evaluation use-case. Coming from ADK? See the migration guide.
Looking for agent evals? This page documents ADK’s legacy CSV-based evaluation system. Its successor, Vizra Evals, runs evals as Pest tests, records every run to a database, auto-baselines, and fails CI on regressions. Start with the Quickstart or the ADK migration guide.
Why Testing Matters - Just like you wouldn’t ship code without tests, don’t deploy AI agents without evaluations! Evaluations give you confidence that your agents will handle real-world scenarios gracefully, consistently, and professionally.

What Are Evaluations?

Think of evaluations as unit tests for your AI agents! They help you:

CSV-Based Testing

Define test cases in simple CSV files - no complex setup required!

Automated Validation

Run hundreds of tests automatically with built-in assertions

LLM-as-Judge

Use AI to evaluate subjective qualities like helpfulness

Result Tracking

Export results to CSV for analysis and CI/CD integration

Creating Your First Evaluation

Step 1: Generate the Evaluation Class

Let’s create an evaluation to test a customer support agent! Run this magical command:
Terminal
Double Magic! What Gets Created - This single command creates two files for you:
  • app/Evaluations/CustomerSupportEvaluation.php - Your evaluation class
  • app/Evaluations/data/customer_support_evaluation.csv - Empty CSV with headers ready for test data
No need to manually create the CSV file - it’s all set up and ready for you to add test cases!
Boom! This creates your evaluation class in app/Evaluations/CustomerSupportEvaluation.php:
app/Evaluations/CustomerSupportEvaluation.php

Step 2: Add Your Test Data

Now for the fun part - adding test scenarios! The CSV file was automatically created with standard headers. Let’s populate it with different customer interactions:
app/Evaluations/data/customer_support_evaluation.csv
Pro Tip: Customize Your CSV Structure! - The auto-generated CSV starts with standard headers, but you can customize it for your needs:
  • prompt - The input to send to your agent (required)
  • expected_response - What you expect in the response
  • description - Human-readable test description
  • test_type - Add this to categorize tests for different assertion logic
  • context - Add background information for the test
  • Add any custom columns you need!
The command creates the basic structure - feel free to add more columns as your evaluation needs grow!

Your Assertion Toolbox

Vizra ADK provides a rich collection of assertions to validate every aspect of your agent’s responses!

Content Assertions

Length & Structure

Quality Checks

Safety & Security

LLM as Judge - The Ultimate Quality Check

Sometimes you need another AI to evaluate subjective qualities. That’s where LLM-as-Judge comes in!
When to Use LLM Judge? - Perfect for evaluating:
  • Helpfulness and professionalism
  • Empathy and emotional intelligence
  • Creativity and originality
  • Accuracy of complex responses
  • Overall response quality

Using LLM Judge Assertions

New Fluent Judge Interface! - We’ve introduced a cleaner, more intuitive syntax for judge assertions:
app/Evaluations/CustomerSupportEvaluation.php

Three Judge Patterns

1. Pass/Fail Judge For binary decisions - returns {"pass": true/false, "reasoning": "..."}
2. Quality Score Judge For numeric ratings - returns {"score": 8.5, "reasoning": "..."}
3. Comprehensive Judge For multi-dimensional evaluation - returns {"scores": {...}, "reasoning": "..."}

Running Your Evaluations

Time to put your agent to the test! Let’s see how it performs!

Running from CLI

Terminal

What You’ll See

Watch the magic happen with a beautiful progress bar and detailed results!
Console Output

Advanced Example - Putting It All Together

Ready for the full experience? Here’s a complete evaluation implementation that showcases all the techniques!
app/Evaluations/CustomerSupportEvaluation.php

Analyzing Your Results

CSV Output Structure

When you export results with --output, you get a comprehensive CSV report! CSV Columns Explained:
  • Evaluation Name - The name of your evaluation
  • Row Index - Which test case from your CSV
  • Final Status - pass, fail, or error
  • LLM Response - What your agent actually said
  • Assertions (JSON) - Detailed results of each check

Creating Custom Assertions

Need something specific? Create your own reusable assertion classes!

Simple Example: Product Name Assertion

Let’s create a simple assertion that checks if a product name is mentioned:
app/Evaluations/Assertions/ContainsProductAssertion.php

Using Your Custom Assertion

app/Evaluations/ProductReviewEvaluation.php
Pro Tip: CSV-Driven Custom Assertions! - You can even specify custom assertions in your CSV files:
Then use them dynamically in your evaluation:

Generate Assertion Classes with Artisan

Creating new assertions is super easy with our generator command!
Terminal
This creates a ready-to-use assertion class with helpful boilerplate!

Built-in Custom Assertions

Vizra ADK comes with several ready-to-use custom assertions:

ContainsProductAssertion

Check if a product name is mentioned

JsonSchemaAssertion

Validate JSON structure against a schema

PriceFormatAssertion

Verify price formatting in any currency

EmailFormatAssertion

Check for valid email addresses

CI/CD Integration

Make testing automatic! Here’s how to add evaluations to your CI/CD pipeline!
.github/workflows/evaluate.yml

Best Practices for Awesome Evaluations

Organization

  • CSV Organization - Use clear test types and descriptive columns
  • Thorough Testing - Combine multiple assertion types
  • LLM Judge - Use for subjective quality checks
  • CI/CD Integration - Run evaluations on every push

Quality

  • Track Progress - Monitor performance over time
  • Real Data - Include actual user queries
  • Edge Cases - Test error scenarios too
  • Consistency - Use the same criteria across agents

You’re Ready to Test Like a Pro!

With evaluations, you can ship AI agents with confidence! Your agents will be tested, validated, and ready for real-world challenges. Happy testing!

Next: Tracing

Learn about debugging with traces

Evaluation API Reference

Detailed evaluation class documentation