ReAct Prompting

Domain: Prompt Engineering

🎯 Motivation

Reasoning + Acting: the model alternates between thinking (reasoning) and taking actions (calling tools, searching) to solve complex tasks.

πŸ“‹ Concrete Example

Thought: β€˜I need to know the weather.’ Action: search_weather(β€˜Hong Kong’). Observation: β€˜28C, sunny.’ Thought: β€˜Now I can recommend outdoor activities.’ Action: generate_response().

πŸ”— Analogy

A detective solving a case - they think (reasoning), then act (interview a witness), then think again based on what they learned. ReAct makes the LLM alternate between thinking and acting.