Skip to main content
Simulation testing runs saved test questions against an agent and scores each answer. Use it to check that a new prompt, model or knowledge source does not break answers that used to work.

Find your way around Agent Lab

Open Agents → Agent Lab and choose the task you want to perform:
  • Datasets: group questions and expected outcomes into repeatable test suites. Search by name, description, or agent. Open a dataset to edit its test cases, or select View runs to open its Simulation Runs tab.
  • Quick Test: choose an agent, enter a question, and inspect its answer, tool calls, and routing. Save a useful test to a dataset to run it again. Your question and result stay available when switching between the lab’s tabs; leaving the page or refreshing clears them.
  • Personas: define reusable user identities and business context, then assign them to test cases. Search by profile name, description, or agent.
The Actions menu beside each dataset or persona lets you edit or delete it. Deletion requires confirmation. Searches are included in the page link, so you can return to a filtered list or share it with another administrator.
Tests run through the same path as a live conversation. Tools and API data sources the agent uses can perform real actions, except those you replace with overrides.

Test an agent’s draft

To try changes while you edit an agent, open an existing standard text agent and select Test agent next to Publish. The panel tests the unpublished draft: instructions, model, sources and tools. You can keep chatting as you change the configuration, and Retry replays the last question with the new version. See Drafts and Testing. Use Agent Lab when you need client context, personas or saved datasets.

Quick Test

  1. In Agent Lab, open Quick Test.
  2. Select an agent and type a question.
  3. Click Run Test to see the response and the tools called.
  4. Click Save to Dataset to keep the question as a test case, in an existing dataset or a new one.

Testing with client context

Your application can send context with each message, such as the customer’s plan or the current page (see Page Context). To reproduce it, click Add client context in Quick Test or in the test case editor:
  • Choose Text to enter a sentence, such as “The customer has a premium plan and prefers replies in French.”
  • Choose JSON object to paste structured data, such as {"plan": "premium", "language": "fr"}. Use double quotes around property names and strings.
  • Choose Full JSON (advanced) to edit the whole context, with several entries and their names, descriptions and stability. Existing contexts with several entries open in this mode.
With Text or JSON object, Agent Lab builds the surrounding structure for you. The full context looks like this:
Each entry can include name, description, data and stable. Set stable to true for context that stays the same for the whole conversation; it defaults to false. Saving a quick test to a dataset also saves its context. In multi-turn test cases, the context is sent with every message. Leave it empty to test without context.

Create a dataset

  1. In Agent Lab, open Datasets and click Create Dataset.
  2. Enter a Dataset Name and an optional Description.
  3. Optionally choose a Bound Agent. The run dialog uses that agent; leave it empty to choose an agent when starting each run.
  4. Save the dataset, then add test cases.
To add many test cases at once, click Import and upload a CSV or JSON file with the columns question, expected_type, expected_answer, expected_tool_name and expected_tool_args.

Add test cases

Click Add Test Case and choose the Expected Type: The expected answer does not need to match word for word. An AI evaluator compares the meaning.

Multi-turn test cases

Switch from Single Turn to Multi-Turn to test a whole conversation, for example an agent that collects information over several messages. For each step, enter the User Message and its expected outcome, then click Add Step for the next one. All steps run in the same conversation, so the agent keeps the context of earlier messages.

Generate test cases with AI

Instead of writing every test case, let AGO write them from the agent’s knowledge:
  1. Open the dataset and click Generate with AI.
  2. Choose the agent and the Generation mode:
    • From knowledge documents: questions cover the topics in the agent’s knowledge documents, phrased the way real users write.
    • From a user profile: describe the user and how they behave, for example “a new payroll manager, in a hurry, who asks short and sometimes vague questions about leave management”. Questions are written the way that user would ask them; expected answers still come from the knowledge documents.
  3. Set the Number of test cases (1 to 50) and the Max user messages per conversation (1 to 10). Set it to 1 for single-question test cases.
  4. Click Generate with AI.
Generated test cases are conversations that can include follow-up questions, clarifications and edge cases. Generation also reads the agent’s instructions, so the conversations exercise the rules the agent must follow. Generation uses existing questions to help avoid repetition. Generation runs in the background and can take several minutes. Generated test cases use the Text Answer type; edit them or run them right away.
Generation reads the agent’s knowledge documents, or the whole knowledge base when the agent has no sources. If no document has readable content, no test cases are created.

Personas

Personas describe the users your tests simulate.
  1. In Agent Lab, open Personas and click Create Persona.
  2. Enter a Persona Name. Optionally fill Role, Description and Behavior Notes; the behavior section includes an example to help you get started.
  3. Open Advanced · User identity when you need User Overrides, entered as a JSON object to simulate a widget user, for example {"email": "test@example.com", "additional_info": {"jwt_claims": {"plan": "premium"}}}. JWT claims grant permissions through your JWT permission rules, as for a real user.
  4. Save to return to the personas list.
Existing overrides are expanded when you edit a profile. Clearing an optional field removes its saved value. Select a persona when you add or edit a test case. Role, description and behavior notes describe the profile; they do not change how answers are scored.

Mock API data and tool results

In a test case, you can replace what an API data source or a tool returns, to test a specific situation without changing real data:
  • API Data Overrides: click Add API Override, select an API data source and enter the JSON it should return. The source’s response data path and excluded paths still apply, so you can paste the full API response.
  • Tool Call Overrides: click Add Tool Override, enter the tool name and the JSON result it should return.

Run a simulation

  1. In Agent Lab > Datasets, open a dataset, select Simulation Runs, then click Start New Run.
  2. Select the agent, unless the dataset is bound to one.
  3. Optionally check Detect knowledge gaps.
  4. Click Start Run. Progress updates as tests complete.
A run is Pending, Running, Completed or Failed. Its summary shows the number of tests (each multi-turn step counts as one), how many passed and failed, the success rate and the duration.

Detecting knowledge gaps from a run

With Detect knowledge gaps checked, AGO analyzes the failed Text Answer tests when the run completes. For each gap it finds, it files a Knowledge Gap Report with the source “Simulation lab”, including the question, what was missing and suggested edits. Tool call and agent routing failures are not analyzed. Together with AI-generated test cases, this gives you an audit loop: generate questions from your knowledge base, run them, and review the gaps.

Read the results

Filter results with All Results, Passed Only or Failed Only. Each result shows:
  • the question, the expected outcome and the agent’s actual answer or tool calls
  • whether it passed, and its match percentage
  • the evaluator’s reasoning
  • Criteria Scores, when available: accuracy, completeness and relevance for text answers, or criteria for the expected tool call or agent routing
Expand a result and click Self-improve to analyze its conversation in the AI Debugger and get suggested fixes. This works for passed and failed tests when a conversation is associated with the result. The success rate is the number of passed results divided by the number of passed and failed results, multiplied by 100. It is zero when no results have been counted.

What to do with the success rate

Good practices

  • Cover the questions your users ask most, and the workflows they follow from start to finish.
  • Add edge cases: vague questions, out-of-scope requests, several questions in one message, typos.
  • Test escalations with Tool Call test cases.
  • Organize datasets by topic (“Billing”, “Technical”) or by importance (“Core”, “Edge cases”).
  • Run your datasets after every prompt, model or knowledge change, and before publishing.
You can also manage datasets, personas and runs with the Public API.

Troubleshooting

  1. Read the evaluator’s reasoning.
  2. Make the expected answer less specific: describe the key facts rather than exact wording.
  3. Check that the agent has access to the knowledge it needs.
  1. Check the spelling of the expected tool name.
  2. Remove expected arguments that are too strict, or check the argument names in the actual tool call.
Split large datasets into smaller, focused ones, and run the full set only before publishing.
  1. Lower the agent’s temperature.
  2. Make the expected answer more flexible.
  3. Look for content that changes over time, such as dates or prices.