AI hub
AI assistant
Use an AI assistant in your chatbot

Use an AI assistant in your chatbot

To use an AI assistant in your chatbot, add the AI assistant element.

The process is as follows:

  1. In your chatbot, capture the end user's message in an attribute.
  2. Add the AI assistant element and configure it. In the AI assistant element, pass the attribute as an input to the AI assistant.
  3. The assistant generates a response based on the input, the assistant configuration, and the documentation uploaded to the assistant.
  4. In the AI assistant element, get the assistant's response and save it in another attribute.
  5. Share the response with the end user.

Save end user's message in an attribute

To save the message, follow one of these options:

  • Use the predefined attribute lastReceivedTextMessage, which captures the last message sent by the end user.
  • Save the end user's response in a standard attribute by using the Save user response element.
Save the end user's message in an attribute

Add the AI assistant element to your chatbot

Use the AI assistant element to add an AI assistant to your chatbot.

Add AI assistant element

Guidelines

  • You can select only 1 AI assistant in the element.
  • You can add only 1 AI assistant element to a dialog.
  • You can have more than 1 AI assistant in your chatbot.

Configure the AI assistant element

Configure the AI assistant element as follows:

Configure the basic fields

  1. Select an existing assistant from the list.

    Configure AI assistant element
  2. In the User Message field, select the attribute in which the end user’s message is stored. The chatbot sends this attribute value to the AI assistant service.

Configure additional options

  • External content source: If you set this source, the AI assistant ignores data that is defined in its main content source, and uses the external content source instead.

  • Memory key: Use the memory key to share memory between assistants and other GenAI components that have the same key.

  • Return contexts: If you set this field to True, the assistant returns the parts of the documentation that were used to generate the response.

  • Prompt variable: This field is used if the Prompt template section in the selected AI assistant contains {prompt_var}. The value from the Prompt variable field is passed to {prompt_var}. This helps you personalize chats or give context to the AI assistant.

    Example: In the Prompt variable field, add _Refer to the end user as {{name}}.

Save the assistant's response

The AI assistant returns an answer to the user question in a JSON schema:

{
    "response": "Assistant's response"
}

Extract the response and save it by using Response body attributes. To extract the response text, select the attribute in which you want to save the response and define the JSON path.

Example: $.response.

Save the response from the AI assistant element

You can use the JSON response and the extracted value for further processing, or return the value to the end user.

Add 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.

For more information, refer to the Add fallback documentation in Answers.

Send the response to the end user

To return the assistant's response, use a Text element and add the attribute in which you saved the assistant's response.

Share the response from the AI assistant element with the end user

Create conversational AI chatbots

To configure a more advanced AI assistant experience, use Infobip's other Generative AI tools.

Example:

After the assistant answers the end user's question, send the response in a Text element.

Share the response in a Text element

Then, in another dialog, ask the end user for a new user input. Use the GenAI Intent detection element to determine where to route the conversation. In the target dialog, you can define a way to route the conversation back to the AI assistant, resulting in a conversational AI experience.

Use the GenAI intent detection element

Need assistance

Explore Infobip Tutorials

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary
Service status

Copyright @ 2006-2025 Infobip ltd.

Service Terms & ConditionsPrivacy policyTerms of use