ReAct (Reasoning + Acting) Prompting (original) (raw)

Last Updated : 13 May, 2026

ReAct (Reasoning + Acting) is a prompting technique where an AI combines step-by-step reasoning with actions, allowing it to think through a problem and take steps to solve it.

Working

react_reasoning_acting_workflow

Workflow

**1. Combining Reasoning and Action

**2. Sequential Steps

**3. Making Decisions

Example

Let's take examples to understand this better:

**Prompt 1: "If I have 10 apples and I give away 3 apples, how many apples do I have left?"

**Without ReAct (Single Reasoning):

**With ReAct Prompting (Reasoning and Action Together):

**Final Answer: It shows both reasoning and action which helps in making problem-solving process more interactive and step-by-step.

**Prompt 2: "You have a basket of 12 oranges and you buy 5 more. How many oranges do you have now?"

**Without ReAct (Single Reasoning):

**With ReAct Prompting (Reasoning and Action Together):

**Final Answer: It shows both reasoning (12 + 5) and action (adding the oranges) which makes the solution more interactive and helps in explaining the steps clearly.

How ReAct Models Learn from Thought-Action Sequences

ReAct models learn through a method called few-shot prompting where they learn from a small set of examples and apply that knowledge to new tasks. Here's how it works:

  1. **Learning from Combined Reasoning and Actions: Model is trained to combine thinking and acting. It learns how to think about a problem and take immediate actions based on its reasoning which helps in taking appropriate action similar to how humans solve problems.
  2. **Linking Reasoning and Action: After each action model evaluates if the result is same as expected or not if not then it adjusts its next action based on that feedback.
  3. **Adapting Knowledge to New Tasks: Through few-shot learning model can apply the reasoning and action process to new situations while adjusting to tasks it has never seen before.
  4. **Dynamic Flexibility in Decision-Making: Model is capable of adjusting its reasoning and actions based on real-time feedback. When an action doesn’t lead to the expected result then it learns to modify its next step by considering different actions.
  5. **Enhancing Learning with Fine-Tuning: Fine-tuning helps it in refining the reasoning and action-taking abilities which helps in increasing the model’s accuracy in real-world applications.

**Advantages

**Limitations