ReAct (Reasoning and Acting)
A way of building prompts that combines reasoning and action in an interactive problem-solving loop. The model alternates between reasoning stages (analyzing the situation, planning) and actions (carrying out concrete steps).
| Advantages | Drawbacks |
|---|---|
| Handles complex, multi-step tasks | Can be more time-consuming |
| Makes the decision-making process more transparent | Requires a more elaborate prompt structure |
| Adapts to changing conditions in the task | Can make intermediate steps harder to interpret |
Example of a ReAct prompt:
You are an AI assistant helping to plan a trip. Use the ReAct approach to help the user plan a week-long trip to Paris. At each stage:
1. Reasoning: analyze the current situation and decide on the next planning step.
2. Action: propose a specific action or ask the user a question.
3. Observation: evaluate the result of the action or the user's answer.
Start with a general question about the user's preferences and keep the process going until a full travel plan is in place.