Avery.Software — Native Execution Runtime
RuntimeUse casesPricingHelpBlog
← Back to helpconcept · agents

How does the self-correcting planner work?

2 min

The planner reviews + auto-fixes its own first-pass output before showing you the agent. The 'Verified ✓ in N passes' badge tells you what happened.

When you generate an agent, the planner does NOT hand back its first try. It runs the result through a self-correcting loop:

• Stage A — Shape inference (deterministic). Walks the graph and checks every {{nodes.X.output.Y}} reference, every loop bracket, every config-key requirement. Catches structural problems with zero AI calls.

• Stage B — Holistic reviewer (one tiny SLM call). Asks the AI 'does this agent actually achieve what the user asked for?' and gets back a list of issues classified into 8 kinds: WRONG_NODE_KIND, MISSING_STEP, MISSING_ITERATION, WRONG_CONFIG_FIELD, BROKEN_WIRING, INFINITE_LOOP_RISK, MISSING_OUTPUT_SAVE, OK_AS_IS.

• Stage C — Per-issue dispatchers. Each issue routes to a narrow fixer: re-pick the kind, re-fill a config, wrap in a loop, splice in a missing step, patch wiring, cap an unbounded loop. Three of these are pure typing (no SLM call); three make a single narrow SLM call with the issue context.

• Stage D — Iterate (cap = 3 passes). Re-evaluates after each fix. Stops when there are no more issues, or hits the cap.

## How to read the badge

• Verified ✓ in N passes (green) — the loop converged. Your agent is ready. • Verified (N passes) (green) — the loop stopped early because the dispatchers escalated everything they couldn't safely fix; nothing remained. • N issue(s) need attention (amber) — the loop reached the cap with unresolved issues. The remaining-issues list under the badge shows what's left and what node it's anchored to. Click 'Fix with AI' on any issue to jump to the affected node in the Builder. • Manual review needed (amber) — Stage B's reviewer didn't produce a usable response (network error, malformed output). Check each node manually before running.

## Why this exists

A 7B local SLM can handle any single design decision (pick a kind for one step, configure one node) reliably. What it CAN'T do is hold the whole agent in working memory and reason coherently about it — that's why advanced cloud LLMs run circles around small models on this kind of task. Avery externalizes the chain-of-thought as a deterministic pipeline of small SLM calls + verification + refinement, which lets a 7B model produce production-quality agents without sending your prompts to the cloud.


Live recipes need the desktop

This article is a static preview. The in-app Help sidecar inside Avery NXR can fire each step against your live project — install the desktop to use it interactively.

Download desktop →