Step 1: Install
Terminal
eval_runs, eval_row_results, eval_assertion_results) where every run is recorded. Requirements: PHP 8.4+, Laravel 12+, laravel/ai, and Pest 5.
Step 2: Write a Pest test
Evals are ordinary Pest tests —toPassEval() is just another expectation:
tests/Evals/SupportBotTest.php
SupportBot is any Laravel AI SDK agent — a class implementing Agent with the Promptable trait. A Closure or agent instance works too.
Step 3: Give it data
One JSON object per line:evals/support.jsonl
input is the prompt. Or provide messages — the final user turn becomes the prompt and the earlier turns are replayed as real conversation context. expected is free-form reference data; any other key lands in $row->meta().
Step 4: Run it
Terminal
Step 5: Break something, and watch it get caught
Change your agent’s prompt for the worse and run again:Terminal
Step 6: Watch it over time
Terminal
/evals for score trends per suite, per-sample drill-downs (including the judge’s reasoning for every score), and side-by-side run comparison. See Dashboard.
Next steps
How It Works
What actually happens when an eval runs — and where the data goes.
Assertions Reference
Everything you can check, from substrings to real tool calls and cost.
Datasets
JSONL, CSV, Eloquent — and replaying production conversations.
Running in CI
Fail the build when your agent regresses.