Subjects › AGI Agents (6-week course)

W3 · ReAct & tool use

The Thought → Action → Observation loop, JSON tool calls, and why tool descriptions are prompts.

The idea

ReAct interleaves reasoning and acting: the model writes a Thought, chooses an Action with arguments, and the runtime — not the model — supplies the Observation. Stop sequences stop the model inventing observations (F1). Tools should validate input and fail loudly, because a silent wrong result poisons every later step. In your repo: Week03_ReAct_LangGraph/react_agent.py, tool_use.py; Exercise 3.2 (make_unit_converter_tool).

Lesson

No lesson built yet. The worked solutions below are the material it would be assembled from.

Questions (5)

Question Type Difficulty Drift Accuracy
In react_agent.py, every model call is made with stop=["\nObservation:"]. What is that stop sequence for? mcq Easy -1.30 — — (0)
A ReActAgent (max_steps=6) has the repeated-action guard from react_agent.py: if the model proposes an (action… numeric Easy -0.60 — — (0)
In Exercise 3.2 you build unit_convert, which supports km↔miles and km/h↔m/s. Mid-run, the model calls it with… mcq Moderate 0.00 — — (0)
A local model ignores the stop sequence and returns all of this in one turn: Thought: I need the crew size. A… mcq Hard 0.90 — — (0)
Experiment B asks you to change kb_search's description to 'does stuff' while leaving its code untouched. Expl… short Very hard 1.50 — — (0)