ReAct (reasoning and acting) is an agent framework that interleaves problem analysis with tool use. An LLM selects tools, observes their outputs, and iterates toward a solution rather than answering in one pass. section 13.4 section 13.5
A ReAct workflow typically involves:
- Analyzing the user’s task and breaking it into steps. section 13.5
- Selecting an available tool for the next step. section 13.4
- Executing the action and using its output to guide subsequent actions. section 13.5
- Repeating until the task reaches a solution or execution stops. section 13.4
A practical implementation needs an LLM, memory manager, and tool set. In smolagents, CodeAgent expresses actions as executable Python snippets; configured tools and safe execution rules constrain what it can do. Custom tools extend the workflow for domain-specific automation. section 13.4 section 13.5
Flight search and booking
Given “Find a flight from Dublin to New York and then select a seat,” an agent can call a flight-search tool, pass the selected flight to a seat-finding tool, and then invoke a booking tool. A sample run books flight DUB-JFK789 with seat B26. section 13.4
Figure 13.5 The logical workflow of CodeAgent
Shows the logical workflow connecting the model, memory, tools, generated actions, and iterative execution. section 13.4










