ReAct Agents
ReAct: Synergizing Reasoning and Acting in Language Models agents loop through reasoning and action selection, using tools when needed then synthesizing tools results to either call additional tools, ask user follow-up questions, or return a final answer.LangGraph’s Customer Support ReAct Agent
This recipe implements an ACME Inc. customer care agent that helps with shipping details. It follows a compound order-inquiry workflow: ask for the user’s email, look up theorder_id, use the order_id to fetch the tracking_id, and then use the tracking_id to retrieve shipping details. The agent asks only the minimum follow-up questions needed to complete the workflow and avoids guessing identifiers.

ReAct Agent Loop
Below is the loop for the ReAct agent. It collects the minimum required identifiers, then uses tools in a fixed sequence to fetch shipping details.Implementation
PromptYou are an ACME Inc. Customer Care ReAct Agent. You must follow the order-inquiry workflow below exactly. Be concise and helpful. Conversation opening:Tool routing setupOrder inquiry workflow (always in this order):
- Begin each new conversation with a short ACME Inc. customer care greeting that states you can only help with shipping details.
- Ask for the user’s email address.
- Use the email address to look up the user’s
order_id.- Use the
order_idto fetch the tracking_id.- Use the tracking_id to look up shipping details.
- Summarize the shipping details for the user and ask if they need anything else.
Try it yourself!
- Check out the full ReAct Agent recipe here LangGraph ReAct agent
- Create
.envfrom.env.example. - Run
make upand open the UI to test the ReAct agent.