Skip to content

Context

Context is the single store a run reads and writes as it moves through the graph. It starts with the goal and the declared inputs, then gains an entry for every accepted agent output, every command fact and the outcome of every stage. Prompts read it, conditions read it, and nothing else carries information between steps.

Declared inputs are copied into context when the run starts. {{ inputs.work }} always renders the original value, while {{ context.work }} renders whatever the run holds now, which a later node can change.

An agent contributes only what it declares. outputs="verdict:choice,findings:json" accepts exactly those two keys with those two types, and the agent finishes its turn with a JSON object under context_updates. Undeclared keys are rejected. The final prose stays readable as {{ context.response.review }}, named after the node.

A command contributes the facts it declares. A probe node writes per-folder facts such as web.pr.raw and rolled-up facts such as pr.state. A script node writes the dotted names in its own facts attribute and nothing else.

The validator checks availability before a run starts. A value must be produced on every path that leads to the node reading it. This is the rule that catches the common mistake: a prompt that reads a verdict which only one branch produces fails validation rather than rendering empty at three in the morning.

Two consequences follow. A parallel branch cannot read its sibling’s outputs; after the join, read them through parallel.results. And a repair prompt reached by a failure edge can read {{ context.failure_reason }}, because the engine writes that on every failed stage.

An edge with loop_restart="true" clears iteration context, completed stage history and thread sessions, while keeping the original inputs, the run identity, visit counts and repair budget state. Use it when a loop starts a genuinely new episode of work, so the next pass is not reasoning about the last one. See loops.

Template variables lists every name a prompt can read, and context gives the exact fact names and output kinds.