liveBook · Manning

ReAct

As explained in Hugging Face in Action

ReAct is an agent technique in which a language model alternates between reasoning, taking actions such as tool calls, observing results, and continuing reasoning.

ReAct is an agent technique that alternates between step-by-step reasoning, tool actions, observations, and continued reasoning before producing a final answer. It lets an agent select tools dynamically instead of requiring examples or task-specific training. section 9.3.1 section 9.4.2

Search agent with LangChain

Configure a SerpAPI key, wrap SerpAPIWrapper in a Tool with a descriptive name and input specification, then pass it to initialize_agent() with ChatOpenAI(model="gpt-4o-mini", temperature=0) and AgentType.ZERO_SHOT_REACT_DESCRIPTION. Invoking a question such as "Who is Wei-Meng Lee?" produces a trace containing a thought, Search action, search observation, and final answer. section 9.3.1

agent_executor = create_react_agent(llm, tools)

Create a minimal LangGraph ReAct agent with create_react_agent(llm, tools); add external tools when current information, computation, or retrieval is required. section 9.4.2

How Hugging Face in Action covers it

How deep it goes
Explains the reasoning-action-observation loop and basic execution traces, but does not develop deeper internals or training procedures.
Examples
Demonstrates web search, weather lookup, factual questions, arithmetic, and message-history traces.
What it assumes
Assumes basic Python and API-key setup while demonstrating tool construction and agent invocation directly.
What you can do after
Build it from scratch with LangChain or LangGraph, configure tools, invoke queries, and inspect the resulting agent trace.
How it connects
Connects tool calling with LangChain agents, LangGraph, state, message history, and external search APIs.

Also explained in

Compare how 11 books explain ReAct →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hugging Face in Action. The section links point to the parts of the book it draws on.