ReAct & Tool Prompts

ReActPrompt

Part of: Advanced Prompting Patterns

Ask a model "What's the weather in Tokyo right now?" and it cannot know, its weights froze months ago. But give it a way to act , and it can write "I should check the weather tool," call that tool, read the result, and answer correctly. The pattern that makes this work is ReAct : interleaving reasoning with actions. What it is ReAct stands for Reason + Act . It is a prompting pattern where the model alternates between two kinds of output: a Thought (reasoning about what to do next) and an Action (calling a tool, like a search, a calculator, or an API). After each action the environment returns an Observation , which the model reads before thinking again. The loop is Thought, Action, Observation, repeat, until the model has enough to give a final answer. This breaks the model out of its frozen, sealed box. Pure reasoning can only work with what's in the prompt and the weights. ReAct lets the model pull in fresh facts, do exact computation, and ground its answer in real tool output instead of guessing. How it works You prompt the model to follow a strict format, then run a loop in your code that watches for actions: Your code does the real work around the model: 1. The model writes a

Challenge: Run the ReAct Trace