# Step: AI Agent

In a Workflow, the **AI Agent** Step automatically transfers the conversation to the Respond AI’s chatbot, **AI Agent**. The AI Agent interacts with the Contact without human intervention until the conversation concludes.

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/qqpvzjm7cn/1700724111007/untitled-5.gif" alt="AI Agent interacting with Contact"><figcaption></figcaption></figure>

### Branches <a href="#branches" id="branches"></a>

Every AI Agent Step has the following five branches:

* Success (default, cannot be removed)
* Failure: Idle
* Failure: Speak to Human
* Failure: AI Can’t Answer
* Failure: Others (default, cannot be removed)

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/qqpvzjm7cn/1713408754677/untitled-8.gif" alt="AI Agent Branches"><figcaption></figcaption></figure>

The Contact journeys into one of these branches depending on the conditions met by the Step:

| **Branch Name**              | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | **Configuration**                                                                                        |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Success                      | <p>The condition for this branch is determined by the option selected in the Objective field.</p><ul><li>For the <strong>Answer Questions</strong> objective, i.e., the AI Agent answers incoming questions using the added <a href="https://help.respond.io/l/en/workspace-settings/workspace-setting-respond-ai#knowledge_sources">Knowledge Sources</a>, the condition for this branch is fulfilled after all questions from the Contact are successfully answered.</li><li>For the <strong>Collect Information</strong> objective, i.e., the AI Agent collects specific information from the Contact, the condition for this branch is fulfilled after all the information has been collected successfully.</li></ul> | Enabled by default for all AI Agent Steps and cannot be removed.                                         |
| Failure: Speak to a Human    | This branch handles the situation when the Contact requests to speak to a human agent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Enabled by selecting the **Contact Asks To Speak To A Human** toggle for all AI Agent Steps.             |
| Failure: AI Unable to Answer | This branch handles the situation when the AI Agent cannot answer a question for any reason.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Enabled by selecting the **Failure: AI Unable To Answer** toggle for the **Answer Questions** objective. |
| Failure: Others              | This branch handles the situation when a technical failure occurs, e.g., the Channel is disconnected, Respond AI credits run out, etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Enabled by default for all AI Agent Steps and cannot be removed.                                         |
| Failure: Idle                | This branch handles the situation when the contact has not responded for 60 minutes (the default/max value). You can decrease this limit if required                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Enabled by selecting the **Add Contact Idle Branch** toggle for all AI Agent Steps.                      |

### Configuration <a href="#configuration" id="configuration"></a>

In this Step, configure the following fields:

| Field Name              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Launch AI Agent Builder | Click to chat with AI to configure your objective for the AI Agent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Objective               | <p></p><p>Select one of the following two Objectives:</p><ul><li><strong>Answer Questions</strong>: Use this objective when you want the AI Agent to answer all incoming questions while referring to the assigned Knowledge Source. This Objective is highly suitable for FAQs and low-effort conversations.</li><li><strong>Collect Information</strong>: Use this objective when you want the AI Agent to ask specific questions and save the responses as variables. This Objective is highly suitable for data collection, updating Contact fields, qualifying leads, and updating Third-party apps.</li></ul>                                                                                                                                                                              |
| AI Persona              | <p>Provide a description of how the AI Agent should communicate i.e., the personality of your AI Agent, by defining the distinct characteristics you want your AI Agent to have.</p><p>For example, create a background of the persona by identifying the purpose/role it has in a conversation, define the personality (skillset, speaking style, etc.) and any other qualities that help Respond AI craft the behavior of AI Assist. However, a default persona has been provided for convenience which adheres to professional yet courteous conduct. Design the AI Assist persona carefully so that it can draft responses that best suit your business requirements. Learn more <a href="../../../converse-with-customers/how-to-align-ai-conversations-with-your-brand-voice">here</a></p> |

<figure><img src="https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2Fa8t95jW69O8TGVtEvpQ1%2Faii-agent-sytep-con.gif?alt=media&#x26;token=870a4df0-67b3-4662-8271-25a6b474d6dd" alt=""><figcaption></figcaption></figure>

**Collect Information Objective**

| Variable Configuration | Expand the toggle to manage the variables used to gather information from the Contact.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Required               | The toggle is enabled by default and indicates that the field is mandatory i.e., the AI Agent must ask the Contact for this information.                                                                                                                                                                                                                                                                                                                                                                   |
| Variable name          | <p>Enter the variable name. You can use this variable in other steps of the Workflow following this Step.</p><p>For example, you asked the Contact a qualifying question such as their age and save the information as a variable called contact_age. After this AI Agent Step, you can use this variable in any other Step of the Workflow after this Step. When adding a variable, you can view the list of variables within the Workflow, by entering the $ sign and selected the desired variable.</p> |
| Variable type          | Select the variable type from the dropdown list.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Variable description   | Provide a brief description of the variable. This gives the AI Agent an insight into what the variable is used for. You can also define any rules that you want to imply to the variables, e.g., the phone number should start with +601 and should either be 11 or 12 digit long without the considering the + sign a digit.                                                                                                                                                                              |
| Add Another Variable   | Click this button to add another variable                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/qqpvzjm7cn/1707366870018/1820-x-1080-ezgif-com-video-to-gif-converter-1.gif" alt="" width="563"><figcaption></figcaption></figure>

**Answer Questions Objective**

| Suggest New Objectives                  | Click the link to suggest other objectives that suit your business needs. You are directed to a Feature Request on Canny, where you can upvote the request and provide the objective in the comments section.                                                                                                                           |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Knowledge Source                        | Select an existing Knowledge Source AI uses to answer the Contact’s queries. These Knowledge Sources can either be added from the Add Knowledge Source proceeding this field or from **Settings** > **Respond AI** > **AI Agent** tab, selecting **Manage Knowledge Source** button.                                                    |
| Add Knowledge Source                    | Add a new [Knowledge Source](https://help.respond.io/l/en/workspace-settings/workspace-setting-respond-ai#step_1_providing_knowledge_sources) from here if the existing knowledge sources do not meet your requirements. It is recommended that the Knowledge Sources be focused on one subject for better responses and response time. |
| Reply outside of added Knowledge Source | Enable this toggle by sliding it to the right. Once enabled, AI may also respond using external sources of information, i.e., ChatGPT.                                                                                                                                                                                                  |
| Use Snippets as a Knowledge Source      | Enable the toggle by sliding it to the right. Once enabled, AI can use your snippets as a knowledge source to draft responses to your conversations.                                                                                                                                                                                    |

<figure><img src="https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2FwibO1dAjz75sZJh7Cbk1%2Faii-agent-sytep-con%20(1).gif?alt=media&#x26;token=bbb94fae-9bd5-475a-963c-63c1ae764f1f" alt=""><figcaption></figcaption></figure>

**Advanced Setting**

| Add Contact Idle Branch | Enable the toggle by sliding it to the right. Once enabled, the conversation is automatically closed if it remains idle for a maximum of 15 minutes. You can alter the value if required. |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

{% hint style="info" %}
AI Agent You can use both Objectives in one workflow using different AI Agent Steps
{% endhint %}

### **AI Agent Builder**

You can chat with AI using the **AI Agent Builder** to simplify the process of creating an AI Agent. Using AI Agent Builder, you can chat with AI to figure out and select the objective that suits your requirements. The AI asks you more questions after the Objective has been set to configure the Objective.

A preview of the AI Agent, along with the variable settings including which fields are mandatory is displayed, if you are satisfied with the settings, click **Proceed** to continue. You can change the AI Agent configurations later as well.

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/qqpvzjm7cn/1707366822356/pendo-showcase-aiagent-builder-ezgif-com-video-to-gif-converter.gif" alt=""><figcaption></figcaption></figure>

### How It Works <a href="#how_it_works" id="how_it_works"></a>

With the **AI Agent** Step, the workflow automatically enables [AI Agent](../../../workspace-setting) to respond to the Contact’s queries. The **AI Agent** Step configurations define the kind of responses AI Agent generates. The Knowledge Source, Snippets, and ability to reply outside of the Knowledge Sources determine the quality of the responses. The conversation continues until the Contact’s queries are satisfied.

{% hint style="warning" %}
Always close conversations properly for optimal performance. Improperly closed conversations confuse the AI Agent, leading to inaccurate context understanding and undesired outcomes
{% endhint %}

You can understand the AI Agent’s behavior by clicking the **Show AI Instructions** button. The button opens a dialog explaining the expected behavior of the AI Agent as configured by you.

In the **Messages** module, you can recognize a conversation between AI and a Contact by the icons.

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/qqpvzjm7cn/1700724818611/untitled-15.png" alt="Icon for AI Agent in a conversation"><figcaption></figcaption></figure>

{% hint style="info" %}
You can only view a conversation between AI and Contact on the Messages module and currently cannot intervene in the conversation. However, you can [stop the workflow](..) and take over the conversation if necessary.
{% endhint %}

### Best Practices <a href="#best_practices" id="best_practices"></a>

Here are some best practices for this Step you can follow to optimize your Workflow:

* Adopting a focused approach while selecting the Knowledge Sources for your **AI Agent** Step is the key to good responses from AI. AI does not respond well when a broad spectrum of information is provided for reference.
* While creating workflows featuring multiple **AI Agent** Steps, ensure the Contact is engaged in talks with more than one AI at no point.
* You should enable the **Add Contact Idle Branch** toggle so that the conversation is automatically closed after it has been left idle for the specified time (maximum 15 min). The conversation can be opened again when the Contact sends a message.

### Suggested Use Cases <a href="#suggested_use_cases" id="suggested_use_cases"></a>

Here are some ways you can use the Branch Step:

* Maximise Customer Service Potential with AI Agent: The AI Agent enables businesses to engage with customers instantly by providing quick responses to low-level conversations involving basic product information (e.g., FAQ’s), policies (e.g., return policy), basic troubleshooting steps for common technical issues or errors, etc. By taking over such routine conversations, the AI Agents free up human agents for more complex conversations and tasks.

### FAQ and Troubleshooting <a href="#faq_and_troubleshooting" id="faq_and_troubleshooting"></a>

**Can my workflow have more than one AI Agents Steps?**

Yes, your workflows can include more than one **AI Agents** Steps, and each Step can have its own set of knowledge sources and other configurations that define how AI responds to the Contact.

**Is AI Agent Step available on my plan?**

Yes, this Step is available for every pricing plan on our platform.
