Skip to main content
This walkthrough takes you from nothing to a recorded, regression-gated eval of a real agent.

Step 1: Install

Terminal
The migration adds three tables (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
Each row runs 3 times. Deterministic checks run first; the judge only runs on samples whose gates passed. Everything is recorded.
In Pest, the first run that passes its gate automatically becomes the suite’s baseline. No setup — regression detection is armed from your second run onward. (From the CLI it’s explicit: pass --baseline.)

Step 5: Break something, and watch it get caught

Change your agent’s prompt for the worse and run again:
Terminal
Row-level receipts: which inputs got worse, and by how much. That’s the difference between “a test failed” and knowing what to fix.

Step 6: Watch it over time

Terminal
Visit /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.