Multi-Agent

Multi-agent orchestration with ForgeBot.

Multi-Agent Orchestration

ForgeBot supports multi-agent workflows where a Prime agent coordinates multiple specialist agents to handle complex tasks. This is powered by the AgentExecutor class and the prime-first routing pattern.

Architecture

A multi-agent ForgeBot consists of:

  • Prime Agent: The coordinator that receives all messages, analyzes intent, delegates to specialists, and synthesizes final responses.
  • Specialist Agents: Domain-specific agents that handle delegated tasks (e.g., Code Review Agent, Database Agent, API Agent).
  • Shared Memory: All agents read from and write to the same memory store, enabling context sharing via the Blackboard pattern.

Delegation Flow

User Message
    |
    v
Prime Agent (analyze intent)
    |
    +---> Specialist A (code review) --+
    |                                  |
    +---> Specialist B (test plan) ----+
    |                                  |
    v                                  v
Prime Agent (synthesize responses)
    |
    v
Final Response to User

Configuring Specialist Agents

{
  "agents": [
    {
      "role": "prime",
      "name": "Project Manager",
      "prompt": "You coordinate a development team..."
    },
    {
      "role": "specialist",
      "name": "Code Reviewer",
      "prompt": "You review code for quality and security...",
      "tools": ["github_pr_review", "linter_run"]
    },
    {
      "role": "specialist",
      "name": "QA Engineer",
      "prompt": "You write and run test plans...",
      "tools": ["test_runner", "coverage_report"]
    }
  ]
}

Concurrent Execution

When the Prime delegates to multiple specialists, Forge executes them concurrently using the Multi-LLM Parallel Executor (Layer 23, LLMCompiler). Results are collected and passed back to the Prime for synthesis. This dramatically reduces latency for multi-agent workflows compared to sequential execution.

Framework Support

ForgeBot multi-agent workflows are compatible with popular agent frameworks. You can use LangGraph, CrewAI, OpenAI Agents SDK, or AutoGen as the orchestration layer while Forge handles routing, memory, and security for each agent's LLM calls.