> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phonely.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# A/B Testing

> Compare a control agent with a variant using live call traffic.

A/B Testing compares your current agent, the **Control**, with one or more **Variants** using live calls. Phonely routes the configured share of eligible calls to each variant. Each test compares its variant with the shared control using that test's own success criterion. Tests can run on the calls your agent answers, on the calls it places, or on both.

Use [Unit Testing](https://docs.phonely.ai/testing/simulation-testing.md) for repeatable generated scenarios before exposing changes to live traffic.

## Create a test

Open **Testing > A/B Testing** and create a test in **Planned**. The setup has four parts:

| Step | What you configure |
| - | - |
| Test details | Name, description, the category of change, and which calls the test runs on |
| End criteria | Stop after a number of calls or a number of days |
| Traffic split | The variant's share of eligible calls, from 1% to 100% in 1% steps, limited by the share available alongside other running tests |
| Success criteria | The call outcome, ended reason, or call-duration direction that counts as success |

The category—**Voice**, **Workflow**, **Agent Settings**, **Knowledge Base**, or **Other**—labels what you intend to compare. It does not restrict which variant settings you can edit.

### Choose which calls the test runs on

A **Workflow** test asks which calls it should run on. Choose one:

| Choice | What it splits |
| - | - |
| **Inbound calls** | The calls your agent answers |
| **Outbound calls** | The calls placed by campaigns and the API |

Every other category splits calls in both directions, as do workflow tests created before this choice existed.

When a test includes outbound calls, use **Include voicemail calls in results** to decide whether outbound calls that reach voicemail count toward the result. It is off by default, so those calls are excluded until you enable it.

Success-criteria options follow that choice for workflow tests: outcome tags come from the selected direction's calls only, and an inbound test does not offer the **Voicemail** ended reason.

When choosing successful outcomes or ended reasons, search to narrow the options. **Select all N results** selects the matching options and keeps any selections outside the search. If all matches are already selected, selecting it again clears only those matches. Clear the search and review the full selection before starting the test.

### Edit the variant

Select the test's edit action. Its label includes the variant's letter after the test starts, such as **Edit Variant C**. A planned test has no letter yet.

Where you edit depends on the test:

* A variant stored as changes to the base agent opens that agent's own page in variant-editing mode.
* A test with a separate copied variant opens that agent's page in test-agent mode, with **Back to test** in the top strip.
* An outbound **Workflow** test opens the variant's call flow on the campaign page. The Campaigns view is hidden so you can focus on editing the flow.

When editing a variant on the base agent, check the test name in the top strip before making changes. **Back to test** returns to the test, and **Exit to base** returns to the regular agent configuration. Saves in this mode apply only to the variant.

Changed fields, guideline sections, blocks, and relevant agent tiles are marked with the variant's assigned letter, such as **C**. Hover a marker to see which variant changed that item. Planned variants are marked without an assigned letter.

Base-only controls, including phone numbers, compliance, analytics, renaming or deleting the agent, and adding or removing flows, are read-only or refused. Adding or editing Knowledge Base documents and websites, or changing whether they are active, is also unavailable. Removing a document or website from the variant keeps the source on the base agent.

> [!NOTE]
>
> Ask AI is unavailable while editing a variant on the base agent. Select **Exit to base** to use Ask AI with the regular agent configuration.

Make the change you want to measure, then test the variant before directing live calls to it.

## Start and manage the test

Review the variant before opening the **Start test** dialog and confirming the traffic split. While a test is in progress, eligible calls are assigned to the Control or a Variant according to the traffic split.

### Run several tests on one agent

Up to four A/B tests can run on the same agent at once. They share a single control, **A (original)**, and each running test's variant takes its own percentage of eligible calls. A receives the share left after the variants. For example, when B and C cover the same calls, B at 20% and C at 30% leave 50% for A. When a test starts, it is assigned the next free letter—**B**, **C**, **D**, or **E**—and keeps that letter after it ends. A planned test shows **Variant** with no letter until it starts, because the letter it would receive can change before then. These letters label the variant everywhere it appears in the app; a planned test can still be edited, but it does not take any calls until you start it.

When you start a test, the **Start test** dialog shows the agent's whole split: A (original), each already-running test's variant, and this test's variant with the letter it will get. Set this test's share up to what A still has; already-running tests keep their shares here, and a running test's percentage is changed from its own test settings.

If the percentage you planned no longer fits beside the running tests, the dialog starts the new test at whatever A has left, and **Make room** previews an even split that gives A and every variant—including the new one—an equal share, with A keeping any percentage that does not divide evenly. When four tests are already running, or no variant letter is free, the agent is at capacity and a new test cannot start until one finishes.

The test appears in one of three sections:

* **Planned** has been configured but is not routing calls.
* **In Progress** is currently routing live calls.
* **Completed** has reached its end criterion or was terminated.

Completed tests open newest first in the table view; use the column headers to change the sort order.

You can adjust the traffic split while a test is in progress. Terminating a test stops new calls from being assigned to it; it does not undo calls already completed.

> [!WARNING]
>
> A/B Testing affects live traffic. Test the variant independently and begin with a traffic share appropriate for the risk of the change.

### Change the base while tests exist

Variants stored as changes to the base agent follow base edits while keeping their own overrides. If publishing a base flow overlaps changes made by a planned or running variant, Phonely lists the affected tests, blocks, and fields before you publish.

* **Publish** keeps each variant's version of the overlapping changes; the rest of the publish reaches the variant.
* **Stop the test and publish**, or **Stop the tests and publish**, first ends the affected running tests. This option appears when an overlapping test is running.
* **Cancel** leaves the change unpublished.

Check the sync message on the test card or test details after changing the base:

| Message | What it means |
| - | - |
| **follows the base** | The variant follows the base configuration, with a last-synced time when available |
| **keeps its own value** | The variant retains its override where the base changed |
| **could not be updated; retrying** | The variant update failed; recheck its status and test it before relying on the change |

Messages identify the variant by its letter once it has one.

## Review the result

Open a test to compare completed calls, successful calls, and success rates for the Control and Variant. You can also open the calls assigned to either arm and inspect them in Call History.

Phonely calculates success from the criterion selected during setup:

* **Call Outcome** counts calls with one of the selected outcomes.
* **Call Ended Reason** counts calls with one of the selected ended reasons.
* **Call Duration** compares whether shorter or longer calls better match the goal.

The result may also show the difference between success rates, the probability that the variant wins, a p-value, and a confidence interval. Success rates and differences are displayed with up to three significant digits. Treat these as evidence from the calls collected so far, not a guarantee about future calls. A small sample or an interval that crosses zero means the result remains uncertain.

### Apply variant changes to the base

For a variant edited on the base agent, a started or completed test offers **Promote** followed by its letter, such as **Promote C**. Review the confirmation before applying it. Promotion applies the variant's changes to the base and preserves unrelated edits made to the base during the test.

Promotion does not end the test or change its status. Terminate a running test separately when you have finished comparing it. Complete an end-to-end test of the resulting base agent before relying on the promoted configuration.

Do not assume every variant difference should be promoted simply because one metric improved.

> [accordion] The test has few or uneven calls
>
> Confirm that the agent is receiving eligible live calls and review the configured traffic split. Random assignment can be uneven in a small sample; allow enough calls before interpreting the result.

> [accordion] Calls are not counted as successful
>
> Review the selected success criterion and the affected calls. Confirm that their outcome, ended reason, or duration matches the values configured for the test.

> [accordion] The result does not identify a clear winner
>
> Review the completed-call count and confidence interval. Continue the test when appropriate, or conclude that the measured change did not produce a reliable difference within the collected sample.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.