Agent structure
The top-level object holds a set of named functions. Each function is an ordered object of commands. Commands are the units of execution in an agent.
{
"functions": {
"main": { // the entry point; required
"commands": {
"prompt": { ... }, // each key names a command
"llm": { ... },
"output": "{ result }"
}
},
"helper": { // any number of other functions
"args": { "city": {} },
"commands": { ... }
}
}
}Commands are keys
Each command is a key-value pair. The key is the command name and the value carries the command's fields. The value is an object for most commands, and a single value for simple commands such as progress or return. Commands run in the order they are written.
Keys in a JSON object must be unique. So a command that appears more than once in one function takes a suffix after a dot: api, api.2, api.forecast. The suffix is only a label. The suffix appears in traces and error messages.
main
Every agent defines a function named main. Execution starts in main. Other functions run when a function calls them with func or parallel, or when an LLM calls them as tools. main itself cannot be called.
Size
An agent definition may be at most 20,480 characters by default. The limit is an administrator setting in Runtime limits. Move repeated prompt text into prompt profiles rather than growing the agent.

