Overview

Multi-agent orchestration is an optional build (--features orchestration). It is a workflow runtime inspired by Pi, Orloj, and Temporal: several workers share memory and run tasks in parallel, coordinated by an event-sourced engine. The default loop binary does not include it. Key design principle: The workflow runtime is AI-agnostic. Agents, shell commands, and sub-workflows are all just worker types on a shared durable orchestration layer. Interactive surfaces — the CLI TUI (loop-cli) and GPUI desktop (loop-desktop) — sit on top of the same harness. Live multi-agent task cards are available in the CLI today; desktop follows single-agent events for now.

CLI Usage

Build with the orchestration feature, then use /workflow:
Plans a multi-agent task graph from the goal, runs the scheduler, and streams live WorkflowTask cards into the chat until a completed / failed / total summary line. Each task card shows description, status (pending → success/error), and collapsible output (Ctrl+O, same affordance as tool cards). Errors preview a few lines by default.

Architecture

Components

Phases Built

Planners

LLM Planner

The AI-powered planner takes a natural language goal and produces a TaskGraph:
When PlannerContext is omitted, the harness auto-fills cwd and available tool names so the LLM plans against the real environment.

Manual Planner

For predefined workflows, use the manual planner to construct task graphs programmatically.

Worker Types

Agent Worker Hardening

  • Empty tool-filter fallback — If a planner filter matches no base tools, keep the full toolset so filesystem access is not accidentally stripped
  • Soft failure detection — Scans agent output for blocked/unavailable-tool phrasing and fails the task even if the agent loop returned Ok
  • File artifact collection — Successful write tool results verified on disk become workflow Artifacts

Memory System

The memory layer provides coordination between tasks:

SharedMemory

Global key-value store accessible by all tasks in a workflow.

TaskMemory

Per-task isolated memory that persists across retries.

MemoryBus

Pub/sub messaging system for inter-task communication:
  • Tasks can publish messages to named channels
  • Other tasks subscribe and react to messages
  • Supports signals and timers for coordination

Event Sourcing & Progress

Every state transition in a workflow is recorded as an event:
  • Full replay capability for debugging and recovery
  • Fork workflows from any point in history
  • Durable storage with SQLite backend (feature-gated; live resume wiring is Phase 2)
  • Complete audit trail of all agent actions
UIs can track progress without polling:
  • WorkflowEngine::subscribe() broadcasts live WorkflowEvents
  • Harness progress_tx forwards WorkflowProgressEvent (task started / completed / failed) from start_workflow / start_workflow_from_goal
  • WorkflowResult reports completed task_results, failed_tasks (id + error), and total_task_count

Design Principles

  1. AI-agnostic runtime — Agents are just one type of worker. The orchestration engine handles any kind of task.
  2. Event sourcing — Every state change is recorded. Replay, debug, and fork from any point.
  3. Broadcast + progress channel — Decouples engine events from chat cards without polling.
  4. Pluggable workers — Implement one trait to add custom worker types.
  5. Shared memory with isolation — Global coordination with per-task boundaries.
  6. Graceful degradation — Single-agent prompt() works unchanged without orchestration enabled.

Feature Flag

API

Start from Goal

Start from TaskGraph

Both entry points accept an optional progress channel that forwards live WorkflowProgressEvents for UI updates.

Roadmap