This document describes the high-level architecture, component interactions, and design principles of the Cursor ACE Orchestrator.
ACE Orchestrator is designed as a modular, event-driven orchestration layer that sits on top of coding agents (like cursor-agent). It follows a Multi-Agent System (MAS) pattern where responsibility is distributed across specialized "Mini-Team Agents".
- Contextual Specialization: Agents only see the context relevant to their assigned subsystem.
- Memory Persistence: Long-term memory is stored in
.mdcfiles and updated via a reflection loop. - SOP-Driven: All major workflows (onboarding, reviews, consensus) follow Standard Operating Procedures.
- Iterative Problem Solving: Uses the ROLF Cycle (Reasoning, Action, Learning, Progress, Halt) to solve tasks.
The core engine, built in Python, managing the lifecycle of tasks and agents.
- CLI / API Wrapper: Entry point for user commands or web requests (FastAPI).
- Context Builder: Composes the prompt-slice for each agent call.
- Executor: Runs the headless coding agent.
- Token Manager: Controls context depth and feature availability based on L/M/H modes.
- Agents YAML (
.ace/agents.yaml): Central database of agent identities, roles, and emails. - Ownership YAML (
.ace/ownership.yaml): Mapping of file paths/modules to specific agent IDs.
- Playbooks (
.cursor/rules/*.mdc): Agent-specific long-term memory. - Agent Mail (
.ace/mail/): Asynchronous, threaded messaging system for agent coordination. - Shared Learnings (
.ace/shared-learnings.mdc): Global context for cross-pollination of patterns.
- Google Stitch: Integrated via API/CLI to generate mockups and extract UI code (Tailwind/Flutter).
sequence_diagram
participant U as User
|participant O as Orchestrator
participant C as Context Builder
participant E as Executor (Agent)
participant V as Verification (Tests)
participant R as Reflection (LLM)
U->>O: ace run/loop "task"
O->>C: Build context (Memory + SOP + Token Mode)
C-->>O: Injected Prompt
loop ROLF Cycle
O->>E: Execute task
E-->>O: Code Changes
O->>V: Run Tests / Lint
V-->>O: Pass/Fail
alt Fail
O->>R: Analyze Failure
R-->>O: Update Memory (.mdc)
else Pass
O->>R: Final Reflection
R-->>O: Extract Delta-updates
O->>O: Update Playbook & Changelog
end
end
O->>U: Task Completed
When a task affects multiple subsystems:
- Conflict Detection: Orchestrator identifies multiple owners.
- Debate: Involved agents exchange proposals via Agent Mail.
- Referee: A neutral
arch-agentor LLM-referee evaluates the thread. - Resolution: If consensus is reached, the task proceeds. Otherwise, it escalates to the user.
| Mode | Context Pruning | Asynchronous Features |
|---|---|---|
| Low | Strict (last 2 sessions) | None (Single agent only) |
| Medium | Moderate (last 5 sessions) | Basic Mail & Subscriptions |
| High | Full (All relevant memory) | Full Debate, QA Audits, Stitch Sync |
The development of ACE Orchestrator follows a two-phase evolution:
Initially, a standalone Python script (rolf_loop.py) is used to orchestrate cursor-agent in headless mode. This script implements a simplified ROLF cycle to build the core components of ACE (CLI, Registry, Context Builder).
- Status: Active.
- Outcome: A functional
aceCLI that can run its own loops.
Once the core system is stable, rolf_loop.py will be manually removed. The system will then use its own ace loop command to implement further features, SOPs, and optimizations.
- Status: Target.
- Mechanism: ACE uses its own internal logic, Agent Mail, and Consensus protocols to evolve itself.