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
