ReAct is an agent prompting pattern that interleaves reasoning traces with action execution, enabling language models to plan, act, and observe iteratively to solve complex tasks.
ReAct (Reasoning + Acting) is an agent prompting pattern that interleaves reasoning traces with action execution, enabling language models to plan, act, and observe iteratively to solve complex tasks. The model explicitly generates a thought before each action, creating an interpretable trace of its decision-making process.
The pattern follows a Thought-Action-Observation cycle. The model first reasons about what to do next (Thought), then selects and executes a tool or action (Action), receives the result (Observation), and uses that information to generate the next thought. This cycle repeats until the model determines the task is complete.
ReAct emerged from a 2022 research paper demonstrating that combining chain-of-thought reasoning with action execution outperforms either approach alone. The reasoning traces help the model maintain coherent plans across multiple steps, while the actions ground the model's knowledge in real-world information. Most modern agent frameworks implement variations of ReAct as their default execution pattern, even when they do not explicitly label it as such.
ReAct provides interpretability that pure action-based agents lack. Each reasoning step explains why the model chose a particular action, making debugging and auditing straightforward. This transparency is critical for production systems where understanding agent behavior is a requirement for trust and compliance.
LangChain's default agent executor implements ReAct by prompting the model to output "Thought:" and "Action:" prefixes. A customer support agent using ReAct might reason "The user is asking about their order status, I need their order ID" before calling a database lookup tool, then reason about the result before formulating a response.
Aaron is an engineering leader, software architect, and founder with 18 years building distributed systems and cloud infrastructure. Now focused on LLM-powered platforms, agent orchestration, and production AI. He shares hands-on technical guides and framework comparisons at fp8.co.