liveBook · Manning

Graph

As explained in Hugging Face in Action

A graph is a structure consisting of connected nodes that represent stages and transitions in a workflow.

A graph models an agent workflow as connected nodes and transitions. In LangGraph, execution starts at __start__, moves through an agent node, and ends at __end__. The graph makes the agent’s execution path visible. section 9.4.2

A LangGraph agent graph can contain:

  • __start__ as the entry point, an agent node for processing input, and __end__ for returning the result. section 9.4.2
  • A tools node that executes an external tool when the agent decides it needs current information. section 9.4.3
  • State containing the message history, including user, AI, and tool messages. section 9.4.2

Create a minimal agent graph

from langgraph.prebuilt import create_react_agent agent_executor = create_react_agent(llm, tools=[]) state = agent_executor.invoke({"messages": [("user", "Who is Bill Gates?")]}) print(state["messages"][-1].content) With no tools, the graph follows a simple linear path. Supplying a search tool adds a conditional transition from the agent to the tools node and back. section 9.4.3

How Hugging Face in Action covers it

How deep it goes
Explains linear and conditional execution paths, stopping short of custom graph construction internals.
Examples
Demonstrates a question-answering agent and a web-search agent through graph figures, traces, and message-state listings.
What it assumes
Assumes Python and an LLM setup, while introducing graph stages through a prebuilt ReAct agent.
What you can do after
Apply it via LangGraph to inspect agent paths and add conditional external-tool execution.
How it connects
Connects graphs with agents, nodes, transitions, state, ReAct, and external tools.

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.