Updated: 12/6/2024

How to use the AI ​​Agent in Mailbots?


In this article, you will learn how to use the “AI Agent” block in Mailbots.


The AI ​​Agent creates generative bots, using predefined templates and designing flows in a simple way. This makes it easier to create more efficient experiences for users. With the AI ​​Agent, it is not necessary to create an email block for each interaction, as it will interact with the user through emails until it achieves its goal.



Inside the AI Agent block, there is space to write the instruction (prompt) for Generative Artificial Intelligence.

It is not necessary to specify "Write an email" or "The initial greeting goes above", as the AI Agent in Mailbots, by default, writes the message in email format.






Compartilhamos algumas dicas para que a instrução (prompt) seja adequada ao cumprimento do objetivo.

  • Explique ao bot seu objetivo final. Por exemplo: “Anote o pedido do usuário”.
  • Liste as etapas para atingir esse objetivo.
  • Forneça muitos detalhes ao explicar.
  • Evite contradições ou ambigüidades.
  • Forneça exemplos de respostas corretas ou incorretas.
  • Teste seu bot e faça as correções para alcançar o resultado desejado.


We share some tips to ensure that the prompt is appropriate to meet the objective.

  • Explain to the bot its ultimate goal. For example: “Take the user’s order.”
  • List the steps to achieve that goal.
  • Provide plenty of detail when explaining.
  • Avoid contradictions or ambiguities.
  • Provide examples of correct and incorrect answers.
  • Test your bot and make corrections to achieve the desired result.


How to add variables, actions, content bases and code actions?


To add these elements, you just need to insert the “$” symbol in the instruction block, as shown in the image below


The AI ​​agent can interact with the following elements:


  • Variables: the agent can access user information stored in variables and use them to accomplish its objective. Also, the agent can capture data from user messages and save it in variables if requested in the instructions.
  • Actions: the agent has a list of actions that it can use to accomplish its objective. In the future, more actions will be added to further enhance the agent.
  • Content databases: the agent can consult content databases to accomplish its objective, searching for information or validating data in them. To learn more about content databases, you can read more in this article.
  • Code actions: the agent can invoke code actions as part of its objectives. At the moment, it cannot recognize the parameters and returns of the same, but it will be able to do so in a future update.


It is important to note that the AI Agent in Mailbots will continue sending emails in the thread until it reaches the goal specified in the instruction (prompt) block.