Agent orchestration
Canyon's code-generation pipeline is five specialised agents wired into a deterministic retry loop. Intent routes. Planner specifies. Builder generates. Validator verifies. Conversation handles everything that isn't a code change. The pipeline is model-agnostic — run it on the provider and model mix that fits your procurement and compliance posture.
Multi-agent pipeline
When a user message enters the API, the Intent Agent runs first. It routes to one of two branches: the Conversation Agent for multi-turn chat, or the code-generation pipeline (Planner → Builder → Validator) for anything that changes code. Each agent has a single, well-scoped job — this is what makes the system deterministic, auditable, and easy to reason about.
Canonical pipeline diagram
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ USER REQUEST │
│ "Create a dashboard with sales KPIs" │
└─────────────────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ INTENT AGENT (Router) │
│ ────────────────────────────────────────────────────────────────────────────────────── │
│ • Classifies: CONVERSATION | CREATE | MODIFY | CLARIFY | SECURITY_BLOCKED │
│ • Detects scope: ELEMENT | COMPONENT | PAGE | APP │
│ • Estimates impact: ISOLATED | CONTAINED | BROAD │
│ • Identifies target files & constraints │
│ • Sub-second classification using a fast routing model │
└─────────────────────────────────────────────────────────────────────────────────────────┘
│
┌────────────────────────────┴────────────────────────────┐
▼ ▼
┌─────────────────────────────────┐ ┌─────────────────────────────────┐
│ CONVERSATION AGENT │ │ CODE GENERATION PIPELINE │
│ ───────────────────────────── │ │ ───────────────────────────── │
│ • Multi-turn chat │ │ │
│ • Governed metric queries │ │ ┌─────────────┐ │
│ • Data-aware responses │ │ │ PLANNER │ │
│ • Code inspection tools │ │ │ AGENT │ │
│ • Calls your MCP tools │ │ └──────┬──────┘ │
└─────────────────────────────────┘ │ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ BUILDER │ │
│ │ AGENT │ │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ VALIDATOR │ │
│ │ AGENT │ │
│ └──────┬──────┘ │
│ │ │
│ ┌─────────┴─────────┐ │
│ ▼ ▼ │
│ [SUCCESS] [FAILURE] │
│ │ (retry ≤5x) │
└──────┴───────────────────────────┘The five agents
Each agent is tuned to its role. Intent is a single fast classifier. Validator is not a language model at all.
| Agent | Mode | Tools | Purpose |
|---|---|---|---|
| Intent | Fast model, no tools | None | Route the request in sub-second time |
| Planner | Reasoning model + tools | Design tokens, components, patterns | Produce a file-by-file build specification |
| Builder | Reasoning model + tools | Read, write, edit, your MCP tools | Generate and modify the code |
| Validator | Deterministic (no model) | Type checker, linter, policy checks | Verify syntax, types, and constraints |
| Conversation | Reasoning model + tools | Metric queries, code inspection, MCP tools | Multi-turn, data-aware chat |
Model-agnostic execution
The orchestrator treats language models as a replaceable backend. Smaller, faster models handle routing and classification; larger reasoning models handle planning and generation. Canyon runs on the provider mix you want — direct, via your enterprise LLM gateway, or on models hosted in your own cloud account.
Supported model providers
Self-healing retry loop
When validation fails, the orchestrator parses the error output into structured fix instructions and sends them back to the Builder. An optional Diagnostic Agent may intervene when the error parser can’t produce a confident fix. Retries are capped by count, wall-clock time, and same-error detection.
┌──────────────────────────────────────────────────────────────────┐ │ ORCHESTRATOR RETRY LOOP │ │ ────────────────────────────────────────────────────────────── │ │ │ │ Builder Output ──► Validator ──► Pass? ──► Deploy │ │ ▲ │ │ │ │ ▼ │ │ │ [FAIL] │ │ │ │ │ │ │ ┌────────────┴────────────┐ │ │ │ ▼ ▼ │ │ │ Error Parser Diagnostic Agent │ │ │ │ (optional) │ │ │ ▼ │ │ │ └─── Fix Instructions ◄──────────────────┘ │ │ │ │ Limits: 5 retries, 600s timeout, same-error detection (3x) │ └──────────────────────────────────────────────────────────────────┘
Guardrails
| Guardrail | Limit | Purpose |
|---|---|---|
| Retries | 5 | Cap cost and wall-clock on pathological plans. |
| Orchestrator timeout | 600s | Hard ceiling from user message to success or failure. |
| Same-error detection | 3 repeats | Break out of fix loops that don’t converge. |
| Intent classes | 5 | Keeps router behaviour small enough to audit. |