Prompt syntax
Prompt is the most important part of your AI Agent that defines its personality, behavior, output format, security guardrails etc.
In addition to plain text, prompts may contain the following elements:
-
References to dynamic variables, for example,
{current_datetime}or{caller}, as described in Dynamic variables. -
References to tools and other agents – these are in essence plain text elements, but it is recommended to enclose them in backquotes for readability reasons – e.g.
`get_weather` -
Comments – use comment marks
/* */to temporarily disable parts of your prompt; this allows you to quickly iterate on your prompts when designing / adjusting the agent’s business logic. -
Conditions – use handlebars-like condition statements to implement conditional logic in your prompts, for example, adjust prompt instructions to the current time of day. For more details, see Prompt conditions.
Prompts are normally evaluated at agent initialization time. However, you may use dynamic prompts functionality to re-evaluate them at every user utterance, therefore changing agent’s instructions as conversation progress. For more details, see Dynamic prompts.