Agent Script Blocks
A script consists of blocks where each block contains a set of properties. These properties can describe data or procedures. Agent Script contains several different block types.
This section gives you a high-level understanding of each block type.
The system block contains general instructions for the agent. This information includes a list of messages that the agent should use during specific scenarios. welcome and error are required messages.
The config block contains basic configuration information such as the agent label, the developer name, and the default agent user.
The variables block contains the list of global variables that the agent and script can use. See Variables.
You reference variables throughout the script by using the syntax @variables.<variable_name>.
The language block defines which languages the agent supports.
You can use the connection block to describe how this agent interacts with outside connections. For instance, this code snippet shows how the agent interacts with Enhanced Chat.
You can use the connection block alongside the @utils.escalate command.
The topic block allows you to specify the instructions, logic, and actions for an agent topic. A topic block contains a description, a list of actions, and the reasoning instructions.
These properties make up a topic block:
- topic name: This value is the name of the topic that should accurately describe the scope and purpose of this topic in a few words. Because this value can’t have spaces, use
snake_caseto name the topic. - description: This property contains the description for this topic. This value should help the agent determine when to use this topic based on the user’s intent.
- reasoning: This section contains information sent to the reasoning engine. Its primary properties are instructions and actions.
- reasoning.instructions: This property contains guidance for the reasoning engine after it has decided that this topic is relevant to the user's request. The reasoning instructions can be a combination of logic instructions and prompt-based instructions. See Reasoning Instructions.
- reasoning.actions: The list of tools that are applicable for the reasoning engine to use. This list can point to agent actions listed in the higher-level actions section, as well as other functionality available to the reasoning engine (such as transitioning to another topic, or setting a variable's value). See Tools (Reasoning Actions).
- actions: This section defines the agent actions available from this topic. It contains a description of the action, the list of inputs and outputs, and the target location where this action resides. If you want to allow the reasoning engine to use one of these agent actions, you must also point to this action from the
reasoning.actionssection. See Actions.
The start agent block is a topic that uses the start_agent prefix instead of the topic prefix. With every customer utterance, the agent begins execution at this block. The start_agent topic is used to initiate the conversation, and typically determines when to switch to the agent's other topics (topic classification).