ReAct is an agent architecture that interleaves reasoning with actions. Given a user question, the agent reasons about the next step, invokes a suitable tool, incorporates its result, and either calls another tool or produces a final answer. This dynamic loop handles tasks where the required tools, order, or parameters cannot be hardcoded in advance. section 11.2.1
Figure 11.1 The ReAct pattern alternates between reasoning and action, enabling the agent to process a user question by thinking, calling tools as needed, and following up with further reasoning before delivering the final answer.
The pattern alternates between reasoning and action: analyze the question, call tools when needed, reason over returned information, and conclude with a final answer. section 11.2.1
A practical ReAct implementation depends on explicit tool contracts and observable execution:
- Describe each tool with clear inputs, expected outputs, and usage conditions; type hints and docstrings can make Python tools discoverable to the LLM. section 11.10
- Let the LLM select and sequence tools dynamically, such as search_customer → get_orders → calculate_total, instead of hardcoding conditional routing. section 11.10
- Return structured dictionaries or lists when possible, so the agent can extract fields without parsing unstructured text. section 11.10
- Inspect state and LangSmith traces to see tool choices, arguments, intermediate results, reasoning steps, latency, token counts, and errors. section 11.10
Travel and accommodation assistant
A LangGraph ReAct agent can search travel information, retrieve weather, and check hotel or B&B availability. When a traveler asks about rooms in Penzance without naming an accommodation type, the agent checks both hotel and B&B tools, combines their results, and reports available rooms and prices. A prebuilt agent replaces custom graph wiring while retaining configurable tools, prompts, state, and remaining-step control. section 11.9.1 section 12.1.3










