Agent Hierarchy
Anatomy of an Agent
An agent has:- Inputs: Parameters it accepts
- Operation: The type of work it performs (code, think, http, etc.)
- Handler (for code operations): TypeScript file that implements the logic
- Outputs: Data it returns
The Handler Pattern
For custom logic, agents use the handler pattern which separates YAML contracts from TypeScript implementation: YAML (Contract) - Declares WHAT the agent does:- Testable - Pure TypeScript functions
- Type-safe - Full TypeScript type checking
- Debuggable - Standard debugging tools work
- Maintainable - Clear separation of concerns
Multi-Operation Agent Example
For agents with multiple operations, use YAML flow:Agent Types
Conductor provides three categories of agents:1. System Agents
Built-in agents for core infrastructure functionality. Location:agents/system/
Available:
redirect- URL redirect service (permanent, expiring, single-use links)docs- Documentation generation and servingfetch- HTTP fetching with cachingvalidate- Data validation with multiple strategiesscrape- Web scraping with bot detectionslug- Generate URL-safe slugstools- MCP tools integrationqueries- SQL query execution
2. Debug Agents
Development utilities for testing and debugging. Location:agents/debug/
Available:
echo- Returns input unchanged (inspect data)delay- Add artificial delay (simulate slow operations)inspect-context- View execution context
3. Custom Agents
Agents you build for your specific needs. Location:agents/user/my-agent/
Example: Company enricher, data processor, report generator
4. Pre-built Feature Agents
Ready-made agents for common workflows. Location: Built-in, reference by name Available:scraper- Web scrapingvalidator- Data validationrag- Retrieval-augmented generationhitl- Human-in-the-loop approvalfetcher- Smart HTTP fetchingtransformer- Data transformationscheduler- Task scheduling
Using Agents
In Ensembles
Directly via API
Agent Composition
Agents can use other agents:Versioning Agents
Version agents with Edgit:Agent Features
State Management
Share state across operations:Caching
Cache entire agent execution:Error Handling
Graceful failure handling:Agent Patterns
Pattern 1: Data Pipeline
Pattern 2: AI Chain
Pattern 3: API Orchestration
Testing Agents
Using Agents in TypeScript Ensembles
Agents defined in YAML can be used seamlessly in TypeScript ensembles:Agent Composition Patterns
Compose multiple agents into reusable patterns:For complete TypeScript API documentation, see the TypeScript API Reference.
Best Practices
- Single Responsibility - Each agent does one thing well
- Clear Inputs/Outputs - Document what goes in and comes out
- Version Agents - Use Edgit for version control
- Test Thoroughly - Unit test each agent
- Cache Aggressively - Cache expensive operations
- Handle Failures - Always have fallbacks
- Keep It Declarative - Let Conductor handle orchestration
- Monitor Performance - Track execution times

