What is LangGraph?

LangGraph turns an agent's control flow into a graph you draw: shared state, nodes and edges. What that buys you (inspectable state, checkpoints you can resume, human approval as a step), a minimal graph in Python, and where it sits beside LangChain.

GazeekAI AGENT FRAMEWORKS, EXPLAINED·LESSON 2
LESSON 2

What is LangGraph?

LangGraph turns an agent's control flow into a graph you draw: shared state, nodes and edges. What that buys you (inspectable state, checkpoints you can resume, human approval as a step), a minimal graph in Python, and where it sits beside LangChain.

0:00 / 3:30

Diagrams in this video · 3Free in archhy

Copy and edit in archhy: An agent's loop, written down (new tab)
Copy and edit in archhy: What explicit state buys you (new tab)
Copy and edit in archhy: Where it sits (new tab)

After this lesson you can

  • Describe LangGraph as state, nodes and edges
  • Name the three things explicit state buys you
  • Read a minimal LangGraph graph in Python
  • Place LangGraph beside LangChain, Deep Agents and LangSmith
Transcript

What is LangGraph?

Space Llama here. Last time, LangChain: the parts. Today, LangGraph: the order they run in. And why writing that order down might save your agent the first time it falls over halfway.

An agent's loop, written down

LangGraph is a low-level orchestration framework, and a runtime, for long-running agents that keep state. You declare three things. The state the steps share. The nodes, which are the steps that exist. And the edges, which say which moves from step to step are allowed. So the agent loop stops being hidden inside a framework. It becomes a graph you drew. And one graph can mix steps a model decides with steps your own code decides.

A minimal graph

Here's the smallest graph, from LangGraph's own docs. Notice it imports LangGraph alone. It doesn't need LangChain. A node is a plain function. It takes the state, and returns an update to it. This one pretends to be a model and says hello world. The state here is a list of messages. Add the node, then the edges: from start into the node, and from the node to the end. Compile the graph, and you have something you can run. Invoke it with a starting state. In a real agent, the nodes call a model and tools, and edges can branch on what the model decided.

What explicit state buys you

So why bother drawing the graph? Three things fall out of it. First, inspectable state. You can see what the agent knew at each step. Why did it do that becomes reading, not archaeology. Second, durability. Because the state is explicit, a run can be checkpointed and resumed. That matters enormously the first time a long-running agent dies halfway. Third, deliberate human gates. A pause for someone's approval is a step in the graph, not a hack bolted on.

Where it sits

Here's how the family fits together, in LangChain's own words. Deep Agents is a ready-made harness on top: planning, subagents, file tools and context management. LangChain is the agent framework: integrations for models and tools, and the agent loop. Its agents are built on LangGraph. LangGraph is the runtime underneath: durable execution, streaming, human-in-the-loop and persistence. And LangSmith traces and evaluates runs from any of them.

When to reach for it

Reach for LangGraph when the cost of an unexpected step is high enough that you want the permitted steps written down. Long-running agents, approvals, and runs you must be able to resume. For a standard agent loop, LangChain's create agent already runs on LangGraph, so you may never touch the graph yourself. And if the steps are genuinely linear, you need neither. Plain code will do.

Remember

Let's recap. LangGraph describes an agent as state, nodes and edges: a graph you drew. That gives you inspectable state, durable runs you can resume, and human approval as a step. It works without LangChain. Use it when the steps an agent may take have to be written down.

The full article, and what's next

The full article, LangChain versus LangGraph, is free on Alpaca Mango. The link is below. Next lesson: LangChain versus LangGraph. Which one do you actually need? See you there.

Read the article

LangChain vs LangGraph: what's the difference?: the whole idea in writing, free.

Read it ↗