PrerequisiteAI 202 Modules 1 and 2 recommended; AI 201 (MCP) recommended
0 / 6 completed
Sync my progressJoin a session to keep progress across devices and share it with your instructor
Learning objectives
Explain how ReAct alternates Reasoning, Action and Observation
Describe the loop: Goal, Reason, Choose Action, Act, Observe, Update State, Reason Again
Distinguish a reasoning step, an action step, an observation, a state update and a next-step decision
Explain the relationship with AI 201: which tool is safe versus when and why to choose it
Recognize how an early error propagates through a loop, and how evidence limits it
Trace a ReAct loop for your own use case using simulated data
Problem and need
8 min
Thinking it all through first does not work
In Module 2 the agent built a Candidate Plan. But a plan is written before the agent has seen everything. Real situations answer back: a source is empty, a number does not match, a page says something unexpected. The core question of this module is: why can an agent not just think everything through first and then act, instead of reasoning, acting and observing in turn?
Work scenario (simulated)
An assistant is asked why lab bookings fell. It reasons for a long time and writes a full 12-step plan in one go. Step 3 turns out to rest on a data file that is empty for last term. Steps 4 to 12 were all built on that file, so the whole plan has to be thrown away. If the assistant had run step 3, looked at the result and only then decided step 4, it would have caught the problem at once.
Reasoning without acting is guessing about a world the agent has not yet looked at
Acting without reasoning is a sequence of moves with no reason behind them
Observations are the evidence that keeps reasoning connected to reality
Alternating them lets each result shape the next decision
Warning
A confident chain of reasoning is not evidence. The agent should prefer what it observed over what it assumed, and a person should be able to read the trace and see why each step was taken.
Key takeaway: Reasoning tells the agent what to try; acting and observing tell it whether the reasoning was right.
Core concepts
10 min
The ReAct loop
ReAct is a pattern in which an agent alternates Reasoning and Acting, and uses each Observation to decide what to reason about next. It is a way of making iterative decisions, and it is the basic loop under many agent designs.
The ReAct loop
Goal: what the agent is trying to achieve
Reason: what does the current state mean, and what is the best next move?
Choose Action: pick one available action that fits
Act / Use Tool: carry the action out
Observe Result: read what came back
Update State: record what is now known and done
Reason Again: return to Reason with the new state
Text equivalent: the loop starts from the Goal. The agent Reasons about the state and chooses an Action. It acts, often by using a tool, then observes the result. It updates its State with what it learned and Reasons again. The loop continues until the goal is reached or a Stop Condition from Module 1 applies.
One turn of the loop (simulated)
Part
What it looks like
Reasoning
"Bookings fell, but I do not know for which lab. I should look at bookings by lab first."
Action
Open the booking table and group by lab
Observation
Lab C fell by 40 percent; the others are flat
State update
Known: the drop is in Lab C only. Not yet known: why
Next-step decision
Check whether Lab C had a closure or a schedule change
Check yourself
What is the main reason ReAct alternates reasoning and acting?
Key takeaway: ReAct: Reason, Act, Observe, Update State, Reason Again, until the goal is met or a stop condition applies.
10 min
Five parts of a step: which is which?
To read or write a ReAct trace you must tell five things apart. They are easy to mix up, and mixing them up hides mistakes.
Five parts of a ReAct step
Part
Question it answers
Example (simulated)
Reasoning step
What does the situation mean, and what should be done?
"The drop may be in one lab only, so group by lab."
Action step
What does the agent actually do?
Group the booking table by lab
Observation
What came back from the environment?
Lab C down 40 percent, others flat
State update
What does the agent now know and what has been done?
Drop located in Lab C; cause unknown; one action used
Next-step decision
Given the new state, what comes next?
Check Lab C schedule; if unavailable, ask a person
A reasoning step is thought; it changes nothing in the world until an action is taken
An observation is not chosen by the agent; it is whatever the environment returned
A state update should record only what was observed or done, not what is hoped
A next-step decision should follow from the state, not repeat the previous one by habit
Weak trace
Reasoning and result are blended into one sentence
The state is never written down
A next step appears with no link to what was seen
Readable trace
Each part is labeled and separate
The state is updated after every observation
Each next step follows from the state, and a person can check it
Check yourself
A trace line reads: "The tool returned an error, so the record does not exist." Which part is mixed up?
Key takeaway: Keep reasoning, action, observation, state update and next-step decision separate, so every step can be checked.
10 min
Choosing an action, and how AI 201 fits
Many ReAct actions use a tool. Two different questions are involved, and they belong to two different courses.
AI 201 asks
What tool can the agent use safely?
What data may it reach, with what permission?
Which actions need confirmation from a person?
AI 202 asks
When and why should the agent choose that tool?
What evidence in the current state points to it?
What is the expected outcome, and what if it fails?
This course does not teach how tools are built or connected. It assumes the safe tools have been set up, as in AI 201, and focuses on the decision to use one.
Evidence-driven tool choice (simulated)
Situation in the state
Reasonable action
Why
Need a number that is stored in a table
Read the table
The evidence needed is exactly there and reading is reversible
Two sources disagree
Look for a third source, or ask a person
Choosing silently would hide the conflict
The next action would send data outside the team
Stop and ask for approval
Irreversible and external, so a person decides
The needed tool is not available
Say so and choose another approach or escalate
Do not invent a result
Info
Human-AI-Human: a safe tool is a permission, not an instruction. The agent should have a reason for each use, the reason should be visible in the trace, and a person should confirm actions with real impact.
Check yourself
Which statement separates AI 201 from AI 202 best?
Key takeaway: AI 201 makes a tool safe to use. AI 202 decides when and why to use it, based on evidence in the current state.
Error propagation
10 min
Error propagation in a loop
Because each turn builds on the previous state, a mistake early in the loop can spread. A wrong reading of an observation becomes a wrong state, which shapes the next reasoning step, which shapes the next action. This is error propagation.
How one early error spreads
Observation is misread: an empty file is taken to mean "no bookings"
State is updated wrongly: "no bookings last term"
Reasoning builds on it: "so the drop is total, look for a shutdown"
Action follows the reasoning: search for a shutdown notice
The wrong direction continues, and later steps look consistent with it
Text equivalent: the five stages run in a chain. A misread observation produces a wrong state; the wrong state produces a wrong piece of reasoning; that leads to a wrong action; and the agent continues confidently in the wrong direction because each later step is consistent with the earlier mistake.
Ways to limit error propagation
Habit
What it looks like
Keep observations separate from conclusions
Write down what came back before saying what it means
Check surprising results
An empty or extreme result triggers a second look, not a conclusion
Prefer evidence over assumption
If the state has an unverified assumption, mark it as unverified
Cap the loop
A step limit and a stop condition after repeated errors
Involve a person at key points
Escalate when results conflict or the next action has real impact
Info
Formal evaluation, verification and reflection are covered in a later module. Infrastructure for reliable recovery belongs to other courses (AI 301 and AI 302). Here the goal is only to read a trace and see where an error entered.
Check yourself
The agent reads an empty result and immediately concludes there is no data, then plans around that. What habit would have helped most?
Key takeaway: An early misreading spreads through every later step. Separate observations from conclusions, and check the surprising ones.
Practice and apply
12 min
Practice: Trace a ReAct Loop
Activity 3 asks you to trace a ReAct loop. First work the example, then do it for your own use case. Please do not enter real company secrets, client personal data or any unauthorized sensitive information in this exercise.
Worked example (simulated). Goal: explain why lab bookings fell this term
Turn
Reasoning step
Action
Observation
State update
Next-step decision
1
Do not know where the drop is; group by lab
Group the booking table by lab
Lab C down 40 percent; others flat
Drop is in Lab C; cause unknown
Check Lab C schedule
2
A closure or a schedule change could explain it
Open the Lab C schedule
Two weeks marked "under maintenance"
Maintenance overlaps the drop; not yet confirmed as the whole cause
Compare with last term
3
Need a baseline to see if two weeks explain 40 percent
Open last term bookings for Lab C
Last term had no maintenance; the drop equals two weeks of lost bookings
Maintenance explains most of the drop
Write the note and ask a person to confirm the maintenance dates
1Identify the current goal State the goal of your use case in one sentence and the state you start from.
2Write the reasoning decision and choose an action Write why you would do the next thing, then name one action from your available actions.
3Inspect the observation and update the state Write what came back exactly, then what is now known and not yet known.
4Decide the next step Choose the next action from the new state. Repeat for at least three turns, and note where a person should confirm.
Reasoning step: why, given the state
Action step: what the agent does
Observation: what came back, unchanged
State update: what is now known and done
Next-step decision: what follows from the new state
Info
Deliverable: the ReAct Trace, a table of at least three turns with the five parts labeled. It becomes part of your Agent Planning & Reasoning Canvas.
In your trace, which entry belongs in the Observation column?
Key takeaway: Human-AI-Human: a person defines the goal and limits, the agent reasons and acts step by step with a visible trace, and a person reviews the trace and stays responsible.