Core Concepts

Planner + Agents Architecture

CODI’s core engine comprises a high-level Planner that decomposes developer commands into a directed task graph and autonomous Agents that execute individual tasks (scaffold, audit, test, deploy) according to that graph.

CODI’s core engine comprises a high-level Planner that decomposes developer commands into a directed task graph and autonomous Agents that execute individual tasks (scaffold, audit, test, deploy) according to that graph.

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

// Planner generates a simple task graph
const graph = Planner.buildGraph(['init', 'audit', 'test']);
graph.nodes.forEach(node => console.log(node.id, node.deps));

// Agent interface example
type Agent = {
  name: string;
  init(context: Context): Promise<void>


Visual Description

  1. 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.


© 2025 CODI all rights reserved | Created with ♥️

© 2025 CODI all rights reserved | Created with ♥️

© 2025 CODI all rights reserved | Created with ♥️