# Intent

This is where you define and manage the primary actions or goals users might express when interacting with your chatbot. Simply put, an intent captures what the user wants to do. By setting up and refining intents here, you help your chatbot understand and respond to user messages more effectively.

<figure><img src="https://4173380749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzKzxNnOaGxZvAEzvYa7y%2Fuploads%2F2BeKe0XBgcyaqsYNX9Qa%2FScreenshot%202566-11-07%20at%2022.13.24.png?alt=media&#x26;token=bf59614a-dd19-4803-9c87-d8dfad8fb1de" alt=""><figcaption></figcaption></figure>

The vector classifier model is the main methodology, enhancing the chatbot's intent recognition capabilities. Additionally, users have the flexibility to integrate their custom NLP models by configuring settings in the chatbot's settings page. This empowers users to tailor intent recognition to their specific needs, ensuring a more personalized and accurate chatbot experience.

## **Creating an Intent**

1. Navigate to the **Create Intent** area.
2. Enter a unique name in the **Intent Name** field.
3. Add new **Samples**:
   * Samples are example user inputs that depict various expressions of the intent.
   * By providing samples, you enhance the chatbot's ability to accurately identify the intent, even with different phrasings.
   * You can add up to 100 samples for each intent.
4. Click **Create** to finalize the intent creation.

***

## **Editing an Intent**

1. Choose the intent you wish to edit from the list on the left side.
2. Modify the necessary fields, following the guidelines provided in the **Create Intent** section.
3. After making all desired changes, click **Update**.

***

## **Deleting an Intent**

1. Select the intent you wish to delete from the list on the left.
2. Click on the trash icon.
3. Confirm the deletion by clicking **Delete**.

***

## **Searching for an Intent**

1. To search, ensure your query begins with the correct starting characters.
2. Type in the name of the intent in the search bar and either press **Enter** or click **Search**.
3. To revert back to the intents page, clear the input field and either press **Enter** or click **Search**.

{% hint style="info" %}

* You can only search using the intent name.
* The entities list is organized by the **Last Modified Date**.
  {% endhint %}

***

## LLM Model Classifier

### Recommendation Tips

* When adding samples, it is recommended to start with **3 samples** that clearly convey the **same meaning as the intent**.
* If the bot does not classify accurately, gradually increase the number of samples to **5**, then **7**, as needed.
* When adding or creating intents, **avoid using similar samples** across different intents.

**Naming Limitations**

1. Intent names must be between **2 to 100 characters**.
2. Intent names must be in **lowercase English letters only**.
3. If spacing is needed, use an **underscore (`_`)** instead.
4. Intent names must reflect the meaning of the training samples, as the **LLM model interprets intents primarily based on their names**.
   * Example:
     * Old intent name: `ChangeBeneficiary`
     * Updated intent name: `change_beneficiary`

**Sample Addition Limitations**

1. Each intent must have **at least 2 samples and no more than 100 samples**.
2. Each sample must contain **2 to 500 characters**.
3. Each sample must convey the **same meaning as the intent name** to avoid misinterpretation.
4. Samples **can include wrong typos**, as long as the intended meaning remains consistent with the intent name.

* Example:&#x20;
  * Intent name: `health_insurance_inquiry`
    * English
      * *I want to ask about health insurance.*
      * *Do you have any health insurance plans?*
      * *Can you give me details about your health insurance?*
      * *pleas tell me about helth insuranc* (intentional typos)
    * Thai
      * *มีแผนประกันสุขภาพอะไรบ้าง*
      * *ขอรายละเอียดของประกันสุขภาพหน่อยค่ะ*
      * *ขอทราบข้อมูลประกันสุขภาพ*
      * *ประกันสุขภาพของคุณครอบคลุมอะไรบ้าง*

### Creating a LLM Intent

1. Importing a CSV file (recommended when there are multiple intents and samples to be trained at once)

   <figure><img src="https://4173380749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzKzxNnOaGxZvAEzvYa7y%2Fuploads%2FBaUCMlHCclc48N414dhn%2FScreenshot%202568-06-20%20at%2016.27.03.png?alt=media&#x26;token=5c1cd6a0-ca84-4ee1-a0be-7de6b87774b8" alt="" width="375"><figcaption></figcaption></figure>

   * Go to Chatbot > Intent Click **Import Intent**
   * Click **Download CSV Template** to download the format for importing intents
   * You will get a template as shown in the example. You can format the file to be used on the bot platform as follows:
     * Enter the intent name under the header `_name` (column A)
     * Enter the sample phrases under the header `_value` (column B)
   * Select the prepared `.csv` file from your device to upload to the bot platform
   * Once the upload is complete, a confirmation message will be displayed as shown
   * Once the intent is successfully created, its details will be displayed. You can verify this by checking the **Last Modify Date**, which will show the timestamp of when the intent was created.

   ![](https://lh7-rt.googleusercontent.com/slidesz/AGV_vUefkLPP6Jd-ouIkJ0JQ42mWvSYxRB9kpSt0IWcMdFbgB5hUWXc4fgv-l_OLVZqeessQtuU57WXXhuspoB683HGr78s76C6ZGbaUyEhFAz8By7hWPjE0h1Go8izZJbvffAqf0YuMzQ=s2048?key=6eNDatIn143VO1XLoILwW19J)

2. Manual creation
   * Type the desired intent name in the **Enter intent name** field
   * Enter a sample phrase in the input field
   * Click the **‘+’** button to add the sample
   * After adding all the desired samples, click **Create**
   * Once you click **Create**, a confirmation message will appear on the screen as shown
   * Once the intent is successfully created, its details will be displayed. You can verify this by checking the **Last Modify Date**, which will show the timestamp of when the intent was created.

### Update a LLM Intent

<figure><img src="https://4173380749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzKzxNnOaGxZvAEzvYa7y%2Fuploads%2F4UDEzqWBTLmwhJ2VKZqs%2FScreenshot%202568-06-20%20at%2016.48.44.png?alt=media&#x26;token=10b608aa-8bea-4370-a8b6-31e2d3496a33" alt=""><figcaption></figcaption></figure>

* Type the intent name you want to update in the **search intent name** field
* Select the intent you want to update
* Make the desired edits
  * You can delete a sample by clicking the **‘x’**
  * You can edit an existing sample by clicking on it and modifying as needed
  * You can add new samples by following the steps in the [**How to create an intent**](#creating-a-llm-intent) section
* After making the necessary changes, click **Update**
* Once you click **Update**, a confirmation message will appear on the screen
* Once the intent is successfully updated, you can verify it by checking the **Last Modify Date**, which will show the timestamp of the latest update.

### Training a LLM Intent

<figure><img src="https://4173380749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzKzxNnOaGxZvAEzvYa7y%2Fuploads%2Frd3K3qS1gWEtfADskqzC%2FScreenshot%202568-06-20%20at%2016.44.04.png?alt=media&#x26;token=1fa92288-aa70-4df2-a181-f2cbdf8614aa" alt=""><figcaption></figcaption></figure>

1. Once you have created and updated the intents as desired, the next step is to click the **‘Train’** button to start training the intents.
2. You will see the **‘Training…’** status on the button, indicating that the bot is currently training. The training process typically takes around **45–60 minutes**.
3. When the training is complete, the **‘Training…’** button will revert back to **‘Train’**. You can also confirm that the training has finished by checking the **Last train** timestamp, which should reflect the current time after training completion.

### FAQ

**Q1:** How to set up **unknown\_intent** (fail flow) for LLM?

**A1:** Since the LLM will try to classify messages into existing intents on the platform first, you need to create an additional intent to filter out messages that should go to the fail flow. These messages will be routed to this intent and then mapped to trigger the **fail\_flow** action

A good unknown\_intent must have samples where each sample has a completely different meaning from one another. (Samples must not point in the same direction or imply any other existing intents in the bot platform.)
