Cloud
Studio Interface
Agents

Agents

Studio Agents

Botpress offers a variety of specialized Agents to enhance your chatbot's capabilities and adaptability. These Agents are designed to perform specific tasks, each contributing to the overall performance of your chatbot. Here, we introduce four of our agents: Summary, Personality, Knowledge, and Translator Agents.

Summary Agent

The Summary Agent is designed to condense lengthy user responses or extensive text into a brief, digestible summary. This feature is crucial in ensuring that the main ideas are quickly understood, thus making interactions with your bot more efficient.

Input Parameters

  • Summary Max Tokens: This defines the maximum length of the generated summary in tokens. A token can be a word or a punctuation mark. This parameter allows you to set a limit on how lengthy your summaries can be, ensuring they remain concise and manageable.

Output Parameters

  • conversation.SummaryAgent.summary: This is the generated summary of the conversation thus far. It's important to note that this parameter is only available after each conversation turn.

Usage

Upon enabling the Summary Agent, the conversation summary becomes accessible through the {{conversation.SummaryAgent.summary}} variable. This variable can be incorporated in any place where user code is permitted. This includes Hooks, workflow Executed Code cards, AI Task cards, and Transition cards.

For example, if you wish to include a conversation summary in a chatbot prompt, you could write:

'Your conversation summary: {{conversation.SummaryAgent.summary}}'

This would then output a brief summary of the conversation so far.

Conflicts

There are no known conflicts with the Summary Agent and other Botpress functionalities or agents. However, please remember that the output from the Summary Agent (conversation.SummaryAgent.summary) is updated after each conversation turn. Therefore, ensure that you use it in context and check the summary only when it is updated.

Translator Agent

Languages

The Translator Agent allows your chatbot to interact with users in different languages, breaking language barriers and expanding the range of your bot's audience.

Configuration

  • Automatically Detect User Language - When enabled, the Translator Agent will automatically detect the user's language from their input.

Activating this feature consequently sets the {{user.TranslatorAgent.language}} variable when it's not already defined.

Exposed Variables

  • user.TranslatorAgent.language: This variable represents the detected language of the user.

Example - setting language to french

  1. Open the Toolbox Cards and drag the Set User Language Card into your first node(ideally).
  2. Specify a language. In this case, we will use fr for French.

The Translator Agent automatically translates the chatbot's responses into the user's language once activated. If you wish to define the user's language manually, you can directly set the {{user.TranslatorAgent.language}} variable.

This variable is set to null by default, which means that the Translator Agent will automatically detect the user's language from their input.

Resetting the language

Drag the Reset User Language Card into your flow. This will reset the {{user.TranslatorAgent.language}} variable to null.

You can do this in Execute Code card as well:

//use null to reset the language, otherwise set it to a language code
{{user.TranslatorAgent.language}} = null;

Note
It's currently not possible to build a chatbot that can speak multiple languages at the same time, i.e. switching between Spanish, English & French within the same flow.

Conflicts

It is important to note that the Translator Agent may conflict with the Personality Agent. The Personality Agent is designed to manipulate chatbot responses according to pre-set personalities and could overwrite the translations done by the Translator Agent. If both the Translator Agent and the Personality Agent are enabled, the Personality Agent will take priority. If you want the Translator Agent to take effect, you may need to adjust the settings of the Personality Agent or turn it off.

Personality Agent

The Personality Agent enables you to provide your chatbot with a unique personality. It tailors the bot's behavior and responses according to the defined personality traits, providing a more engaging and human-like interaction for the users. Learn more at Chatbot Personality.

Activate Personality Rewriting

To activate the Personality Agent, you need to enable the Personality Rewriting option of the agent.

Personality Description

This is where you define the personality of your chatbot. You should describe how your chatbot is meant to behave and what it is meant to do. Including specific personality traits will influence the bot's responses. For example, if you describe the bot as a "funny cowboy that likes to add emojis to some of your messages and often refers to the user as 'my friend'", the bot will mimic this behavior in its responses.

The Personality Agent, once enabled, will automatically rewrite all the messages sent by your bot to align with the described personality. For instance, if your bot is described as having a humorous and friendly personality, its responses may contain light-hearted quips or friendly salutations such as "Hello, my friend!"

For example, if you want your bot to behave like a professional consultant, you might add this text or something similar to the Personality Description:

You are a professional consultant who always uses formal language.
You avoid slang and emojis and always address the user respectfully.
💡

Enabling this Agent may add some latency to your bot's responses as it takes time to process and rewrite the messages according to the defined personality traits.

You can disable the Personality Agent in specific nodes by disabling the Personality Rewriting option in the node's settings. This will make all the messages contained in Text or Capture cards to be sent as-is, without any rewriting.

Conflicts

Be aware that the Personality Agent might conflict with the Translator Agent. If both are enabled, the Personality Agent has higher priority and may overwrite the translations done by the Translator Agent. Thus, if you want to ensure the effectiveness of translations, you should adjust the settings of the Personality Agent or turn it off.

Knowledge Agent

This agent will make your chatbot answer questions from Knowledge Bases.

It will look for questions in the user's message and try to find an answer in the context Knowledge Bases.

The Knowledge Bases that are searched are the ones that are in the same folder as the current workflow, or in the parent folders.

The agent will only answer when the user asks a question and the chatbot is either on the Start Node or when the workflow is on a Capture Card inside a node that has Knowledge Bases enabled.

To enable Knowledge Bases on a node, click on the node in the workflow editor and then enable the Knowledge Bases option in the right inspector panel.

Configuration

  • Answer on Start Node: When enabled, the chatbot will answer questions on the Start Node.
  • Answer Manually: Your chatbot will not answer automatically. When this option is enabled, you need to manually reply to the user with {{turn.KnowledgeAgent.answer}}. This can be done with a Say node, on a Capture Card or with a Hook (advanced).
  • Context: Providing context helps knowledge bases give better answers. We recommend including the transcript of the conversation and/or the summary of the conversation provided by the Summary Agent. You can also include any other information that you think might be relevant to the KB.

Exposed Variables

  • turn.KnowledgeAgent.answer: This variable represents the answer from the Knowledge Base. It is set to null if no answer is found.
  • turn.KnowledgeAgent.responded: This variable is set to true if the Knowledge Agent has answered the user's question automatically. It is set to false otherwise if manual answering is enabled.
  • turn.KnowledgeAgent.citations: This variable represents the citations from the Knowledge Base. It is set to null if no citations are found.