# Test the agent

> Chat with your agent in private, read how it built each answer, rate it and keep repeatable tests, without spending credits.

Source: https://docs.komplian.com/ai-agent/test-agent

Where: AI Agent → Test Agent

Test Agent is a private chat with your agent. It looks like your web widget and uses the same knowledge, persona and procedures as your live channels. Actions are only simulated: nothing is saved, booked or sent.

## Run a test

### 1. Open the test chat
Go to **AI Agent → Test Agent**. Press **New test** to start an empty conversation.

### 2. Write as a customer
Type the question a real customer would ask, in their words.

### 3. Read the answer
Under the reply, check **KB used** or **No KB match** and the confidence. Press **Show trace** to see how the agent built it.

### 4. Rate it
Press **Good** or **Poor**. The rating is **Saved for learning**.

## What each reply shows

| Item | What it tells you |
| --- | --- |
| **KB used** / **No KB match** | Whether your knowledge had something on the question. |
| Confidence | How sure the agent was, as a percentage. |
| **Good** / **Poor** | Your rating. Once you rate, the reply shows **Saved for learning**. |

## Turn trace

The **Turn trace** shows what the agent did on one reply:

- **Tool calls**: the tools it used, with what data, and whether they worked.
- **Procedure**: your [procedure](https://docs.komplian.com/ai-agent/procedures), if one ran, and what it collected.
- **Knowledge used**: the pieces of your knowledge it read.
- **Time**, **Calls** and **Language** of the reply.

Emails, phones, names and free text are masked in the trace.

## Create a scenario

A scenario is a test you keep and run again after every change.

### 1. Open the Scenario suite
Press **Create scenario**.

### 2. Describe the test
Fill in **Scenario title**, **Customer message** and **Expected behavior**: what a correct answer must do. **Description** is optional.

### 3. Save and run
Save the scenario, then press **Run**. Compare the reply with the expected behavior.

To have Komplian write a scenario, press **Generate scenario**, describe what you want to test and press **Generate with AI**. **Edit scenario** changes one. You can also delete it.

## Test history

**Test history** lists your saved tests. A test is saved after its first message. Each one shows its date, its number of **Turns** and **Needs training** when you rated at least one reply **Poor**. The bin icon deletes a test.

## Fix a wrong answer

The test chat does not edit answers one by one. Fix what the agent reads, then ask again.

| Problem | Where to fix it |
| --- | --- |
| A fact is missing or wrong | [Knowledge](https://docs.komplian.com/ai-agent/knowledge-base), or the business profile in [Persona and tone](https://docs.komplian.com/ai-agent/persona) |
| The tone is wrong | [Persona and tone](https://docs.komplian.com/ai-agent/persona) |
| One situation is handled badly | A [procedure](https://docs.komplian.com/ai-agent/procedures) |
| An action is missing, such as booking | The condition that turns it on, in [How the agent works](https://docs.komplian.com/ai-agent/overview) |

## Rules

| Rule | Detail |
| --- | --- |
| Credits | Test replies use no AI credits. |
| Daily limit | 200 test messages per workspace in 24 hours. |
| Actions | Simulated. No contact, appointment, callback, quote, email or hand-off is created. |
| Numbers | Test conversations count in the conversation totals of [Performance](https://docs.komplian.com/ai-agent/performance) and Analytics. Their replies are not counted in **Grounded responses** or **Needs review**. |
| Storage | **Test history** is stored on this device and in this browser only. |
| Billing | If your workspace is closed for billing, the test chat does not reply. |
| Takeover | If a person on your team takes over the test session, the agent does not reply until they hand it back. |

## Related

- [Knowledge](https://docs.komplian.com/ai-agent/knowledge-base): Add what the agent did not know.
- [Persona and tone](https://docs.komplian.com/ai-agent/persona): Change how it sounds.
- [How the agent works](https://docs.komplian.com/ai-agent/overview): What turns each action on.
