Skip to lesson

NVIDIANVIDIA-Certified Professional: Agentic AI2026-105.3 Engineer planning strategies for sequential and multi-step decision-making.

Repair the affected plan before continuing

Completed by the knowledge check

Learning objective

Replan incrementally on failure or new observations instead of rigid one-shot plans.

Core idea

Replanning changes what the agent intends to do because an observation invalidated an assumption. A retry repeats an intended action; a replan changes the action, its inputs, its prerequisites, or the goal’s achievable scope. Repeating a failed call without changing a disproven assumption is activity without progress.

Incremental repair preserves results that remain valid and revises the affected unfinished work. It does not mean keeping every completed result: if the requested date changes, a completed date-specific calculation can become invalid too. The deciding question is whether the result’s inputs and assumptions still hold.

Plan representation and checks belong to 5.3.2. Here, those checks supply the observations that decide whether to continue, repair, or stop. Recovery after process interruption belongs to 5.4.2; this lesson concerns changing the plan during a task.

How it works

Turn an observation into a planning decision

Classify the observation against the intended step before invoking another planner. A transient transport failure with unchanged inputs might justify a bounded retry; see 2.4.2. A valid empty search result might instead disprove the planned source. A user correction might change the task even though no tool failed. An authorization refusal can constrain the achievable task rather than justify searching for another route to the same restricted data.

Store the observed condition, the affected step identifier, and the assumption it contradicts in the application’s plan record. Give the repair planner this structured failure context and the still-valid results. Passing only “something went wrong” forces it to reconstruct the problem and encourages a complete restart.

NeMo Agent Toolkit’s react_agent can use a tool failure as an observation through pass_tool_call_errors_to_agent. When that option is True, tool errors are passed to the agent; when False, they raise an exception. Choose deliberately whether the agent should adapt locally or the caller should decide the next path. An error visible to the model is useful input, not authorization to ignore the failed condition.

For rewoo_agent, NVIDIA documents a different boundary. The plan is created upfront, and limited adaptability to unexpected tool failures or information is a stated limitation. tool_call_max_retries controls retries; raise_tool_call_error controls whether failures raise immediately or enter tool responses. Neither setting should be treated as a guarantee that the agent regenerates a dependency-correct plan. If the application needs replanning, represent that control explicitly around execution.

Revise only what the observation invalidates

Define a repair node in a LangGraph StateGraph and use add_conditional_edges() after checking a step result. The routing function selects continued execution, repair, or a terminal incomplete result. The repair node returns updated state containing the revised unfinished work and retained valid artifacts. The Graph API provides routing and state updates; the application defines which artifacts remain valid.

Use the plan’s prerequisite relationships to identify affected consumers. If source selection changes, every unfinished consumer of that source must receive the replacement. If a calculation has already consumed the rejected source, invalidate that calculation too. A completed independent lookup can remain usable when its inputs, authorization scope, and freshness requirement are unchanged.

Validate the revised plan before dispatch: its prerequisites must resolve, its tools must remain allowed, and its success conditions must still match the user’s task. Do not let repair silently weaken “verified report” into “best-effort speculation.” If the original goal is no longer achievable, return the unmet requirement or ask for a scope decision through the application’s interaction path.

After a step result is checked, the routing function continues, repairs, or stops, and a repaired plan is validated before it is dispatched.

The routing function continues, repairs, or stops, and a repaired plan is validated before dispatchContinued execution produces a step result that is checked, then the routing function selects one of three paths. Continue returns to execution. Repair goes to the repair node, and the revised plan is validated before dispatch back to execution. Stop ends at a terminal incomplete result. Only a validated revised plan rejoins execution.continuerepairstopdispatchcontinued executioncheck a step resultrouting functionrepair nodeterminalincomplete resultvalidate the revisedplan

LangGraph’s evaluator-optimizer example illustrates feedback-driven conditional routing: a check accepts the output or returns feedback to generation. For planning, apply the same explicit control structure to the remaining work rather than blindly regenerating the entire answer. The repair itself is a team-defined policy, not a built-in promise of incremental invalidation.

Bound repair by remaining useful work

Track a team-defined repair count and remaining task deadline in graph state, and check them in the routing function. Stop when the success condition passes, the approved scope is impossible, or further repair cannot fit the remaining budget. Set a separate ceiling for tool calls when a local react_agent owns the next actions, using max_tool_calls.

LangGraph also accepts recursion_limit as a top-level invocation configuration key. It bounds graph supersteps and raises GraphRecursionError when exceeded. It is a backstop, not a count of failed plans or elapsed seconds: one repair can include several nodes, and parallel nodes can share a superstep. Import RemainingSteps from langgraph.managed and declare a state field such as remaining_steps: RemainingSteps. LangGraph populates it with the remaining steps before the recursion limit. Check it inside the graph to route proactively to the incomplete result while steps remain; catching GraphRecursionError outside the graph is the reactive alternative after the limit is exceeded.

A plan revision must also respect actions already taken. A successful external mutation does not disappear because the planner replaces its step. If an action’s result is uncertain, reconcile it before replay; see 2.4.4 for action recovery. Keep this separate from preserving a reusable read result, which has no external effect to undo.

To run the custom graph through NeMo Agent Toolkit, use workflow._type: langgraph_wrapper and point graph to the exported implementation, with nvidia-nat-langchain installed. The wrapper provides integration; your graph still owns repair eligibility and the stop decision.

Key distinctions and trade-offs

Use the smallest response that repairs the invalid assumption:

ObservationAppropriate responsePreserved workMain cost
Transient failure, assumptions unchangedBounded retry of the same actionAccepted independent resultsExtra attempt latency
Source missing or result rejectedReplace affected steps and invalidate their consumersResults whose inputs remain validRepair planning and repeated checks
User changes the task scopeRecompute scope-dependent workOnly results valid under the revised requestBroader invalidation and renewed acceptance
Scope impossible or budget exhaustedReturn explicit incomplete outcomeAccepted partial results with their limitsUnfinished user objective

Full replanning can be appropriate when the goal or most assumptions changed. Incremental repair is preferable when the change is local and retaining independent results saves meaningful time. The smallest textual edit is not necessarily the smallest correct execution repair.

Architecture / decision scenario

An industrial distributor’s employee assistant prepares supplier-risk summaries within 60 seconds. Its hypothetical task has spent 32 seconds and completed a supplier identity lookup, a certification check, and one sanctions-source lookup. A second source reports that its supplier identifier was replaced after a merger. Restarting the entire task takes an estimated 42 seconds; repairing the identifier-dependent source checks and synthesis takes 19 seconds.

The workflow engineer rejects a complete restart because 32 plus 42 exceeds the deadline. The check node routes to repair, supplies the replacement identifier and affected prerequisites, and retains the independent certification artifact only if it still names the same certified legal entity. The superseded sanctions result and its dependent draft are invalidated. With 28 seconds remaining, the 19-second repair is eligible for execution.

A rigid one-shot plan is also tempting because every planned tool was available. It fails the acceptance rule: source records must describe the same supplier entity. Successful transport cannot cure the identifier mismatch. The repair node must update the remaining plan, rather than let the solver combine inconsistent results.

The team allows one repair for this request class. If the replacement source then identifies another unresolved entity change, the routing function returns an incomplete summary with the unresolved requirement. The procurement data owner decides entity equivalence; the workflow engineer owns the repair budget. Neither an extra retry setting nor a larger graph recursion limit resolves that business ambiguity.

Common exam traps

  • A retry is incremental replanning. Replanning changes the intended work in response to a changed assumption.
  • Completed work is always reusable. A changed prerequisite can invalidate an already-computed result.
  • Passing errors to the model guarantees recovery. It supplies an observation; repair still needs permitted actions and acceptance checks.
  • A recursion limit is a business deadline. It counts supersteps, not seconds or plan revisions.

What to remember

Repair the assumptions and dependent work that the observation invalidates. Preserve independent valid results, check the revised plan before dispatch, and stop explicitly when the remaining goal cannot fit the scope or budget. Adaptive planning is controlled change, not unlimited regeneration.

Knowledge check

References