Core Concepts
Planner + Agents Architecture
Written By: Mark Brown
Last Updated on June 5, 2025
Introduction
The Planner + Agents model provides modularity and scalability. The Planner analyzes user intent, generates a dependency graph of tasks, and schedules Agents. Each Agent runs in an isolated context, performing a single responsibility and reporting results back to the Planner.
1. Planner Responsibilities
Intent Parsing: Converts CLI or UI commands into structured tasks.
Graph Generation: Builds a directed acyclic graph (DAG) representing task dependencies.
Scheduling: Determines execution order (sequential or parallel) based on the DAG and resource availability.
2. Agent Lifecycle
Initialization: Receives context subset from the Planner (via MCP).
Execution: Performs its function (e.g., generating code, running audits).
Reporting: Emits status, output artifacts, and metadata back into the shared context.
3. Isolation & Scalability
Isolated Workers: Agents run in sandboxed processes or containers to avoid side effects.
Resource Management: Planner allocates CPU/memory quotas and retries on failure.
4. Integration Points
MCP Context: Shared storage for intermediate artifacts.
A2A Hooks: Agents can trigger subordinate Agents (e.g., audit-agent invoking patch-agent).
Plugin API: Teams can register custom Agents by implementing a simple interface (init, run, report).
Embedded Code Example
Visual Description
Architecture Diagram:
Planner Node: Top-level box parsing commands and emitting DAG.
Agent Nodes: Four boxes (scaffold, audit, test, deploy) with arrows from Planner.
Context Store: Shared database icon with arrows to/from each Agent.
Conclusion
The Planner + Agents architecture delivers clear separation of concerns, enabling CODI to scale and adapt. Developers benefit from predictable task orchestration and easy extension via custom Agents.
Related to Core Concepts