Skip to main content
Evaluation uses LLM-as-Judge to assess AI outputs with human-like reasoning, providing scores, feedback, and improvement suggestions.

How Evaluation Works

LLM as Judge

AI evaluates AI with human-like reasoning

Accuracy

Compare output vs expected result

Performance

Measure speed and memory usage

Reliability

Verify tools are called correctly

LLM as Judge

The Judge class uses an LLM to evaluate outputs with human-like reasoning. This is the recommended approach for most evaluations.

Judge Types

Compares output against expected output.
Evaluates against custom criteria.
Evaluates multi-agent workflow outputs.

Judge Registry

Register and retrieve custom judges:

Evaluation Types

Accuracy Evaluation

Compare agent output against expected output using LLM-as-judge.

Performance Evaluation

Measure runtime and memory usage.
MetricDescription
avg_run_timeAverage execution time
min_run_timeFastest execution
max_run_timeSlowest execution
std_dev_run_timeStandard deviation
median_run_timeMedian execution time
p95_run_time95th percentile
avg_memory_usageAverage memory (MB)

Reliability Evaluation

Verify that expected tools are called.

Criteria Evaluation

Evaluate against custom criteria with numeric or binary scoring.

Evaluation Flow


Async Evaluation

All evaluators support async execution:

Saving Results

Save evaluation results for later analysis:

Evaluation Packages

Run multiple test cases as a batch:

Quick Reference

Judge

Accuracy

Performance

Reliability


Best Practices

Use Judge for most evaluations - it provides human-like reasoning.
Be specific: “Response is under 100 words and includes a greeting” is better than “Response is good”.
Run evaluations multiple times to account for LLM non-determinism.
Use save_results_path to track evaluation history over time.
Use Accuracy for correctness, Performance for speed, Reliability for tool usage.
LLM Costs: Each evaluation makes LLM API calls. Use num_iterations wisely and consider caching for repeated evaluations.

Guardrails

Protect agents with input/output validation

Hooks

Intercept and modify agent behavior