LangGraphAcademy
Orchestrate Agents
Like a Corporate Team
LangGraph builds stateful, multi-actor applications with LLMs. Instead of a linear chain, build a cyclic graph where agents can loop, retry, and collaborate.
Live State
Idle
{
"messages": [],
"current_actor": "user"
}
Control Panel
Select a scenario to start…
Interactive Metaphor
Watch how the State (Project Folder) travels between Nodes (Employees).
Click ‘Simulate Retry Loop’ to see the Agent self-correct using tools.
Core Concepts Explained
The State
The “Project Binder”
Imagine a physical binder that travels between departments. In a typical Python script, variables are messy notes scattered on a desk. In LangGraph, the State is a structured binder.
Why it matters: Every employee (Node) receives the exact same binder. They read the history, add their new work (append a message), and pass it on.
This ensures Context Continuity—no matter how complex the loop gets, the current status is always strictly defined in one place.
Nodes
The “Specialized Employees”
Nodes are the workers. They can be LLMs, simple Python functions, or API calls.
- The Agent Node: The creative thinker (LLM) who decides what to do next.
- The Tool Node: The specialist who executes a task (e.g., a Google Search or Database Lookup).
They don’t know the full process; they just receive the State, do their job, and return an update.
Edges & Logic
Hallways vs. Managers
Normal Edge (The Hallway): A fixed path. When the “Researcher” is done, they always walk to the “Writer’s” office.
Conditional Edge (The Manager): A logic gate. The Manager stands in the hall, inspects the binder, and makes a decision:
“This draft is incomplete. Go back to Research. If it’s good, go to Publishing.”
This ability to loop back is what makes LangGraph powerful for self-correcting agents.
Checkpointer
The “Time Machine”
In standard Python scripts, if the program stops, memory is lost. A Checkpointer takes a snapshot of the “Binder” after every single step and saves it to a database.
Human-in-the-Loop: You can pause the graph before the “Publish” node. A human can open the Binder, edit the draft, and then click “Resume”.
Time Travel: If an agent makes a mistake, you can rewind the State to 3 steps ago and try a different path.