Agents
Agents are the core building blocks in Erdo. They contain workflow logic, execute steps, and coordinate AI operations.Basic Agent
Agent Configuration
Status Messages
Agents display status messages to users during execution. There are three ways to configure these messages, listed in priority order:1. Static Status (running_status, finished_status)
Simple static strings shown immediately. Use when the message doesn’t need context from inputs or outputs.
2. Context-based Status (running_status_context, finished_status_context)
Provide context that gets hydrated with template variables and wrapped in a standard LLM prompt to generate a dynamic status message. Use when you want dynamic messages but don’t need full control over the prompt.
“Generate a very short (max 50 chars) present-progressive status message for this task. Context: [your context]. Output only the message.”
3. Custom Prompt (running_status_prompt, finished_status_prompt)
Provide the full LLM prompt for complete control over status generation. Use when you need custom instructions or formatting.
Priority Order
When multiple status fields are set, priority is: prompt > context > status- If
*_promptis set → LLM called with your full prompt - Else if
*_contextis set → LLM called with context wrapped in standard prompt - Else if
*_statusis set → static message shown immediately
Choosing the Right Approach
| Use Case | Field | Example |
|---|---|---|
| Simple, fixed message | running_status | ”Processing request…” |
| Dynamic based on input | running_status_context | TemplateString("Query: {{query}}") |
| Custom LLM instructions | running_status_prompt | Full custom prompt with specific format |
_status for simple cases. Use _context when you want dynamic messages that reference inputs/outputs. Reserve _prompt for advanced cases requiring full prompt control.
Steps and Dependencies
Steps define what actions an agent performs. Usedepends_on to control execution order:
Result Handlers
Handle step outcomes with conditional logic:Example: Document Processor
Agent Patterns
Sequential Processing
Execute steps one after another:Parallel Processing
Execute multiple steps simultaneously:Error Handling
Use result handlers to manage failures:Best Practices
- Clear Names: Use descriptive agent and step names
- Error Handling: Always handle potential failures
- Validation: Validate AI outputs before using them
- Dependencies: Use
depends_onto control execution flow - Memory: Store important results for future reference
- Timeouts: Set appropriate timeout values for long-running tasks