---
title: "Test an AI agent before you change it"
description: "Score a new version of your AI agent against real questions before it goes live. Write test cases and plain-language scorers, then compare to a baseline."
---

# Test an AI agent before you change it

Agent evaluations tell you whether a change made your agent better or worse before your team or customers see it. You collect test cases, write scorers that grade the replies, and compare each run with last time.

- **Baseline comparison.** See which answers got better or worse since last time.
- **Plain-language grading.** Describe a good reply, and an AI grades every reply against it.
- **Two versions side by side.** Test two versions of the agent without publishing either.

## What goes into an agent evaluation?

### Collect the questions that matter

A test case is a question for the agent, plus the answer you expect if you have one. Add cases from real runs, have Hercules generate them, or import up to 200 rows from a CSV spreadsheet or JSON file. [Test cases](https://hercules.app/docs/agents/test-cases)

### Write down what a good answer looks like

A scorer is an AI grader that checks each reply against your plain-English criteria and returns pass or fail, a percentage, or a label from your list. Start from presets such as Answer accuracy and No hallucination, and try a scorer on a few cases before you save it. [Scorers](https://hercules.app/docs/agents/scorers)

### Prove a change helped

A baseline is the evaluation you save as the score to compare against, and later runs line up every question against it. Filter the report to Passed, Failed or Errors to see which answers changed. [Evaluation runs](https://hercules.app/docs/agents/evaluation-runs)

### Compare two versions before publishing either

Each evaluation picks which version writes the replies, and the newest version is the default. You can test a new version against the live one and publish whichever scores higher. [Evaluation runs](https://hercules.app/docs/agents/evaluation-runs)

### Read every reply beside its grade

The report puts each reply beside the answer you expected and each scorer's grade. The scorer's reasoning on each case shows whether a fail came from a weak reply or from vague criteria. [Scorers](https://hercules.app/docs/agents/scorers)

## How do you run your first evaluation?

### 1. Build a dataset

> Write test cases on the questions contractors ask about delivery windows, split deliveries and missed drop-offs.

Hercules generates test cases on that topic. Add the answer you expect to each case that needs one.

### 2. Set a baseline

Pick up to five scorers and one or more datasets, then click Run evaluation. Hercules answers and grades every question, then you click Set as baseline.

### 3. Change the agent and run it again

Edit the instructions and run the same evaluation on the new version. Hercules shows which answers got better and which got worse against the baseline.

## What could this look like for a business?

In this hypothetical example, a building materials distributor with 70 staff tests changes to the agent that answers their sales reps' delivery questions. The operations lead saves 40 real questions from run history with expected answers. She sets a baseline with the Answer accuracy and No hallucination scorers, rewrites the instructions on split deliveries and runs it again.

She publishes only when no answer that passed before now fails. Catching a wrong split-delivery answer here costs her one rerun, before any rep repeats it to a contractor.

## What should you know before you rely on evaluations?

- An evaluation writes each reply in one pass, with no tools, integrations or earlier messages, so check tool use in [run history](https://hercules.app/docs/agents/run-history).
- Scorers that compare a reply against an expected answer skip cases that don't have one.
- One evaluation covers at most 100 questions, so filter datasets by tag to stay under it.
- Writing replies, grading and generating test cases all spend AI credits. [Costs and limits](https://hercules.app/docs/agents/costs-and-limits)
- See what each plan includes on the [pricing page](https://hercules.app/pricing).

## Related features

- Use [Hercules Agents](/products/agents) to build the agent and choose what starts it when you don't have one yet.
- Use [Agents in apps](/features/agents-in-apps) to put the agent in your app when customers will use it there.

## How do you get started?

Set a baseline before your next instruction change, then run the same evaluation after it. Start building.

## Frequently asked questions

### Can a scorer grade real runs?

A scorer can grade real runs if it doesn't need an expected answer. It grades the share of runs you set, from 1% to 100%, with grades in run history and totals on Analytics. [Scorers](https://hercules.app/docs/agents/scorers)

### What happens if I delete an evaluation run?

Deleting an evaluation run removes its scores and results for good. If it was your baseline, you have none until you set another. [Evaluation runs](https://hercules.app/docs/agents/evaluation-runs)

### Can I export my test cases?

You can export all your test cases or only ticked rows, as CSV or JSON, and import the file again later. [Test cases](https://hercules.app/docs/agents/test-cases)

### Can Auto-improve suggest the changes to test?

Auto-improve reads the agent's runs and your team's reviews, then opens an issue with a suggested fix for each problem. Applying a fix publishes a new version right away, which you can roll back. [Auto-improve](https://hercules.app/docs/agents/auto-improve)

```json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Can a scorer grade real runs?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A scorer can grade real runs if it doesn't need an expected answer. It grades the share of runs you set, from 1% to 100%, with grades in run history and totals on Analytics. Scorers"
      }
    },
    {
      "@type": "Question",
      "name": "What happens if I delete an evaluation run?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Deleting an evaluation run removes its scores and results for good. If it was your baseline, you have none until you set another. Evaluation runs"
      }
    },
    {
      "@type": "Question",
      "name": "Can I export my test cases?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "You can export all your test cases or only ticked rows, as CSV or JSON, and import the file again later. Test cases"
      }
    },
    {
      "@type": "Question",
      "name": "Can Auto-improve suggest the changes to test?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Auto-improve reads the agent's runs and your team's reviews, then opens an issue with a suggested fix for each problem. Applying a fix publishes a new version right away, which you can roll back. Auto-improve"
      }
    }
  ]
}
```
