When a task is too complex for a single pass, Hermes decomposes it into subtasks and delegates to specialized subagents. This enables parallel execution, specialized focus, and better results.
How Delegation Works
When you ask Hermes to "build a full-stack app with authentication," the orchestrator:
- Analyzes the task complexity
- Decomposes into subtasks (backend, frontend, auth, database)
- Spawns subagents with specific focus
- Coordinates parallel execution
- Integrates results into coherent output
Enabling Subagent Delegation
# config.yaml
orchestrator:
subagent_delegation:
enabled: true
max_concurrent: 3 # Parallel subagents
timeout: 300 # Per-subagent timeout (seconds)
Delegation Strategies
| Strategy | Use Case | Trade-off |
|---|---|---|
| parallel | Independent subtasks | Fastest, higher cost |
| sequential | Dependent subtasks | Slower, reliable |
| hybrid | Mixed dependencies | Balanced |
orchestrator:
delegation_strategy: hybrid
Subagent Types
Code Agent: Writes, reviews, refactors code
Subtask: "Implement user authentication module"
→ Spawns code agent with auth context
Research Agent: Gathers information, reads docs
Subtask: "Find the best library for JWT handling in Python"
→ Spawns research agent to compare options
Test Agent: Writes and runs tests
Subtask: "Write unit tests for the auth module"
→ Spawns test agent after code is complete
Example: Full-Stack App Request
User: "Create a FastAPI backend with PostgreSQL and React frontend"
Orchestrator analysis:
├── Subtask 1: Set up FastAPI project structure (code agent)
├── Subtask 2: Design PostgreSQL schema (code agent)
├── Subtask 3: Create React frontend scaffold (code agent)
└── Subtask 4: Write integration tests (test agent)
Execution:
[Agent 1] Setting up FastAPI...
[Agent 2] Creating database schema...
[Agent 3] Scaffolding React app...
---all complete---
[Agent 4] Writing integration tests...
Context Sharing Between Subagents
Subagents share:
- Memory files (MEMORY.md, USER.md)
- Project context from parent task
- File changes from sibling agents
Subagents don't share:
- Live conversation state
- Each other's intermediate reasoning
Auxiliary Models for Subagents
Use cheaper models for routine subtasks:
orchestrator:
subagent_model: gemini-1.5-flash # Fast, cheap
main_model: claude-sonnet-4-20250514 # Complex reasoning
Monitoring Subagent Progress
In CLI:
/agents # Show active subagents
/agents status # Detailed progress
Via webhooks:
webhooks:
subagent_started: http://localhost:3000/hooks/agent-start
subagent_completed: http://localhost:3000/hooks/agent-done
Subagent Token Budgets
Prevent runaway costs:
orchestrator:
subagent_max_tokens: 4000 # Per-subagent limit
total_delegation_budget: 20000 # Total for all subagents
When Delegation Helps
- Multi-file refactoring
- Full-stack feature implementation
- Research + implementation tasks
- Test generation after code changes
- Documentation across multiple areas
When to Disable Delegation
- Simple single-file changes
- Quick questions
- When cost matters more than speed
orchestrator:
subagent_delegation:
enabled: false # Single-agent mode