## Intent Trainer

One of the key strengths of AI Agents is their ability to improve over time. Cognigy.AI offers the _Intent Trainer_ feature that allows you to refine AI Agents based on existing dialogs. This tool improves the AI Agent’s understanding by letting you review and add user inputs to [Intents](https://docs.cognigy.com/ai/platform-features/nlu/intents/overview).

## Key Features

- **Analysis of Collected User Inputs**. Review and analyze Intent Trainer records to identify areas for improvement.
- **Adding Inputs to Intents**. Choose which Intent Trainer records will enhance specific Intents and add them to the Intent Sentences list.
- **Instant Training**. After refining Intent Trainer records, quickly update the NLU model on the Intent Trainer page. This action eliminates the need to rebuild the model on the Flow page.
- **Automatic Scoring**. The Train capability automatically scores Intents, and you can visually track progress with color-coded icons and scoring data in the list.

## Limitations

- By default, the Intent Trainer records Time-to-Live (TTL) is set to 10 days (14400 minutes). If you have on-premises installations, you can change this value using the following variable: `TRAINERRECORD_TTL_IN_MINUTES`. For example, to set the TTL to 30 days, configure the variable as follows: `TRAINERRECORD_TTL_IN_MINUTES="43200"`.
- The maximum file size for uploading Intent Trainer records is 150 MB.

## Working with Intent Trainer

In **Tweak > Intent Trainer**, you can:

1. [Find Intent Trainer records by using filters](https://docs.cognigy.com/ai/platform-features/nlu/intents/intent-trainer#filter-intent-trainer-records)
2. [Refine Intent Trainer records: add to Intents, skip, or ignore](https://docs.cognigy.com/ai/platform-features/nlu/intents/intent-trainer#manage-intent-trainer-records)
3. [Train the NLU model](https://docs.cognigy.com/ai/platform-features/nlu/intents/intent-trainer#train-the-nlu-model)
4. [_(Optional)_ Import and Export Intent Trainer records](https://docs.cognigy.com/ai/platform-features/nlu/intents/intent-trainer#import-and-export-intent-trainer-records)

### Filter Intent Trainer Records

Review the collected input records from users and search for them using filters.

**Predefined Filters**

The **Filter Preset** allows you to filter records based on predefined categories for more efficient navigation and analysis.

| **Filter Preset Option** | **Description** |
| --- | --- |
| Show All | View all available records without any filters applied. |
| Found Intents | View records with Intents identified by the system. |
| Found Lexicon Slots | View records where Lexicon Slots were detected. |
| Poor Intent Score | View records with Intents that have a low confidence score. |
| Fair Intent Score | View records with Intents that have a medium confidence score. |

**Custom Filters**

When you select **Custom** in the Filter Preset, you can apply any filter. If you modify a filter while a preset option is selected, the Filter Preset automatically changes to **Custom**.

| **Filter** | **Description** |
| --- | --- |
| Snapshot | Select a specific Snapshot to view Intents and related records. By default, **No Snapshot** is selected. |
| Locale | Filter records by language or locale when multiple locales are used. By default, **Any Locale** is selected. |
| Intent | Filter by specific Intents to refine the results. By default, **Any Intent** is selected. |
| Review Status | Filter records by their review status to track progress:<br>- **Not Reviewed** — a record was not reviewed.<br>- **Reviewed** — a record was added to the Intent and reviewed.<br>- **Ignored** — a record, along with all future inputs containing the same text, is ignored.<br>- **Skipped** — a record is skipped for now and can be revisited later, with the option to review it again. |
| Found Intent | Filter records based on whether an Intent was identified or not. By default, **No Intent Found** is selected. You can select one of the following options: <br>- **Found Intent** — shows records where an Intent was successfully matched.<br>- **No Intent Found** — shows records where no Intent was identified. |
| [Found a Slot](https://docs.cognigy.com/ai/platform-features/nlu/slots/overview) | View all Slots found based on the selected filter option. By default, **Not Selected** is chosen. You can select one of the following options: <br>- **Found Slots** — shows records where a Slot was identified.<br>- **No Slot Found** — shows records where no Slot was identified. |
| Intent Score | Filter records by confidence score, shown as color-coded icons. By default, **Not Selected** is chosen. You can select one of the following options: <br>- **Poor** (0–0.3) — low confidence score, meaning the Intent was not accurately identified.<br>- **Fair** (0.3–0.7) — medium confidence score, showing a moderately accurate identification.<br>- **Good** (0.7–1.0) — high confidence score, indicating a very accurate Intent identification. |
| Input Types | Filter records by user input type. You can select one of the following input types: <br>- **Positive Answer** — user responded affirmatively. For example, `yes`, `sure`.<br>- **Negative Answer** — user responded negatively. For example, `no`, `never`.<br>- **Greeting** — user initiated a greeting. For example, `hi`, `hello`.<br>- **Goodbye Message** — user expressed farewell. For example, `goodbye`, `see you later`.<br>- **Statement** — user made a declarative statement. For example, `I like this product`.<br>- **Command** — user issued a command. For example, `turn on the light`.<br>- **Why Question** — user asked a `why` question. For example, `Why is it included in the package?`.<br>- **How Question** — user asked a `how` question. For example, `How does this work?`.<br>- **Yes or No Question** — user asked a `yes/no` question. For example, `Do you have this item in stock?`. |
| [Slot](https://docs.cognigy.com/ai/platform-features/nlu/slots/overview) | Filter records by selected Slot type. You can select one of the following options: <br>- **None** — no Slots identified.<br>- **Lexicon Slots** — identified lexicon-based Slots, which are user-defined categories.<br>- **System Slots** — Slots that are predefined in the system, such as dates or numbers. |

### Manage Intent Trainer Records

Based on the analysis, decide which user inputs will improve a particular Intent, add those inputs to the corresponding Intent.

**Add Records to Intents**

1. In the Intent Trainer, select a record from the list and click **Add to Intent**.
2. In the **Edit Record** window, select an Intent to which you want to add a record.

**Change the text of the Intent** in the **Text** field.

Additionally, you can create a new Keyphrase or Synonym.

Save changes and apply them. The Intent record will be added as a sentence to the selected Intent.

You can add a user input record to a specific Intent using the [Cognigy.AI API POST /v2.0/trainer/batch](https://api-trial.cognigy.ai/openapi#post-/v2.0/trainer/batch) request, specify `"action": "addToIntent"` in the `operations` object.

**Skip Records**

1. In the Intent Trainer, select a record from the list and click **Skip**.
2. Apply changes. This action moves the input to **Skipped** records, but it will reappear in **Not reviewed** if the same input is entered again.

You can skip Intent Trainer records using the [Cognigy.AI API POST /v2.0/trainer/batch](https://api-trial.cognigy.ai/openapi#post-/v2.0/trainer/batch) request, specify `"action": "skip"` in the `operations` object.

**Ignore Records**

1. In the Intent Trainer, select an Intent record from the list and click **Ignore**.
2. Apply changes. This action moves the user input to the **Ignored** records, and if a user enters the same input, it will also be ignored.

You can skip Intent Trainer records using the [Cognigy.AI API POST /v2.0/trainer/batch](https://api-trial.cognigy.ai/openapi#post-/v2.0/trainer/batch) request, specify `"action": "ignore"` in the `operations` object.

### Train the NLU Model

After adding a record to the Intent, click **Train** in the top-right corner of the **Intent Records** page.

You don’t need to run **Build Model** in the Flow — the Intent Trainer has already scored the Intent, shown in the scoring data and color-coded icons.

### Import and Export Intent Trainer Records

You can import and export records between production and development environments.

The Intent Trainer [temporarily stores records](https://docs.cognigy.com/ai/platform-features/nlu/intents/intent-trainer#limitations). To ensure data safety, export the records for local storage.

**Import Records**

1. Go to **Tweak > Intent Trainer**.
2. In the upper-right corner, click **> Import Trainer Records**.
3. Select a file in the `CTRAIN` format from your computer and click **Open**.

Once the file is uploaded, you will receive a system success message.

You can import Intent Trainer records using the [Cognigy.AI API POST /v2.0/trainer/upload](https://api-trial.cognigy.ai/openapi#post-/v2.0/trainer/upload) request.

**Export Records**

1. Go to **Tweak > Intent Trainer**.
2. In the upper-right corner, click **> Export Trainer Records**.
3. Select a date range by clicking the date and selecting the desired date in the calendar.
4. To include reviewed records in the file, activate **Include reviewed**.
5. Click **Confirm**, then **Download Trainer Records**.

The file will be downloaded in the `CTRAIN` format.

You can export Intent Trainer records using the Cognigy.AI API. First, create a file via the [POST /v2.0/trainer/package](https://api-trial.cognigy.ai/openapi#post-/v2.0/trainer/package) request, and then download it via the [POST /v2.0/trainer/downloadlink](https://api-trial.cognigy.ai/openapi#post-/v2.0/trainer/downloadlink) request.
