Agent Script Pattern: Reference Resources Directly in Reasoning Instructions

Reference topics, actions, and variables directly in the prompt text of your reasoning instructions. Use @ mentions and the {curly brace} syntax to reference variables and reasoning actions directly.

Reference topics, actions, and variables directly in your reasoning instructions using special syntax. Use @ mentions and the curly brace syntax to reference variables and actions directly in your prompt text.

Pattern Example: Display a personalized order summary by referencing variables like order name, date, and status, and guide the user to the lookup_order action or Returns topic when they need more help.

  • Topics: {!@topics.<topic_name>}
  • Actions: {!@actions.<action_name>}
  • Variables: {!@variables.<variable_name>}

Reference variables directly to include specific data in the response.

Reference actions directly to tell the LLM which reasoning action to use.

Use both types of references together for complete, specific instructions.

Use references inside conditional prompts as well.

  • Reference resources when clarity is required: In general, the agent can figure out which resource to use. In cases where you have many actions, for example, add a reference to help the agent pick the right one. Direct references are a stronger signal to the LLM, so it's more likely to select the right variable, action, or topic.