Agent Script Reference: Reasoning Instructions

A topic's reasoning block contains instructions that Agentforce resolves into a prompt for the LLM. The resolved prompt instructs the LLM to perform the topic's purpose. See Processing a Topic.

In general, shorter reasoning instructions result in more accurate and reliable results.

In the example, the logic deterministically sends a verification code when an email address is present and saves returned values in variables. The prompt guides the user to provide and validate the code, with instructions to confirm the email and resend if needed.

To use variables in reasoning instructions, use {!@variables.<variable_name>}. The prompt is resolved with the variable's value.

There are two different parts of reasoning instructions: logic instructions and prompt instructions. Logic instructions are deterministic or conditional expressions that determine certain requirements, run actions, and set variables. Prompt instructions are passed as natural language to the LLM if the conditions are met. The prompt instructions can still reference literal values through @variables, @utils, and @actions.

The | (pipe) command for multiline strings can also be used for indented multiline prompt instructions before or after the deterministic logic instructions are followed.

Related Topics