What Are Agents?
Agents define conversation orchestration:ai_human: AI side responds to user messagesdual_ai: side A and side B alternate until stop conditions are met
Basic Example
Side Configuration
sideA is required. sideB is required for dual_ai.
Common side fields:
promptlabelstopOnResponsestopToolstopToolResponsePropertymaxSteps
sessionStopsessionFailsessionStatus
- string form:
'tool_name' - object form:
{ name, messageProperty?, attachmentsProperty? }
Exposing Agents as Tools
- callable
ai_human: handoff-style tool interaction - callable
dual_ai: subagent execution in child thread
dual_ai as Subagents
When adual_ai agent is called via prompt tools, AgentBuilder can run it as a child thread with:
- isolated message history/logs/filesystem
- parent/child linkage and child registry
- blocking/non-blocking behavior
- resumable/non-resumable lifecycle
subagent_create, subagent_message) are injected by the runtime, not user-defined in agents/tools.
Example: Worker + Reviewer
Best Practices
- Always set
maxSessionTurnsfordual_ai - Use
sessionStop/sessionFailfor explicit terminal outcomes - Use object-form lifecycle bindings when payload shape matters
- Keep side prompts specialized (
side_aproduction,side_bQA)