AI Assistant
The ITSM application has the AI Assistant implemented as part of the user support.
Users interact with the AI Assistant via the Chat with AI Assistant widget on the Self-Service Portal. It opens by clicking AI Assistant on the main portal page, as well as the Ask AI Assistant on the search results page.
The widget depends on the integration with the Ainergy application. For the AI Assistant to function, you need to configure it first. The AI Assistant can be switched off using the itsm.ai_chat_widget.is_enabled system property.
On the Self-Service Portal, users can access their own chats only. In the agent interface, admins can view all user chats and tickets originating from them.
The AI Assistant communicates in the language the user addresses it in. However, the language of its system messages may differ. If the dialog's language is missing from the Language (sys_language) table, the system messages are shown in the language the user has selected in their General preferences.
Find answers and generate tickets
When a user first sends a message to the chat, the AI Assistant performs a search among the configured record collections, provided that in their message, the user requests information, describes a problem, or tries to find a service request in the catalog.
Based on the search results and the message context, the AI Assistant determines whether the user's message is a service request, an incident, or a user query.
Determining the set of possible categories based on table collections
Having found any suitable records in the corresponding collections, the AI Assistant forms a set of possible categories that could define the message. A definitive category is then determined based on the message content and the category set.
| Category | Collection |
|---|---|
| Service request | The Request Model (sys_rmc_model) table collection set in the itsm.ai_chat_widget.request_model_base system property. |
| Incident | At least one of the following table collections: Known Error (itsm_known_error), Article (article), or Service Announcement (announcement). These collections are set in the itsm.ai_chat_widget.known_error_base, itsm.ai_chat_widget.article_base, and itsm.ai_chat_widget.announcement_base system properties respectively. |
| User query | At least one of the following table collections: Article (article) or Service Announcement (announcement). These collections are set in the itsm.ai_chat_widget.article_base and itsm.ai_chat_widget.announcement_base system properties respectively. |
The AI Assistant then answers the user's question based on its category:
- If the user's message was categorized as a user query or incident, the AI Assistant provides a short summary of the information it found together with references to its sources. If the user replies that this did not solve their issue, the AI Assistant offers to create a ticket of the current or other category it assigned to the message.
- If the user's message was categorized as a service request, the AI Assistant lists the service requests it found in the Service Catalog and offers to fill out the suitable one.
If the AI Assistant cannot find any relevant information, it offers to create a user query or incident depending on the message category. The user can also ask the AI Assistant to create a service request, incident, or query to the service desk.
To fill out the ticket form, in addition to the chat context, the AI Assistant asks questions to find out the following details: Urgency, the mandatory request model attributes except for referential attributes and attributes related to Urgency (for service requests), Steps to reproduce (for incidents), and other additional information for the Description (in the case of incidents and user queries). The user is also prompted to call the service desk at the number specified in the itsm.notification.contact.phone system property in case their issue is urgent. Once ready, the AI Assistant sends a link to the prefilled form.
If the user then sends this ticket, the chat closes. The chat also closes if the user says that their issue was resolved, or if the chat was not used over a configurable number of days. Once the chat closes, it can no longer be used for asking questions. To ask more questions or create another ticket, the user needs to open a new chat.
View chats and tickets
Role required: admin (reading only).
AI Assistant Chat table
You can view all user chats with the AI Assistant in the AI Assistant Chat (itsm_ai_chat) table. To do so, navigate to AI Assistant Chats → All Chats.
A record is created in the table when a user sends the first message to a new chat on the Self-Service Portal. At the same time, a record is created in the Ainergy AI Conversation (ain_ai_conversation) table containing the AI Assistant's responses to the user's messages in this chat.
AI Assistant Chat form fields
| Field | Mandatory | Description |
|---|---|---|
| Active | N | If the checkbox is selected, the chat is open for questions. Once the number of days specified in the itsm.ai_chat_widget.days_count_to_close system property passes, an event is created that clears this checkbox, closing the chat. The chat is also deactivated if a ticket is created on its basis. |
| Hide from portal | N | If the checkbox is selected, the chat is not displayed on the portal. |
| Chat ID | Y | The chat ID displays the date and time of its creation. It serves as a reference to the chat instance in the AI Conversation (ain_ai_conversation) table. |
| Subject | Y | A short description of the chat generated by the AI Assistant based on the user's initial question. |
| User | Y | A reference to the User (user) table record of the user who created the chat. |
AI Chat Tickets table
The AI Chat Tickets (m2m_ain_ai_message_itsm_task) M2M table displays the tickets created via the Chat with AI Assistant. It links the ITSM Task (itsm_task) table with the AI Message (ain_ai_message) Ainergy table.
Tickets created via the Chat with AI Assistant are stored in the User Query (itsm_inquiry), Service Request (itsm_request), and Incident (itsm_incident) tables.
AI Chat Tickets form fields
| Field | Mandatory | Description |
|---|---|---|
| AI Message | Y | A reference to the AI Message (ain_ai_message) table record within the framework of which the ticket was created. |
| Ticket | Y | A reference to the created record in the User Query (itsm_inquiry), Service Request (itsm_request), or Incident (itsm_incident) table. |
Configure AI Assistant
Role required: admin.
To ensure the AI Assistant works, complete the following steps:
- Install the Ainergy application package and the [ITSM]_ITSM_2_0_0_AINERGY_1_14_0.sop ITSM-Ainergy connector package.
- Configure the vector database.
You can manage the AI Assistant using the system properties.
Vector database
For the AI Assistant to function, you need to configure a vector database. To do so:
- Deploy the vector database by following these Ainergy instructions (in Russian).
- Create vector collections for articles, announcements, request models, and known errors.
To create the vector collections, complete the following steps:
-
Navigate to Vector Database → Vector Collection Definition.
-
In the upper-left corner, click New.
-
Fill out the form fields as follows:
-
Specify any Title for the collection.
-
In the Name field, specify the value of the system property corresponding to the collection – itsm.ai_chat_widget.article_base for articles, itsm.ai_chat_widget.announcement_base for announcements, itsm.ai_chat_widget.request_model_base for request models, or itsm.ai_chat_widget.known_error_base for known errors.
-
In the Table field, specify the table corresponding to the collection – Article (article), Service Announcement (announcement), Request Model (sys_rmc_model), or Known Error (itsm_known_error).
-
In the Template field, add the script corresponding to the collection. For convenience, it already contains the logic for forming templates.
Script for articles, request models, and known errorsss.importIncludeScript('getVectorCollectionDefinitionScript');
(() => {
return getVectorCollectionDefinitionScript(current);
})()Script for announcements(() => {
const announcementLocalization = getAnnouncementLocalization(current);
return [
announcementLocalization.subject,
stripHtml(announcementLocalization.announcement_body)
].filter(Boolean).join(' ').trim();
})()
function stripHtml(html) {
if (!html) {
return '';
}
return html
.replace(/<[^>]*>/g, ' ')
.replace(/\s+([.,;:!?])/g, '$1')
.replace(/\s+/g, ' ')
.trim();
}
function getAnnouncementLocalization(current) {
const announcementLocalization = new SimpleRecord('announcement_localization');
announcementLocalization.addQuery('announcement_id', current.sys_id);
announcementLocalization.setLimit(1);
announcementLocalization.selectAttributes(['announcement_body', 'subject']);
announcementLocalization.query();
announcementLocalization.next();
return announcementLocalization || {};
} -
When creating collections for articles and known errors, it is recommended to limit user access to internal information. To do this, add the following condition in the Filter condition field: KB Category / Object Category is External. When adding the field for the condition, select Object Category via dot-walking by clicking the icon next to the KB Category option.
noteNote that the default Known Error category is internal, but you can create external categories and specify them in the known errors you want to display on the portal per the above-mentioned configuration.
-
-
Click Save to create the collection record.
-
Click Save and load data to load the collection records.
-
Click Into operation to make the collection operable.
Repeat these steps for each collection.
System properties
You can manage the Chat with AI Assistant using the following system properties:
- The Chat with AI Assistant widget display on the portal is determined by the itsm.ai_chat_widget.is_enabled system property. By default, the property is set to true, as a result of which the widget is enabled and opens when clicking the AI Assistant navigation card. If you need to remove the AI Assistant from the portal, change the property value to false. In this case, the portal will display the Ask a question navigation card leading to the standard user query creation form.
- The Ask AI Assistant button display on the search results page is determined by whether the Active checkbox is selected for the Ask AI Assistant widget ({your instance URL/record/sys_widget/177011352215968005}). By default, the widget is active. Clear the checkbox if you need to remove the ability to proceed to the Chat with AI Assistant from the portal search results page.
- The Article (article), Service Announcement (announcement), Request Model (sys_rmc_model), and Known Error (itsm_known_error) table collections the AI Assistant uses to form its replies are determined by the itsm.ai_chat_widget.article_base, itsm.ai_chat_widget.announcement_base, itsm.ai_chat_widget.request_model_base, and itsm.ai_chat_widget.known_error_base system properties.
- The maximum number of relevant articles, announcements, service requests, and known errors the AI Assistant can refer to when forming its replies are determined by the itsm.ai_chat_widget.article_max_number, itsm.ai_chat_widget.announcement_max_number, itsm.ai_chat_widget.request_model_max_number, and itsm.ai_chat_widget.known_error_max_number system properties.
- The number of days after which an unused AI Assistant chat automatically closes is determined by the itsm.ai_chat_widget.days_count_to_close system property.