Subagent Delegation: Parallel AI Task Execution

·hermes subagent delegation parallel taskssubagentsdelegationorchestrationparallel

Hermes can delegate work to specialized subagents. Learn how task decomposition, parallel execution, and agent hierarchies work.

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:

  1. Analyzes the task complexity
  2. Decomposes into subtasks (backend, frontend, auth, database)
  3. Spawns subagents with specific focus
  4. Coordinates parallel execution
  5. 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

Related Guides

Frequently Asked Questions

Do subagents cost extra tokens?

Yes. Each subagent uses its own context. Parallel execution is faster but uses more tokens than sequential single-agent work.

Can I see what each subagent is doing?

Yes. Use `/agents` in CLI to see active subagents and their status. Enable webhooks for programmatic monitoring.

What happens if a subagent fails?

Failed subtasks are reported to the orchestrator. It can retry with different parameters, reassign to another agent, or escalate to you.

FlyHermes (Managed Cloud)

Deploy in 60 seconds. API costs included. Cancel anytime.

$29.50/first month →

Self-Host (Open Source)

Full control. MIT licensed. Run on your own infrastructure.

View install guide →

Related Posts