BD Brain Drip
đź—ş
Module 04 8 concepts

Planning & Replanning

GOAP, A* planners, adaptive replanning, plan rollback, plan graphs vs strings, and plan-driven vs reactive harnesses.

01

A* Planner for Agents

A* is the classical heuristic search algorithm at the heart of GOAP and most structured agent planners — it finds the lowest-cost action sequence from current state to goal state by expanding nodes in order of cost-so-far + estimated-cost-to-goal, and it is the workhorse of any harness that does plan-shaped (rather than chain-of-thought-shaped) planning.

02

Adaptive Replanning

Adaptive replanning is the discipline of detecting when the current plan no longer fits reality (a tool failed, a precondition was violated, a result surprised the agent) and rebuilding a new plan from the post-divergence state — every long-horizon agent system needs it; the question is how the harness expresses it.

03

Goal-Oriented Action Planning (GOAP)

GOAP is a planning technique borrowed from game AI where the agent searches a graph of available actions for a sequence whose preconditions and effects connect the current world state to a goal — used in modern harnesses as a structured alternative to free-form chain-of-thought planning.

04

Multi-Step Plan Evaluation

Evaluating an agent’s plan — separately from evaluating its execution — lets you detect bad plans before they burn tokens, and lets you compare planning strategies; the harness usually exposes evaluation as a hook between plan generation and execution.

05

Plan-Driven vs. Reactive Harnesses

Plan-driven harnesses (ruflo, LangGraph) build a structured plan upfront and execute against it; reactive harnesses (Cursor, Codex CLI in default mode) decide each next step based on what just happened — both are valid; the choice is mostly about task horizon and the cost of upfront planning.

06

Plan Graphs vs. Plan Strings

A plan string is what an LLM emits when you ask it to “plan first” — a numbered list embedded in chain-of-thought; a plan graph is a structured, typed representation of the plan that the harness can inspect, verify, and replay — graphs are dramatically more reliable for non-trivial tasks, at the cost of more upfront engineering.

07

Plan Rollback and Checkpointing

Rollback is the harness’s ability to undo actions taken by an agent (file edits, branch creates, tool side effects) when a plan fails or is replanned; checkpointing is the snapshotting that makes rollback possible — together they are the difference between a recoverable agent and a destructive one.

08

Speculative Planning and Branching

Speculative planning explores multiple candidate plans in parallel — picking the best one only after partial execution — at higher token cost in exchange for lower wall-clock latency and better outcomes on hard tasks; closer to chess-engine search than to typical LLM planning.