Docs / Subagents Swarm / Subagents Swarm Overview

Subagents Swarm Overview

Multi-agent coordination architecture inside BhaiCode.

Complex software engineering tasks require different skill sets: architectural design, rapid feature implementation, deep refactoring, and code review. BhaiCode coordinates these roles through the Subagents Swarm.


Swarm Structure

MERMAID
graph TD
    USER["Developer (You)"] --> BHAI["Bhai<br/>(Lead Orchestrator & Builder)"]
    BHAI <-->|System Design & Plans| PLANNER["Planner<br/>(System Architect)"]
    BHAI <-->|Refactors & Migrations| EXECUTOR["Executor<br/>(Heavy Refactorer)"]
    BHAI <-->|Codebase Scouting| EXPLORER["Explorer<br/>(Read-Only Search)"]
    BHAI <-->|Security & Vulnerability| AUDITOR["Auditor<br/>(Security Inspector)"]
    BHAI <-->|Code Quality & Lint| REVIEWER["Reviewer<br/>(Code Reviewer)"]

Core Agents

Agent Role Focus
Bhai Lead Orchestrator & Builder Direct full-stack coding, conversational pair programming, tool calls, debugging
Planner System Architect Requirements breakdown, relational database modeling, step-by-step roadmaps
Executor Heavy Refactorer Multi-file code surgery, framework migrations, test suite generation
Explorer Codebase Scout Read-only symbol tracing, dependency mapping, file discovery
Auditor Security Auditor Vulnerability scanning, secret leaks, performance bottlenecks
Reviewer Code Reviewer Lint compliance, import hygiene, code cleanliness

How Coordination Works

You talk directly with Bhai:

  1. Bhai evaluates task complexity and scope.
  2. For architectural or multi-phase tasks, Bhai delegates plan formulation to Planner.
  3. For deep refactoring or migrations, Bhai hands off the multi-file transformation to Executor.
  4. Subagents report results back to Bhai, who presents the final changes in the visual diff viewer.

Ready to build with AI?

Start building for free with your own keys, or unlock managed compute in seconds