AI Agents
Knowledge Agents
Use in a chatbot

Use a knowledge agent in a chatbot

EARLY ACCESS

Add a knowledge agent to your chatbot using the Agent connector element in the chatbot editor.

The agent handles end user questions by retrieving answers from connected knowledge sources.


Before you begin


How it works

  1. The chatbot captures the end user's message in an attribute.
  2. The Agent connector element passes the message to the knowledge agent.
  3. The knowledge agent generates a response based on the message, agent configuration, and connected knowledge sources.
  4. The chatbot receives the response and sends it to the end user.

Save the end user's message

Before the Agent connector element can process a question, the chatbot needs to capture the end user's message in an attribute. Use one of the following options:

  • Use the predefined attribute lastReceivedTextMessage, which captures the last message sent by the end user.
  • Use the Save user response element to save the message in a standard attribute.

Add the Agent connector element

Add the Agent connector element to a dialog in your chatbot. You can select only one knowledge agent per element, but you can add multiple Agent connector elements across dialogs.

  1. Select an existing knowledge agent from the list.
  2. In the User Message field, select the attribute that contains the end user's message. The chatbot passes this attribute value to the knowledge agent.
  3. (Optional) Configure additional options:
    • External content source - Overrides the main agent knowledge sources. When set, the agent uses this source instead.
    • Memory key - Share conversation memory between the knowledge agent and other GenAI components that use the same key.
    • Return contexts - When set to True, the agent returns the parts of the knowledge sources that were used to generate the response.
    • Prompt variable - Passes a value to the {prompt_var} variable in the agent prompt template. Use this to personalize responses or provide additional context.

Save the response

The knowledge agent returns the response in a JSON schema:

{
    "response": "Agent's response"
}

Use Response body attributes to extract the response. Select the attribute where you want to save the response and define the JSON path: $.response.

Add a fallback

The fallback action triggers if the knowledge agent service is not responding. You can redirect the end user to a different dialog or transfer the conversation to an agent in Inbox.


Send the response to the end user

Use a Text element and add the attribute where you saved the knowledge agent response.


Create a conversational experience

To create a more advanced conversational flow, route the conversation back to the knowledge agent after each response:

  1. After the knowledge agent responds, send the response in a Text element.
  2. In a follow-up dialog, capture a new user input.
  3. Use the GenAI Intent Detection element to determine where to route the conversation.
  4. Route the conversation back to the dialog with the Agent connector element for a continuous, conversational experience.






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-2026 Infobip ltd.

Service Terms & ConditionsPrivacy policyTerms of use