The ReAct framework is inspired by the way humans can intuitively use natural language—often through our own inner monologue—in the step-by-step planning and execution of complex tasks.
Rather than implementing rule-based or otherwise predefined workflows, ReAct agents rely on their LLM’s reasoning capabilities to dynamically adjust their approach based on new information or the results of previous steps.
Imagine packing for a brief trip. You might start by identifying key considerations (“What will the weather be like while I’m there?”), then actively consult external sources (“I’ll check the local weather forecast”).
By using that new information (“It’s going to be cold”), you determine your next consideration (“What warm clothes do I have?”) and action (“I’ll check my closet”). Upon taking that action, you might encounter an unexpected obstacle (“All of my warm clothes are in storage”) and adjust your next step accordingly (“What clothes can I layer together?”).
In a similar fashion, the ReAct framework uses prompt engineering to structure an AI agent’s activity in a formal pattern of alternating thoughts, actions and observations:
After taking an action, the model then reevaluates its progress and uses that observation to either deliver a final answer or inform the next thought. The observation might ideally also consider prior information, whether from earlier in the model’s standard context window or from an external memory component.
Because the performance of a ReAct agent depends heavily on the ability of its central LLM to “verbally” think its way through complex tasks, ReAct agents benefit greatly from highly capable models with advanced reasoning and instruction-following ability.
To minimize cost and latency, a multiagent ReAct framework might rely primarily on a larger, more performant model to serve as the central agent whose reasoning process or actions might involve delegating subtasks to more agents built using smaller, more efficient models.