Answers
Generative AI
AI assistants

AI assistants

EARLY ACCESS

An artificial intelligence (AI) assistant is an AI model that performs tasks based on the training data and instructions that you specify. Example: Answer FAQs, resolve issues, offer recommendations, provide insights, and provide support.

After you create and train the AI assistant, you can use it in your chatbot.

You can create a maximum of 3 AI assistants in your account.

How AI assistants work

To use an AI assistant with your chatbot, do the following:

  1. Create and configure the AI assistant.
  2. Add training documentation, which the assistant uses to generate answers to end users' questions.
  3. Integrate the AI assistant with your chatbot by using the AI assistant element.

When the end user sends a question to your chatbot, the AI assistant does the following:

  1. Searches for the answer within the uploaded documents.

  2. Identifies paragraphs that contain the best matches.

  3. Uses the following to generate the response:

    • The end user's question.
    • The information processed from the paragraphs that contain the best matches.
    • The settings and instructions that you configure. Example: Name and purpose of the AI assistant, and constraints for the topics.
  4. Displays the response to the end user.

Chat with chatbot that uses AI assistant
Note

Although the chatbot is limited to using only the training documentation to respond to end users, it sometimes uses prior knowledge associated with the documentation to provide responses. Such answers might sometimes be incorrect.

Advantages of AI assistants

Avoid frequent updates to the chatbot

If your chatbot performs tasks that need to be updated often, you can instead use an AI assistant to perform those tasks, and integrate the assistant with your chatbot.

Example: You have a chatbot that offers FAQ support, and you need to update the FAQ data often.

  • Without AI assistant: You need to redeploy the chatbot, that is, create a copy of the chatbot, update the FAQ section, activate the new chatbot, and deactivate the old chatbot.
  • With AI assistant: You can create an AI assistant to perform the FAQ task and integrate the assistant with the chatbot. If you need to update the FAQ, you only need to upload updated documents to the AI assistant and do not need to modify the chatbot.

Use the same AI assistant with multiple chatbots

If you have multiple chatbots, you can use the same AI assistant with each chatbot.

Example: You offer FAQ support for end users through multiple chatbots.

  • Without AI assistant: You need to create an FAQ section in each chatbot.
  • With AI assistant: You can create an AI assistant to perform the FAQ support task and integrate the assistant with each chatbot.

Use the same AI assistant with multiple channels

You can use the same AI assistant with chatbots for different channels.

Example: You have chatbots for WhatsApp, Viber, and Messenger. You can use the same AI assistant with each of these chatbots.

Concepts

Token

A token is the basic unit of text that enables the AI assistant to analyze, understand, and generate responses. A token contains 2 to 4 characters, or a whole word.

Example:

Original text: Here's how you can create a chatbot.
Contains 36 characters.

Text divided into tokens: Here | 's | how | you | can | create | a | chat | bot | .
Contains 10 tokens.

Create AI assistant

  1. On the Infobip web interface (opens in a new tab), go to Answers > AI assistants.
  2. Select Create Assistant. Create assistant
  3. (Optional) Name the assistant.
  4. Configure the settings.
  5. Add training documentation.
  6. Select Save.

Add assistant name

Name the assistant to uniquely identify it  in the AI assistant element or on the AI assistants dashboard. This name is used only internally and is not shared with the end user.

Name the assistant

Configure the settings

To set up the assistant, do the following in the Assistant settings section.

Guidelines

  • Use the same language throughout the assistant. Example: Training documentation and prompts.
  • Be consistent throughout the assistant. Example: Brand name, purpose, documentation content, and prompts. Otherwise, the assistant might not provide the correct responses. The assistant does not prioritize between the prompts and the documentation.

Example: If you upload documentation for the Answers product and in the Purpose, you specify You should be a helpful chatbot for the Conversations product, the assistant sometimes says that it is for Answers and sometimes for Conversations.

Basic settings

Configure the following in the Assistant settings section.

Setup method

In the Setup method field, choose Basic settings.

Configure the basic settings

Chatbot purpose

Add the purpose of the AI assistant. The purpose helps align the AI assistant with your brand's objectives.

Complete the sentence You should be a helpful chatbot for.

Example: Infobip products and services.

Assistant name (Optional)

Add the name that the assistant uses to introduce itself to the end user. Make sure that the name is consistent with your brand.

The name helps end users recognize your brand. Also, talking to an assistant that has a name makes the communication more natural.

If you do not add a name, the AI assistant introduces itself as AI assistant.

Brand name (Optional)

Add the name of your company or your brand. Example: Infobip.

If you add a brand name, the assistant tells the end user that it represents the brand. Thus, the brand name helps establish the identity of your brand. Adding the brand name also aligns with brand consistency across your support channels.

If you do not add a brand name, the assistant does not mention the brand.

Write prompts

Specify instructions that the AI assistant uses to generate a customized response to the end user's question.

Important

Configuring prompt instructions overrides the Basic settings. However, it does not affect the Advanced settings.

Do the following in the Assistant settings section.

Setup method

In the Setup method field, choose Write prompts.

Configure prompts

Prompt template

This parameter is a replacement for the name, brand, and purpose, which are present in the basic settings.

Include the following information in the prompt template:

  • The following mandatory variables, without any changes.

    • {context_str} - Indicates the relevant information from the documents that you upload.

    • {query_str} - Indicates the question from the end user.

      Note

      The text {context_str} and {query_str} must be in English.

  • (Optional) You can also include instructions about the persona of the assistant to tell the assistant how to respond to the end user's question. Example: formal, friendly, funny, or to include emojis.

Example of simple prompt template:

This is your context:{context_str}, answer the question:{query_str} using context.

Example of detailed prompt template:

You are a helpful chatbot for Infobip's products and services. Your name is Omnia. This is your context:{context_str}, answer the question:{query_str} using context in a friendly style. Include appropriate emojis in your response.

.

Initialization settings (Optional)

Provide instructions or guidance to the AI assistant for generating the response. These instructions determine the behavior, context, and expectations of the AI model during the conversation.

System message: Provide context, instructions, and guidance that the AI assistant needs to follow to generate the response. These instructions determine the behavior of the assistant during the conversation. You could set the assistant's personality or give instructions that you want the assistant to follow.

Example:

  • You are a chatbot. Your name is Omnia\n.- Omnia, you represent Infobip. You should be a helpful chatbot for Infobip's products and services.\n- You should have a friendly conversation with users and help them with questions related to Infobip.\n- You will receive paragraphs extracted from a long documentation as a context to answer questions from users.

Advanced AI settings (Optional)

In the Assistant settings tab, select Edit Advanced settings.

Advanced settings

Configure the following:

Output tokens (Optional)

Configure the maximum number of tokens that the assistant can use in a response. The number of tokens affects the length of the assistant's response.

If you enter a low value in this field, the response is truncated. So, configure a minimum of 300 tokens.

Specifications: Minimum of 250 and a maximum of 512 tokens. The default value is 512.

Paragraph Size Limit (Optional)

The assistant divides the response into paragraphs to enable readability.

Configure the maximum number of tokens in a paragraph in the assistant's response. This determines the size of the paragraph.

Set a value of 300 for small documents and 800 for large documents.

Specifications: Minimum of 100 and a maximum of 900 tokens. The default value is 450.

Overlap Tokens (Optional)

When the assistant's response is divided into paragraphs, it is possible that the information required by the end user is present at the end of one paragraph and the beginning of the next paragraph. To avoid this issue, configure the assistant to overlap the end of one paragraph with the beginning of the next one.

Configure the number of tokens that overlap. Set a value of 20 for small documents and 40 for large documents.

Specifications: Minimum of 10 and a maximum of 900 tokens. The default value is 40.

Overlapping the content also controls repetition and enables variety in the assistant's response.

Similar paragraphs (Optional)

When an end user asks a question, the assistant searches the uploaded documents and identifies paragraphs that have the highest possibility of containing the answer. The assistant processes these paragraphs and generates a response based on the information in these paragraphs.

Configure the number of paragraphs that the assistant needs to process to generate the response.

For small documents, set a value of 1. For large documents in which the same topic is mentioned in multiple places in the document, set a value of 3.

Specifications: Minimum of 1 and a maximum of 3 paragraphs. The default value is 3.

Temperature (Optional)

Configure the level of randomness in the generated response.

A response that is generated at a lower temperature can be focused, conventional, and predictable, whereas a response that is generated at a higher temperature can be creative, random, and varied.

Set a value of 0.1 so that the assistant can generate correct responses.

Specifications: Minimum of 0 and a maximum of 2. The default value is 0.

Important

Avoid a high temperature because the assistant might give incorrect and unclear responses.

Conversation memory and content recall (Optional)

Enable this parameter if you want to save the chat history and generate responses based on this history. Using the chat history maintains continuity in the conversation.

To generate precise responses that are based on the end user's question and not based on the chat history, disable this option.

Note

There is an additional cost if you want to use this option.

Add training documentation

You need to train the AI model with data. Example: Your product documentation. The AI assistant uses this documentation to generate responses to end user queries.

You can add documentation in one of the following ways.

  • Add a link to the website that contains the documentation.
  • Upload files that contain the documentation.
Important

Follow only one option. If you add the link and upload the file, you cannot save the settings.

Add training documentation

Add a link to the documentation

Add the link to the website that contains the documentation. Example: You can add links to your product documentation or your FAQ section. The AI assistant uses the content from the link and all its pages to answer end user queries.

Guidelines for adding the link

  • Use only HTML website formats.
  • If your website uses JavaScript code or APIs to display content, the content might not be uploaded.
  • If you use links to social media sites, such as Facebook and Twitter, the content might not be uploaded.
  • The AI assistant uses content only from the link and its pages. It does not use content from other parts of your website.
    Example: 
    If you add ../../answers, the assistant does not use the content from ../../moments.
  • Use the top-level link that contains the relevant content.
    Example: You want to the assistant to use documentation for the Answers product.
    If you add https://www.infobip.com/docs (opens in a new tab), the assistant uses the documentation for all Infobip products. In this case, the assistant might not generate an accurate response.
    If you add ../../answers, the assistant uses the documentation for the Answers product.
  • The content scraping stops when one of the following limits is reached.
    • A maximum of 7 MB of content is scraped.
    • Content is scraped for 2 minutes.

Guidelines for the website content

Avoid the following:

  • The web page contains multiple topics
  • The same content is present in multiple web pages
  • Different definitions of the same concept
  • Incorrect or duplicate information
  • Information about similar products or topics on the same web page

Add the link

In the Custom content tab, select Paste website link.

Paste the link

Configure the following.

Upload the documentation

Upload the documentation as a file. The AI assistant can access only the documents that you upload to this section.

Guidelines for creating the zip file

  • You can upload documents only as a .zip file.
  • The maximum file size for the zip file is 7 MB.
  • You can upload only one zip file.
  • You can use multiple documents. But you must add all the documents to a single zip file.
  • Supported file types for the documents in the zip file are .pdf, .json, .docx, and txt.
  • You can use documents of different supported file types in the same zip file.
  • Upload all the documents as a single folder in the zip file. Do not create subfolders.
  • The order in which you add the documents to the zip file is not important.

Guidelines for the documents in the zip file

  • Use structured documentation.
  • Do not add information about multiple topics in the same document. Use different documents instead.
  • When using multiple documents in the zip file, make sure that the data is clean. Doing so helps the assistant provide more accurate responses.
    Avoid the following:
    • The same content is present in multiple places
    • Different definitions of the same concept
    • Incorrect information
    • Information about similar products in the same document
  • The content can be in any format.
    • If the assistant needs to answer a specific set questions, use a question-answer format.
  • Remove images from the documents.

Prepare the documents

If your document is not in one of the supported formats, copy or save the content to a document in the supported format.

Example: If the content is on an internal web page, copy the content to a Word document.

Create and upload the zip file

  1. Create a zip file of the documents. Refer to the Guidelines section.

  2. In the Custom contenttab, select Upload zipped file.

  3. Select Browse to find and upload the zip file.

    Upload help documents to the AI assistant
    Note

    If you update the Assistant settings, you might need to upload the training documentation again.

Edit the settings

You can update the configuration of the AI assistant at any point, even after you activate your chatbot.

You can edit the configuration through the following options:

  • From the AI assistant configuration page
  • From the AI assistant element

Edit from the AI assistant configuration page

  1. On the Infobip web interface (opens in a new tab), go to Answers > AI assistants.
  2. Select Edit. Edit AI assistant configuration from the Configuration section
  3. In the Assistant settings and Data sources tabs, update the configuration.
  4. Select Save.

Edit from the AI assistant element

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots.
  2. In the chatbot that contains the AI assistant element, go to the element.
  3. Select Edit configuration. Edit configuration from AI Assistant element
  4. In the configuration page, select Edit. Edit AI assistant configuration from the Configuration section
  5. In the Assistant settings and Data sources tabs, update the configuration.
  6. Select Save.

Edit training documentation

If you want to add new or updated documentation in the assistant, you must retrain the assistant. You must upload the complete documentation and not only the changes.

You can retrain the assistant with in one of the following ways.

You do not necessarily need to use the same training method that you used earlier.

AI assistant element

To add an AI assistant to your chatbot, you must use the AI assistant element. In this element, you can select the AI assistant that you want to use in the chatbot.

You can select only 1 AI assistant in the element. Also, you can add only 1 AI assistant element to a dialog.

To add more than 1 AI assistant to your chatbot, do the following:

  1. Create a separate dialog for each AI assistant that you want to add to the chatbot.
  2. In each of these dialogs, add an AI assistant element.
  3. In each AI assistant element, select an AI assistant.

The interaction between the end user and the AI assistant takes place within the AI assistant element.

You can configure your chatbot to use the AI assistant in the following ways:

  • AI assistant is the first point of entry: The AI assistant performs the primary function of the chatbot.
    Example: An FAQ chatbot that uses the AI assistant to answer all questions from the end user.
    In this case, the AI assistant is the first point of entry to the chatbot. The main dialog contains the AI assistant element.
  • AI assistant is not the first point of entry: The AI assistant is part of a chatbot that performs other functions.
    Example: A chatbot that books tickets as well as answers questions about booking tickets.
    In this case, the AI assistant is not the first point of entry to the chatbot. The chatbot contains multiple dialogs for various functions. It might contain a dialog to book tickets and another dialog to answer questions about the booking. The dialog that answers questions contains the AI assistant element. The conversation is routed to this dialog through a menu.

Add the AI assistant element to the chatbot

Depending on whether the AI assistant is the first point of entry to the chatbot, follow the relevant instructions to add the AI assistant element.

AI assistant is the first point of entry

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots.
  2. Go to the required chatbot.
  3. In the main dialog, drag the AI assistant element from Chatbot actions.
  4. Configure the element.

AI assistant is not the first point of entry

  1. On the Infobip web interface (opens in a new tab), go to Answers > Chatbots.
  2. Go to the required chatbot.
  3. In the Attributes tab, create a standard attribute of type Text to store the end user's question. Example: user_question. Create attribute to capture end user's query
  4. In your menu, redirect the conversation to the dialog that uses the AI assistant element. The following example uses a combination of Attribute and Conditions elements. Alternatively, you can use the Keyword element. Route to the dialog that contains the AI Assistant element
  5. In the relevant dialog, use the Attribute element to ask the end user to send their question and to save the question. Use the attribute that you created to store the end user's question. Example: user_question. Add an attribute to capture the end user's query
  6. Drag the AI assistant element from Chatbot actions. Add the AI Assistant element
  7. Configure the element.

Configure the AI assistant element

Configure the AI assistant element as follows:

Select AI assistant

You can add only one AI assistant to the AI assistant element.

Do one of the following:

  • Select an existing assistant from the list.
  • To create a new assistant, select Create AI assistant. The AI assistants section opens. Create the AI assistant and then return to the AI assistant element.
Select the assistant

Send text with AI assistant response

Configure the message that the assistant sends with its responses. Use this message to provide guidance to end users about the next steps or to perform an action.

Example: Type MENU at any point to return to the products menu.

Send user request from attribute

Select the attribute in which the end user’s question is stored. This attribute is the initial message that is sent by the chatbot to the AI assistant service.

  • If the AI assistant is the first point of entry to the chatbot: Select the lastReceivedTextMessage fixed attribute.
  • In other cases: Select the attribute that you created to store the end user's question. Example: user_question

Exit the AI assistant (Optional)

When an end user enters the AI assistant element, all the interaction between the end user and the AI assistant takes place within the element. This interaction forms a loop.

You can configure one or more of the following options to enable the end user to exit the loop and go to other parts of the chatbot.

  • Use exit keywords.
  • Limit the number of messages exchanged.

Use exit keywords

Configure keywords to enable end users to exit the AI assistant flow. Example: Stop, exit. When an end user sends one of these keywords in the chat, the AI assistant flow exits. Depending on the dialog flow, the end user is directed to the relevant dialog.

  1. Select Add exit keyword to add keywords that the end user can enter to exit the loop. Example: Menu, Agent. If you use the same exit keyword as an escape phrase, the exit keyword action takes precedence. Add exit keyword You can create the keywords either in the Keywords tab or through the AI assistant element. Create exit keywords
  2. Add actions for each keyword. When the end user enters an exit keyword, the chatbot takes the relevant action. Add actions for each exit keyword
  3. (Optional) Add a message to share the exit keywords with the end user. Example: At any point, type Menu to go to the main menu. You can add a maximum of 5 variations of the message.

This message is shown with each response from the AI assistant.

To add the message, do the following.

  1. Select Add variation.

    Add a message to share the exit keywords with end users
  2. Enter the message. It can contain a maximum of 4,096 characters, including attributes, new line, spaces, special characters, and emojis.

    Enter the message

    You can test the exit keywords in the simulator.

    Test exit keywords in the simulator

Limit the number of messages exchanged

The AI assistant element exits the loop after it sends a predefined number of responses to the end user.

  1. Choose either No limit or a predefined number from 1 to 10. Set the maximum number of messages sent by the assistant
  2. Add the action that the chatbot needs to take when the limit is reached. Example: Go to a different dialog or go to an agent. In this example, when the AI assistant element sends 3 responses to the end user, the conversation is routed to the Menu dialog. Set the actions

Fallback

The fallback action is triggered if the AI assistant service is not responding. You can either redirect the end user to a different dialog or transfer the conversation to an agent.

Configure the following:

  • Fallback action: Choose either Go to dialog or Connect to agent.
  • Dialog: If the Fallback action is Go to dialog, choose the dialog to which you want to redirect the end user. Example: Main menu. To avoid a loop, do not choose the dialog that contains the AI assistant element.
  • Fallback message (Optional): Enter a message to send to the end user. The message can contain a maximum of 4,096 characters, including attributes, new line, spaces, special characters, and emojis. You can add a maximum of 5 variations of the message.
Set fallback options

Need assistance

Explore Infobip tutorials

Encountering issues

Contact our support

What's new? Check out

Release notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Service Terms & ConditionsPrivacy policyTerms of use