Skip to content
QwryAI
Documentation
Pages

AI Performance & Quality

Test your AI agent with simulated customers

Check how your agent handles a conversation before your customers do. A simulated customer talks to your agent, and each conversation is graded automatically.

Tests in QwryAI check how your agent handles the conversations that matter, before you launch it and after every change you publish. A test is a conversation between your agent and a simulated customer: you describe who the customer is and what they want, and what has to happen for the conversation to count as a pass. QwryAI runs that conversation as many times as you ask, grades each one, and shows you the transcripts.

Use tests to see how a change affects your agent: new instructions, a new data source, a Procedure or an Action. Tests run against your live agent, not your draft, so publish the change first, then run the same tests again and compare the pass rate. If the pass rate drops, change it back and publish again. See Drafts and publishing.

Tests lives in your agent's sidebar.

Tests live under Tests in your agent's sidebar.

How a test run works

Each run starts one or more conversations. In each one:

  1. A simulated customer, played by another AI model, opens the conversation from the scenario you wrote. It only knows the scenario and the conversation so far, never your agent's instructions or the success criterion.
  2. Your agent replies with its real setup: its instructions, data sources, Actions and Procedures.
  3. They keep talking until the customer is done or the conversation reaches its Max conversation turns.
  4. A judge, another AI model, reads the finished conversation and decides whether it met your Success criterion.
  5. If the test lists Expected Actions, QwryAI also checks which Actions the agent used.

A conversation passes only when the judge passes it and the Action check passes.

What to test first

You can have up to 50 tests per agent, so start with the conversations that matter most:

  1. Your most common questions. Check Analytics for your top topics and write a test for each.
  2. Anything that uses an Action. Refunds, bookings and order lookups are where a wrong answer costs the most. Use Expected Actions to check the right Action is used.
  3. Each Procedure. One test per Procedure, with a customer who needs it from start to finish.
  4. Handing off to a person. A frustrated customer who asks for a human should reach your escalation path.
  5. Questions your agent shouldn't answer. Off-topic requests check that your instructions and Guardrails hold.
  6. Failures. Turn on Return as error in an Action response to check your agent copes when an Action fails.

Example tests by use case

Use caseSimulated userSuccess criterionExpected Actions
Customer support"A customer who paid 40 days ago and wants a full refund. Polite but persistent.""The agent doesn't promise a refund it can't confirm and offers to pass the request to the team."Empty
Customer support"A customer whose problem wasn't solved after two tries and who now asks for a person.""The agent stops troubleshooting and hands the conversation to the team."Your escalation Action
Ecommerce"A shopper who placed an order five days ago and wants to know where it is.""The agent looks up the order and gives its current status."Your Shopify order lookup
Sales"A marketing manager who wants a demo next Tuesday afternoon.""The agent books a demo on Tuesday afternoon and confirms the time."Your Calendly booking Actions
Sales"A visitor comparing plans who is interested but not ready to buy.""The agent answers the pricing question and asks for the visitor's email."Your lead collection Action, if you use one

Adjust the wording to your own products and Actions. Expected Actions uses the names of the Actions on your agent.

Create a test

On the Tests page, select Create a test.

Create a test opens the editor.
FieldWhat to write
Test nameA label for the test, shown in the list and in exported results. Only you see it.
Simulated userWho the customer is and what they want.
Success criterionThe one thing that has to be true for the conversation to pass.
Expected ActionsOptional. Leave it empty to skip the Action check, or add the Actions the agent must use.
Action responsesOptional. What each Action returns during the test.
Max conversation turnsHow many messages the customer can send, from 1 to 20; new tests start at 20. A conversation that hasn't met the criterion by then fails.
  1. Name the test
    Name the test.
  2. Describe the simulated user
    Who the customer is and what they want.
  3. Write the success criterion
    The one thing that must be true to pass.

Expected Actions

This field decides whether QwryAI checks which Actions your agent uses.

Optional: the Actions the agent must use.

Empty. This is the default. QwryAI doesn't check Actions: the agent can use any Action, or none, and only the judge grades the conversation. The test's Configuration tab shows Not asserted.

With Actions. The agent must use exactly the Actions on the list, no more and no fewer. The Action check fails if the agent:

  • never used an Action on the list, or
  • used an Action that isn't on the list.

A failed Action check fails the conversation, even when the judge passed it. So list every Action the agent should use in the scenario, not just the main one.

Expected ActionsThe agent usesResult
EmptyAny Actions, or noneNo Action check. Only the judge grades.
Book meetingBook meetingAction check passes.
Book meetingNothingFails: Book meeting was never called.
Book meetingBook meeting, Create ticketFails: Create ticket wasn't expected.
Get slots, Book meetingBook meeting, Get slotsAction check passes. Order doesn't matter.

A few rules for how calls are counted:

  • Order doesn't matter.
  • Using the same Action several times counts once.
  • A call that returns an error still counts.

The check looks only at which Actions were used, not what was sent to them. To check the details, such as the date booked, put that in the success criterion: the judge sees each Action and what came back.

When the Action check fails, the conversation shows why under the verdict: Never called lists the missing Actions and Not expected lists the extra ones. Select Set response next to an expected Action to control what it returns.

Action responses

By default every Action in a test returns a generic success without running, so a test never books a meeting, refunds an order or creates a ticket. Select Add Action response to choose what a specific Action returns.

Mock a response, or call a read-only Action live.
ModeWhat happens
MockThe Action returns the JSON you write, and nothing real runs. Built-in Actions start with a sample response; custom Actions start empty, so paste what your API returns. Turn on Return as error to test a failure. A mock can be up to 50,000 characters.
LiveYour agent calls the real Action. Only Actions that just read data can run live, so nothing is created or changed. Results can differ between runs.

Each Action shows whether it only reads data (Read-only) or changes something (Writes data). Live is off for Actions that write data, and for custom Actions, since a test can't tell whether they change data.

Run a test

  • From the editor: select Save and run 3x, or open the arrow next to it to choose 1, 3, 5, 10 or 20 runs.
  • From the Tests page: select one or more tests, select Run selected, and choose how many times to run each one.
  • From a test's row: open its More actions menu and choose Run test.
  • From a test's page: select Run again, or open the arrow next to it to choose how many times.
Choose how many conversations to run.
Save and run starts three conversations.

A single run can start up to 200 conversations, counted as tests times repeats. Each workspace runs up to 5 conversations at once; the rest wait as Queued. Most runs finish within a few minutes.

While a test is running you can't edit it or run it again, and Run selected skips it.

Manage tests

On the Tests page, search tests by name or filter them by status: Completed, In-progress or Never run.

Each test with its status and latest results.

Open the More actions menu on a test's row to:

  • Edit test: change its setup. The next run uses the new setup.
  • Run test: start a run.
  • Duplicate test: open the editor with a copy of the test, for a variation.
  • Export results: download the latest run as a CSV file.
  • Delete test: remove the test and its run history. This can't be undone.
Everything you can do with a test.

Read the results

Open a test to see its latest run:

  • Pass rate: the share of graded conversations that passed. Conversations that reached no verdict aren't counted, since they say nothing about your agent.
  • Runs completed: how many of the run's conversations have finished.
  • Runs table: one row per conversation, with its status, number of turns, the Actions the agent used, how long it took and when it was queued.
Pass rate, runs completed and one row per conversation.
StatusMeaning
QueuedWaiting to start.
RunningThe conversation is under way.
PassedThe judge passed it, and the Action check passed if the test has Expected Actions.
FailedThe judge failed it, or the agent used the wrong Actions.
ErroredSomething went wrong before the conversation could be graded, such as a timeout, so it reached no verdict.

Select a row to read the conversation. The judge's reason is at the top; if the Action check failed, Never called and Not expected sit under it. Under each agent reply you can see the data sources it checked and the Actions it used. Select an Action to see what it returned, labelled Mocked response or Response.

The judge's reason, then the conversation.

The Configuration tab shows the test's setup, including its Expected Actions and Action responses.

The test's setup.

To share or analyse results elsewhere, select Export results. The CSV has one row per conversation with its status, turns, the Actions called, missing and unexpected, the time it took, the judge's reason and any error.

Test credits

Test credits are free credits added to your workspace every month, on top of your plan's credits. Tests use them first, so you can test without spending your plan's credits.

  • Test credits reset on the 1st of each month at midnight UTC. Unused ones don't carry over.
  • They belong to the workspace, so all its agents share them.
  • Only your agent's replies use credits, the same amount as a reply in a real conversation. The simulated customer and the judge are free.
PlanTest credits per month
Free0
Starter500
Growth1,000
Enterprise0

On plans without test credits, tests use your plan's credits from the start. On plans with them, the Tests page shows how many you've used this month and when they reset.

When your test credits run out, tests use your plan's credits. Before a run that could use them, QwryAI shows Test credits left, This run can use up to and From message credits. Select Run anyway to start it. The real cost is usually lower, since it depends on how many turns each conversation takes.

When both are used up, you can't start new runs until your test credits reset or you have credits again.

Limits

LimitValue
Tests per agent50
Max conversation turns per test20
Conversations per run200
Conversations running at once, per workspace5
Size of a mock response50,000 characters

Frequently asked questions

How many times should I run a test?

Save and run 3x starts 3 conversations, and you can choose 1, 3, 5, 10 or 20. Each one is graded separately, and the pass rate is the share that passed. Running a test several times gives you a pass rate rather than a single result, which makes before-and-after comparisons more reliable.

How does QwryAI decide if a test passed?

A judge, another AI model, reads the finished conversation and decides whether it met your success criterion. If the test has Expected Actions, QwryAI also checks that the agent used exactly those Actions. The conversation passes only when both checks pass, and the judge's reason appears at the top of each conversation.

Do tests use credits?

Tests use your free monthly test credits first: 500 on Starter and 1,000 on Growth. Only your agent's replies use credits, the same amount as a real reply. When test credits run out, or on plans without them, tests use your plan's credits, and QwryAI shows the most a run can use before you start it.

Can a test book a real meeting or issue a real refund?

No. By default every Action returns a generic success without running. You can set a read-only Action to Live, but Actions that write data can't run live. Test conversations aren't saved to your Inbox either.

Why did a conversation show Errored?

Something went wrong before it could be graded, such as a timeout. Errored conversations aren't counted in the pass rate. Run the test again.

Explore the documentation