Skip to content

9.2.1 Reasoning Roadmap: Plan, Act, Check

Agent reasoning is not a longer answer. It is the ability to create usable intermediate steps, decide what to do next, and check whether the plan is still working.

Agent reasoning and planning chapter learning sequence diagram

Plan execute monitor replan map

Reasoning state checkpoint map

The core habit is: plan a step, act, observe the result, checkpoint state, and replan when the result changes the situation.

Use explicit steps before adding tools. A plan you cannot print is hard to inspect.

task = "prepare a cited RAG demo answer"
plan = ["inspect question", "retrieve sources", "draft answer", "check citations"]
print("task:", task)
for index, step in enumerate(plan, start=1):
print(f"{index}. {step}")
print("checkpoint:", plan[-1])

Expected output:

Terminal window
task: prepare a cited RAG demo answer
1. inspect question
2. retrieve sources
3. draft answer
4. check citations
checkpoint: check citations

Good planning is visible. It should make failures easier to locate, not hide them behind a final paragraph.

StepReadPractice Output
1LLM reasoningDistinguish knowing an answer from deriving a path
2Chain reasoningCreate intermediate states and self-check points
3ReActInterleave thought, action, observation, and next step
4Plan-and-ExecuteSeparate planning from execution when tasks grow
5Advanced planningHandle dependency, priority, rollback, and replan
6Reasoning evaluationScore final result, path quality, and failure type

Keep this page’s proof of learning as a small evidence card:

Task Goal
what the agent is trying to solve
Plan Or Trace
reasoning steps, plan, ReAct trace, or execution graph
Observation
what changed after each action
Failure Check
hallucinated step, stale observation, loop, or unverified conclusion
Eval Action
compare against expected result and revise the plan

You pass this chapter when you can explain why a plan failed: bad decomposition, wrong tool choice, stale observation, missing checkpoint, or weak final verification.

The exit mini project is a visible reasoning trace for one task: plan steps, observations, replans, and the final answer.

Check reasoning and explanation
  1. A passing answer describes the agent loop: goal, plan, tool call, observation, memory or state update, and stop condition.
  2. The evidence should include a trace that another developer can inspect, not only the final answer.
  3. A good self-check names one safety or reliability control such as tool schemas, permission boundaries, retries, evaluation cases, or a human-review point.