Skip to content

Intent System

The Intent System provides declarative, LLM-based decomposition of high-level goals into executable sub-task DAGs, with a Reconciler that continuously drives toward the desired state.


Overview

Instead of manually defining each agent step, declare what you want and let Rnix figure out how:

bash
$ rnix intent apply "Refactor the authentication module to use JWT tokens"
[intent] decomposing...
[intent] created intent tree with 5 nodes:
  analyze design implement test review
[intent] executing...

Core Concepts

Intent Tree

An Intent Tree is a DAG of sub-tasks generated by LLM decomposition:

Intent: "Refactor auth to JWT"
├── analyze:    "Analyze current auth implementation"    [completed]
├── design:     "Design JWT architecture"                [executing]
│   depends_on: [analyze]
├── implement:  "Implement JWT flow"                     [pending]
│   depends_on: [design]
├── test:       "Write tests for JWT auth"               [pending]
│   depends_on: [implement]
└── review:     "Review and validate"                    [pending]
    depends_on: [test]

Intent States

pending → decomposing → await_confirm → executing → completed

                                           └→ failed → retrying → executing
StateDescription
pendingWaiting for dependencies
decomposingLLM generating sub-tasks
await_confirmWaiting for user confirmation (if enabled)
executingAgent process running
completedSuccessfully finished
failedExecution failed
retryingRetry in progress

Reconciler

The Reconciler is the event-driven engine that continuously drives the intent tree toward completion:

loop:
  1. Compute runnable nodes (all dependencies satisfied)
  2. Spawn agent for each runnable node
  3. Monitor execution
  4. Handle results (mark completed or failed)
  5. Detect drift (desired vs current state)
  6. Retry failed nodes (up to max_retries)
  7. Cascade failure (mark downstream dependents as failed)
  8. Check termination (all nodes in terminal state?)

Drift Detection

The Reconciler compares desired state (all nodes completed) with current state. Drift types:

DriftDescription
node_failedA node has failed
node_timeoutA node exceeded timeout
new_requirementNew sub-task identified
node_modifiedNode intent was changed

Incremental Updates

Update the desired state while execution is in progress — only the delta is executed:

bash
$ rnix intent apply "Also add refresh token support"
[intent] computing incremental diff...
[intent] adding 2 new nodes: implement-refresh, test-refresh
[intent] existing completed work preserved

Already-completed nodes are not re-executed. The Reconciler computes only the changes needed.


Status Query

bash
$ rnix intent status
Intent: "Refactor auth to JWT"
  Nodes: 5 total (3 completed, 1 executing, 1 pending)

 analyze     PID 10  completed  (1,200 tokens, 3.2s)
 design      PID 11  completed  (1,800 tokens, 5.1s)
 implement   PID 12  completed  (3,400 tokens, 12.3s)
 test        PID 13  executing  step 3/10
 review       pending    (blocked by: test)

  Budget: 12,400 / 20,000 tokens (62%)
  Drift: none

Failure Handling

Retry

Each node can specify max_retries. On failure: if retries remain → re-execute; if exhausted → cascade failure.

Failure Cascade

When a node fails permanently, all downstream dependents also fail:

A (failed) → B (failed: upstream) → C (failed: upstream)

Node Reset

Reset a failed node to retry from scratch:

bash
$ rnix intent reset <node-id>
# Clears state, error, PID, result, retry count
# Preserves timeout and max_retries configuration

Intent + Autonomous Agents

The Intent System works naturally with autonomous agents — each decomposed node can be executed by an agent that independently decides its approach through the unified reasoning loop. The Reconciler handles coordination while agents handle execution autonomously.


Released under the MIT License.