{topic} and similar placeholders expand in YAML strings while JSON literals stay intact.
Quick Start
1
Basic Template Substitution
Create an Run with:
agents.yaml with a simple {topic} placeholder:praisonai "AI agents"2
JSON Literals + Variables Together
Mix JSON examples in backstory with Both
{topic} placeholders safely:{topic} and the JSON literals work correctly.How It Works
The template system uses a precise regex pattern to identify which braces to substitute: Pattern:\{([a-zA-Z_][a-zA-Z0-9_]*)\} — only Python-identifier-shaped placeholders are touched.
Where It Applies
The brace-safe substitutor processes these YAML fields:
Available variables:
{topic}— main input from CLI or Python API- Any other keys passed via
kwargsin the Python API
Common Patterns
WordPress/Gutenberg Blocks
API Response Examples
Configuration Snippets
Migration note: Before the latest release, YAML strings with literal
{...} could silently leave {topic} unsubstituted. Now they work as expected — no YAML changes required.Best Practices
Use {topic} as the canonical input placeholder
Use {topic} as the canonical input placeholder
Stick to
{topic} for the main input variable — it’s the standard CLI/API parameter:Write literal JSON naturally
Write literal JSON naturally
No escaping needed for JSON examples in prompts:
Pass extra variables via Python API
Pass extra variables via Python API
For variables beyond Then use
{topic}, use the Python API:{style} and {deadline} in your YAML.Related
Async Crew Kickoff
Native async execution with template substitution
Agent Configuration
Complete guide to agent YAML structure
Workflow Input Resolution
How the YAML
input: field fills {{input}} and its CLI precedence
