FrontierAI.Engineer
← All chapters

Agent Planning & Reasoning

How agents decompose goals, plan steps, and reason toward outcomes.

24 terms

BacktrackingBacktracking is the ability of an agent to abandon an unsuccessful reasoning path or action sequence and return to an earlier decision point to try an alternative approach. Backtracking is especially valuable when the agent recognizes it is stuck or that the current path contradicts a known constraint. It requires the agent to maintain a record of prior states or plan branches so it can resume from a valid earlier checkpoint.Chain-of-ThoughtChain-of-thought prompting elicits intermediate reasoning steps from a language model before it produces a final answer. By generating a verbal walkthrough of the reasoning process, the model externalizes computation that would otherwise happen implicitly inside a single forward pass, catching errors and improving accuracy on arithmetic, logic, and multi-hop knowledge questions. CoT is a cornerstone technique for making model reasoning inspectable and correctable.Cost-Aware PlanningCost-aware planning weighs the expected token, latency, and tool-invocation cost of candidate plans, not just their likelihood of success. An agent may prefer a shorter, cheaper path that is slightly less certain over an exhaustive one, or reserve expensive tools for steps that truly need them. Making cost an explicit factor keeps autonomous agents economical without sacrificing acceptable task quality.DeliberationDeliberation is the process of spending additional compute — through extra reasoning steps, candidate generation, or evaluation passes — to arrive at a higher-confidence decision before acting. Deliberating agents trade latency for accuracy, investing more effort when stakes are high or ambiguity is great. Test-time compute scaling, best-of-N sampling, and iterative refinement are all forms of deliberation commonly applied to planning-heavy tasks.GoalA goal is the desired end state or outcome that an agent is tasked with achieving. Goals can be specified as success conditions, natural-language descriptions, or structured objectives. Clear goal specification is critical for agent performance: ambiguous goals lead to misaligned behavior, while overly rigid goal definitions may cause the agent to miss obviously correct alternative solutions that satisfy the true intent.Goal ConditioningGoal conditioning is the practice of keeping an explicit statement of the objective present in the agent's context so that every reasoning and action step is evaluated against it. By anchoring intermediate decisions to the stated goal, it reduces drift on long multi-step tasks where an agent might otherwise wander off-objective. It also makes it easier to detect when a step no longer serves the original intent.HeuristicIn the context of agent planning, a heuristic is a rule of thumb or scoring function that estimates the promise of a partial plan or reasoning path without guaranteeing optimality. Heuristics guide search by prioritizing which branches to explore first, enabling practical planning under time or compute constraints. Language models implicitly encode learned heuristics in their parameters; explicit heuristics can also be injected via prompts or external scoring models.Hierarchical PlanningHierarchical planning organizes a task as nested layers of abstraction: high-level plans specify major phases of work, while lower-level plans spell out concrete actions within each phase. An agent executing a hierarchical plan can reason at the appropriate level of detail for each decision, delegating fine-grained choices to lower-level sub-plans. This mirrors how humans organize complex projects and helps agents avoid losing the big picture while managing tactical details.Least-to-Most PromptingLeast-to-most prompting is a technique that teaches a model to first solve the easiest subproblem, use that solution to tackle the next slightly harder one, and build up incrementally to the full problem. This scaffolded approach exploits the model's ability to condition on correct earlier steps, dramatically improving performance on compositional reasoning tasks where jumping directly to the answer is error-prone.Means-Ends AnalysisMeans-ends analysis is a planning strategy that repeatedly compares the current state with the goal state, identifies the largest difference between them, and selects an action or operator that reduces that difference. Borrowed from classical AI, it drives step-by-step progress toward a goal by always attacking the most significant remaining gap. Agents apply it to decide which subgoal or tool call most advances the objective.Plan MonitoringPlan monitoring is the continuous check of whether execution is still tracking the intended plan and whether the plan's assumptions still hold. When an observed result diverges from what a step expected, monitoring triggers replanning or backtracking rather than blindly continuing. This closed-loop supervision keeps an agent robust in dynamic environments where earlier assumptions can become invalid partway through a task.Plan VerificationPlan verification is the step of checking a generated plan for correctness, feasibility, and completeness before execution begins. Verification can be performed by a separate critic model, a symbolic checker, or a set of automated tests against the plan's preconditions and expected outcomes. Catching invalid plans early prevents wasted tool calls and side effects from actions that would never have succeeded.Plan-and-ExecutePlan-and-execute is an agent architecture that separates planning from execution into distinct phases. A planner model or prompt first produces a structured step-by-step plan for the entire task, then an executor agent works through the plan one step at a time, potentially invoking tools and updating state. This separation allows the planner to reason holistically before any side effects occur, and it makes each step's intent explicit for auditing.PlanningPlanning is the process by which an agent reasons about a sequence of steps needed to achieve a goal before committing to action. A planner considers available tools, preconditions, and likely outcomes to produce an ordered strategy rather than reacting greedily step-by-step. Explicit planning often reduces errors on complex tasks by catching contradictions and dead ends early rather than discovering them mid-execution.ReAct ReasoningReAct reasoning is a prompting strategy that interleaves natural-language thought traces with discrete action commands in the same generation. The model writes a thought about what it knows and what it needs, emits an action, receives an observation, and continues. This cycle makes the model's planning process legible and enables recovery from mistakes because each thought can incorporate the latest observation before the next action is chosen.ReflectionReflection is a deliberate self-evaluation step in which an agent reviews its own outputs, reasoning traces, or past actions and identifies mistakes, gaps, or improvements. A reflecting agent generates a critique of what went wrong and uses that critique to revise its plan or output. Reflection can be triggered automatically after each step or reserved for situations where the agent detects low confidence or task failure.ReplanningReplanning occurs when an agent revises its plan in response to unexpected observations, tool failures, or changed conditions discovered during execution. Rather than blindly following a stale plan, the agent pauses, re-evaluates the current state against the goal, and generates an updated plan that accounts for what it has learned. Replanning is a key component of robust agent behavior in dynamic or uncertain environments.ScratchpadA scratchpad is a designated section of the model's generation — or an external text buffer — where the agent can write intermediate calculations, notes, or partial reasoning before committing to a final answer or action. The scratchpad externalizes working memory, allowing the model to perform multi-step computation more reliably than attempting to compress all reasoning into a single token prediction. It also makes intermediate reasoning visible for debugging.Self-ConsistencySelf-consistency is a decoding strategy that samples multiple independent reasoning paths for the same question and aggregates the final answers — typically by majority vote — to select the most reliable response. Because different reasoning chains may reach the same correct answer through varied routes, the ensemble is more robust than any single chain. Self-consistency is especially effective on tasks with verifiable answers and moderate output variance.Self-CritiqueSelf-critique is the technique of prompting a model to act as its own critic: after producing an initial output or plan, the model is asked to identify flaws, missing considerations, or logical errors. The critique is then used to generate a revised response. Self-critique can be implemented in a single prompt with sequential generation or across separate model calls, and it substantially reduces elementary errors in complex reasoning tasks.SubgoalA subgoal is an intermediate milestone that an agent must achieve as part of reaching a larger goal. Decomposing a complex objective into subgoals gives the agent a clearer and more tractable sequence to work through, and it enables progress monitoring: reaching each subgoal confirms the agent is on track. Subgoals also facilitate replanning — when a subgoal fails, only that branch of the plan needs revision.Task DecompositionTask decomposition breaks a high-level objective into smaller, independently executable subtasks. By reducing scope at each step, the agent can tackle problems that exceed the reasoning capacity of a single prompt. Effective decomposition identifies natural dependencies between subtasks and produces chunks small enough to be reliably solved while large enough to avoid excessive overhead from coordination.Task GraphA task graph is a directed acyclic graph in which nodes represent individual subtasks and edges represent dependency relationships between them. An agent or orchestrator can schedule independent subtasks in parallel and sequence dependent ones, reducing total wall-clock time and making parallelism explicit. Task graphs also serve as an audit trail, showing exactly which subtasks were completed, which failed, and how the final result was assembled.Tree of ThoughtsTree of Thoughts treats problem solving as a search over a tree where each node is a partial reasoning state. Rather than following a single linear chain of thought, the model generates multiple candidate continuations at each step, evaluates their promise, and explores the most viable branches. This enables backtracking and broader exploration of the solution space at the cost of more model calls.