Creating an Agent is made of back and forth iterations between the Agent itself and the functions that are attached to that Agent. These iterations are fueled by:
In this article, we will describe the different parameters that are present in the Agent configuration page. For a quick overview of how to create an Agent from scratch and attach it a first function, we suggest you start with one of the tutorials.
The first thing you want to do when using Squadra is creating a new Agent, going to Agents\\+New
. Name your agent.
Here are the main parameters:
Once these are set, you can already converse with your agent: it will appear in the Agents list on the left, as well as in Agents > Playground
.
Go to Agents > Playground
to start conversing with your agent, and see how it reacts to messages, whether it queries the right functions, etc. You can start as soon as you have defined a new Agent and its prompt !
Below is an example conversation with an Agent (the full tutorial for this Agent can be found as the first tutorial in this documentation):
You can see after the User question, and before answering:
If you click the JSON
button, either for the Function call or the Function response, you can decompose the content of these calls and responses.
These are explained in more details in the Functions section.
Functions are independent from Agents. They can be attached to several agents, or even triggered independently. See Section Functions for more details about functions.
Agents use functions in 2 distinct ways:
Empower your Agent with Function calling
Once you have configured functions, attach them to the Agent to make sure the agent can call these functions.
Function Hooks
Go fo Agents, then add step at the bottom to create a new hook.
Here is an example for a function hook. This hook is configured to get external user information (such as their latest social media posts) each type the user sends a message, and convey the information to the agent.
Here is an explanation of the parameters:
Hook type: “Before a user message” means that each time a user sends a message, before this message is conveyed to the agent, the hook will be activated so that the “hooked” function is called, so that the agent has at its disposal in the context the information form the function before it starts answering the user. Other types are “before the first user message”, which means the hook will be triggered at the very beginning of the conversation, and “After an agent message”, which means the Agent calls a function only after it has replied to the user (which would make sense combined with a trigger, when the agent sends messages autonomously – see below).
Inputs: if the function called by the hook requires an input (see the page Functions for more details), this is where you can fill it. For Example, if your function getUser needs the string userID
as an input, and that userID is actually the user email, available in the context of the agent (see section Context below for an explanation of variables available in the context), you will write this kind of json object:
{
"userID": user.email
}
Results action: these are the various ways in which the function results can be injected for the Agent to use.
Merge results in context (temporarily)
means that the function results will be injected for the agent in the context of the conversation, as any other message from the agent or the user, so in the long run it might be diluted in the general context.
Merge results in context (permanently)
means that this result will be logged in the Context database; see section Context below for more explanations.
Report conversation based on the results
might be used to create supervision reports for the admin to review the conversation. If the function renders non-null result, a report is generated that flags the problematic conversations to the admin, which can be seen in the conversations explorer in the module Monitoring > Conversations.
Context of an agent: The context of an agent is a data structure that may be accessed in the prompts or functions of this agent (via template or data transformation syntax). The context is constructed from various sources:
date
, time
, datetime
, user
(and anonUser
, if any)To use this context, you can summon context from various sources via curly brackets {{object}}
. Here is an example Agent prompt using various variables from the context:
You are a helpful assistant.
Current date is {{date}}
You will be discussing with user {{{json context.profile}}}
His email is {{user.email}}
Let’s look at the various elements of this prompt:
{{object}}
.{{date}}
is available from the general context. The context includes:
dateTime: Timestamp in the Europe/Paris
timezone, for example: '2024-12-09 11:20:46'
date: '2024-12-09'
time: '11:20:46'
{{user.name}}
, {{user.id}}
, {{user.email}}
.{{anonUser.ID}}
will render the phone number of the user; {{anonUser.name}}
will render the name in Whatsapp.{{context.profile}}
element has been logged by the function hook displayed in the Section Functions Calling & Function Hooks that called a function named api-call/hook_get_user
. This function includes the following post-processing script which renders a profile object, which can in turn be called through the context.json
in {{{json context.profile}}}
means that the agent must format the following json object context.profile
in the json format. The other option available would be yaml
. Triple curly brackets {{{object}}}
are used to escape characters.Finally, other variables are available:
env.variables
, which are defined in module Development > Environment
. Please refer to that part of the documentation for more detailsconversation.id
, conversation.messages
and conversation.agent
: this allows access to previous messages and function calls / responses in the conversation.<aside> 🏗️
Under Construction
</aside>
Triggers are available at Agents > Triggers
.
An agent trigger is a functionality that makes an agent start or continue a conversation with a user (rather than letting the user take the initiative).
A trigger configuration includes:
Scheduling :
Example: let’s say you want to schedule a trigger to run each day. After you have configured a trigger, you may schedule it to run regularly. Go to Agents > Triggers
and in the table click on “Schedule”. A form will appear asking for a Cron string. This is a standard format for specifying a recurring date and time. There are many tools that can help you generate a cron string in the correct format (eg. https://crontab.guru/).
For example “0 0 * * *” means “run every day at midnight.
<aside> 🏗️
Under Construction
</aside>
An agent eval is a structured testing scenario where an AI agent interacts with predefined user inputs across multiple exchanges, simulating real-world use cases. The agent must produce correct outputs and trigger specified actions to pass the test. Evals are run in batches, enabling regression testing to validate that new configurations or updates do not degrade the agent's performance.
☰ On this page…