AI Engineer Path

Concept Lab · Week 34 · AI Engineer Track

The ReAct agent loop

Thought → action → observation, including a failing tool and a retry.

The idea: Planning and reasoning: the ReAct loop

ReAct interleaves reasoning traces with actions. The model writes a thought ('I need the order date first'), emits an action (a tool call), receives an observation (the tool result), and continues reasoning with that new information.

Reasoning keeps the plan coherent; acting grounds it in real data and reduces hallucination. Modern tool-calling APIs implement this loop natively; the 'thoughts' may be internal reasoning.

Failure modes to design against: loops (calling the same tool repeatedly), premature stopping, hallucinated tool arguments, and over-trusting a bad observation. Step through a run, including a failing tool and a retry, in the simulation.

Open the full lesson in week 34