Multi-Agent Orchestration
OrcBot provides production-ready multi-agent orchestration for parallel task execution, specialization, and autonomous coordination. The orchestration system uses real Node.js worker processes with IPC communication.Architecture
Orchestration Components
- AgentOrchestrator: Manages worker pool and task distribution
- Worker Processes: Isolated Node.js processes forked from main agent
- IPC Channel: Inter-process communication for coordination
- Task Queue: Shared priority queue for work distribution
- Message Bus: Agent-to-agent messaging system
Worker Lifecycle
Process Isolation
Each worker is a separate Node.js process with:- Isolated memory: No shared state with main agent
- Separate config: Can override LLM model, API keys
- Independent execution: Runs tasks without blocking main agent
- IPC communication: Sends results back via message passing
spawn_agent
Create a sub-agent for parallel work.Parameters
Agent name (used in logs and status)
Agent role:
"worker" (general task execution) or "researcher" (specialized research)Optional skill subset this agent can use
Return Value
Confirmation with agent ID and PID (process ID)
Roles
Worker Agent:- General-purpose task execution
- Full skill access (unless restricted by capabilities)
- Suitable for parallel automation
- Example: scraping multiple websites simultaneously
- Specialized for deep research tasks
- Higher
isResearchskill budgets - Optimized for multi-step web navigation
- Example: comprehensive market research
Example Usage
Spawn general worker:Response Example
Worker Process Details
Workers inherit:- Config from main agent (unless overridden)
- LLM credentials
- Memory store paths
- Skill registry
- Channel connections (no Telegram/WhatsApp/Discord)
- Current action state
- Short-term memory (starts fresh)
Metadata
- isDeep:
false - isDangerous:
false - isElevated:
false
delegate_task
Assign a task to an agent or the orchestrator.Parameters
Natural language task description
Task priority (1-10, higher = more urgent)
Specific agent to assign to. If omitted, orchestrator auto-assigns to available worker.
Return Value
Confirmation with task ID and assigned agent
Auto-Assignment
Ifagent_id is omitted, the orchestrator:
- Finds idle workers
- Assigns to least-loaded worker
- If no workers idle, queues for next available
Example Usage
Delegate to specific agent:Response Example
Task Dependencies
Tasks supportdependsOn metadata for chaining:
Metadata
- isDeep:
false
distribute_tasks
Auto-assign pending tasks to available workers.Parameters
None. Distributes all pending tasks in the queue.Return Value
Summary of distributed tasks
Example Usage
Response Example
Metadata
- isDeep:
false
orchestrator_status
Get orchestration summary.Parameters
None.Return Value
Orchestration state including active workers, pending tasks, and completion stats
Example Usage
Response Example
Metadata
- isDeep:
false
complete_delegated_task
Mark a delegated task as completed. Typically called by workers.Parameters
Task ID to mark complete
Optional result summary
Example Usage
Metadata
- isDeep:
false
fail_delegated_task
Mark a delegated task as failed.Parameters
Task ID to mark failed
Error message or reason for failure
Example Usage
Metadata
- isDeep:
false
Inter-Agent Messaging
send_agent_message
Send a message to another agent. Parameters:Recipient agent ID
Message content
Message type: info, request, response, alert
broadcast_to_agents
Broadcast a message to all agents. Parameters:Message to broadcast
get_agent_messages
Retrieve messages for an agent. Parameters:Agent ID. If omitted, returns messages for current agent.
Max messages to return
Peer Agents
create_peer_agent
Create an independent peer agent with specialized configuration. Parameters:Peer agent name
Role description
Custom WORLD.md governance rules
- Peer agents are independent long-lived agents with their own identity
- Workers are temporary sub-processes for parallel task execution
configure_peer_agent
Update peer agent configuration and restart. Parameters:Peer agent ID
Configuration updates (API keys, channel tokens, etc.)
Common Patterns
Parallel Web Scraping
Research Coordination
Task Pipeline
Best Practices
Workers vs peer agents:
- Use workers for temporary parallel task execution
- Use peer agents for long-lived specialized bots
- Workers are cheaper (terminate after task completion)
- Peers have full autonomy and channel access
Configuration
Troubleshooting
”Worker crashed”
- Cause: Unhandled exception in worker process
- Fix: Check daemon logs, add error handling to delegated tasks
”Task stuck in pending”
- Cause: No idle workers or dependency not met
- Fix: Check
orchestrator_status(), spawn more workers or resolve dependencies
”IPC timeout”
- Cause: Worker took too long to respond
- Fix: Increase
ipcTimeoutor split task into smaller chunks
”No workers available”
- Cause: All workers busy or crashed
- Fix: Spawn more workers or terminate/restart hung workers