Skip to main content

Add an AI chatbot

You can add an AI chatbot to your application for your users to interact with. Users can use the chatbot to provide general assistance (such as summarizing the contents of files or editing the user's notes), access data from your application, and perform activities (either autonomously or with review by a user). Each user's chat history persists across sessions (unless they reset the chat) so they can continue their conversation and refer back to earlier messages each time they log in to your application.

To create a chatbot, first configure an AI agent. You can grant the AI agent permission to perform activities, view datasets, access other cases, and search the internet. Then, add an AI conversation widget to the view of a page casetype, as described below. You can also embed the chatbot in a navigation sidebar so that the chatbot remains available to the user as they navigate around the application.

Tip:

You do not need to perform an agent activity to create a chatbot. An agent activity is only required when you want to use an AI agent in relation to a particular case, such as advising on a support ticket or handling a complaint.

Add a chatbot to a page

You can add a chatbot to an existing page casetype or create a dedicated page for this purpose. When deciding where to locate the chatbot, consider how you want users to access it and any activities you want the chatbot to be able to perform. For more information about creating pages, see Display content to users.

Open the view of the page casetype and add the AI conversation widget to it. From the widget properties pane:

  • Use the Agent picklist to select the AI agent you want to use to power the chatbot.
  • Use the First message field to specify any input that you want to send to the AI agent before a user starts interacting with the chatbot.
  • Use the Chat title field to display a heading at the top of the chat pane.
  • Leave the Agent conversation field blank.
  • To give users the option to upload files so that the chatbot can view the contents, enable Allow file uploads. Files are stored on the conversation case and remain available to the chatbot throughout the conversation.
  • From the Rights picklist select the user roles that can see the chatbot.

By default, the chatbot is able to perform activities (for which it has rights) on the page. If you want the chatbot to be able to perform activities on other casetypes, allow the agent to switch contexts to other cases and grant it permission to access datasets containing the relevant cases. For more information, see Use AI agents to perform activities.

You can use the AI conversation widget properties to further configure the activities that are available and whether the AI agent can perform them autonomously:

  • Use the Execution type options to specify whether users must always review the activity before submitting (User rights - always show form), or whether the agent can submit the activity without further input from the user (User rights - Auto-submit). To use the rights granted to the agent, select Agent rights.
  • To limit the activities on the current page that the chatbot can perform:
    1. Enable Custom activities enabled.
    2. Select one or more activities from the Custom activities picklist.
    3. Enable either Include to restrict the chatbot to performing only the selected activities, or Exclude to allow the chatbot to perform all activities other than those you have selected.

For more information about the widget properties, see the AI conversation widget reference.

Add a chatbot to a navigation sidebar

You can also embed a chatbot widget in a navigation sidebar. This is useful if you want to allow users to continue a conversation with the chatbot as they navigate around your application.

To embed a chatbot in a sidebar, first add an AI widget to the view of a page casetype, as described above. You may want to create a dedicated page casetype for this purpose. Then use the html.subwidget template function to embed the AI widget in a sidebar menu item as follows:

  1. From the Navigations page in your Studio, either select an existing navigation sidebar or create a new one.
  2. Add a new menu item for the chatbot and set the Type to HTML.
  3. In the Text field, enter html. and select Subwidget.
  4. Click the html.subwidget template function to configure the details:
    1. From the Tag picklist, select div.
    2. From the Widget picklist, select the AI conversation widget that you created for this purpose.
    3. In the Caseid field, use the page. template function to identify the page containing the widget.
    4. From the Load picklist, select Directly to load the widget when the page is loaded. Alternatively, to require users to click another element to load the chatbot, select After click and specify the CSS ID of the clickable element (prefaced by #). This could be an element on the same navigation bar, a different navigation bar, or elsewhere on the page.
    5. Configure any other HTML attributes as required. When you have finished, click Submit to return to the menu item settings.
  5. Optionally wrap the html.subwidget template function in additional HTML. For example, you may want to apply one or more CSS classes to control the appearance of the chatbot.
  6. When you have finished, click Submit to create the chatbot menu item.
  7. Grant rights to view the chatbot menu item to the relevant user roles.

Once you have configured the sidebar, enable it on one or more casetype views. For more information about configuring navigation bars, see Add a navigation bar to your application.

Tip:

Only users in roles with rights to view the widget and the navigation menu item can see a chatbot widget embedded in a sidebar.

Test the chatbot

You can test the chatbot from your Development environment. You many need to tweak the prompts in the agent settings to achieve the behavior you want. Keep in mind that AI models are designed to learn from experience, so the chatbot's behavior will evolve over time.

To start a new chat, click Reset at the top of the AI conversation widget. The current AI conversation case is closed and a new conversation is started. This is useful when testing different prompts.

To view the all active chatbot conversations, open Developer Tools and navigate to Platform > AI Conversations. To view closed AI conversation cases, use Platform > All cases and ensure closed cases are displayed.