ReAct (reason and act)

Also called ReAct, reason and act, reasoning and acting

A pattern where an AI alternates between thinking about what to do, taking an action with a tool, and checking the result.

ReAct, short for reasoning and acting, is a pattern for AI agents introduced in a 2022 research paper. The model works in a loop: it writes a thought about what to do next, takes an action such as a search or a calculation, receives an observation (the result), and then thinks again with that new information. The loop repeats until it can give a final answer.

The pattern combines the strengths of chain-of-thought reasoning and tool use. Reasoning alone can drift into confident guesses; actions alone can be aimless. Interleaving them keeps the model grounded in real results and lets it adjust its plan when something unexpected comes back.

Most modern agent frameworks and assistants with tools follow a ReAct-like loop, even when the thoughts are hidden. The idea is also useful for people: for debugging or research, ask the model to state a hypothesis, propose one check, wait for your result, and then update its view, instead of jumping to an answer.

Example

Question: "Is the CEO of the company that makes the Pixel phone older than 50?" Thought: the maker is Google; I need the CEO's age. Action: search for the Alphabet CEO's date of birth. Observation: the result gives a birth year. Thought: calculate the age from today's date. Answer, with the source.

Common mistake

Letting the loop run without limits. An agent can get stuck repeating searches or chasing a wrong lead. Set a maximum number of steps, ask it to summarise progress periodically, and stop to check when it starts repeating itself.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close