Skip to main content

Agent Evaluation

PraisonAI provides a comprehensive evaluation framework for testing and benchmarking AI agents. The evaluation system supports multiple evaluation types with zero performance impact when not in use.

Evaluation Types

Eval Mode for Testing

Installation

The evaluation framework is included in praisonaiagents:

Python Usage

Accuracy Evaluation

Compare agent outputs against expected results using an LLM judge:

Performance Evaluation

Benchmark agent runtime and memory usage:

Reliability Evaluation

Verify that agents call the expected tools:

Criteria Evaluation

Evaluate outputs against custom criteria using LLM-as-judge:

Failure Callbacks

Handle evaluation failures with callbacks:

Evaluate Pre-generated Outputs

Evaluate outputs without running the agent:

Saving Results

Save evaluation results to files:

CLI Usage

Accuracy Evaluation

Performance Evaluation

Reliability Evaluation

Criteria Evaluation

List Judges

List every judge type registered via add_judge() (built-ins and any custom judges loaded through your agents.yaml).
Both forms print:
Use this after registering a custom judge (see Custom Judges) to confirm the registration took effect.

Batch Evaluation

Run multiple test cases from a JSON file:
Test file format (tests.json):

CLI Options Reference

Common Options

Accuracy Options

Performance Options

Reliability Options

Criteria Options

Result Data Structures

AccuracyResult

PerformanceResult

ReliabilityResult

CriteriaResult

LLM Judge in Interactive Tests

The interactive test runner integrates LLM-as-judge evaluation for automated response quality assessment. This allows you to validate not just tool calls and file outputs, but also the quality of agent responses.

Using Judge in CSV Tests

Add a judge_rubric column to your CSV test file:

Judge Configuration

CLI Options for Judge

Judge Output

When judge evaluation is enabled, results include:
  • Score: 1-10 rating based on rubric
  • Passed: Whether score meets threshold
  • Reasoning: Detailed explanation of the score
Example artifact (judge_result.json):

Writing Effective Rubrics

Good rubrics are:
  • Specific: “Response includes code example” vs “Response is good”
  • Measurable: “Explains at least 3 benefits” vs “Comprehensive”
  • Relevant: Focus on what matters for the test case
Examples:

Best Practices

  1. Use Multiple Iterations: Run evaluations multiple times for statistical significance
  2. Warmup Runs: Use warmup runs for performance benchmarks to avoid cold-start effects
  3. Save Results: Always save results for tracking and comparison
  4. Custom Criteria: Write specific, measurable criteria for criteria evaluations
  5. Batch Testing: Use batch evaluation for regression testing
  6. CI/CD Integration: Integrate evaluations into your CI/CD pipeline

Examples

See the examples directory for complete examples:

GitHub Advanced Test Rubrics

The github-advanced test suite uses specialized LLM judge rubrics for evaluating GitHub workflow quality:

Available Rubrics

Rubric Structure

Each rubric contains weighted criteria:

Scenario to Rubric Mapping