11.02

LangGraph: state, nodes, and edges

skillmaxingPython with AILangGraph: state, nodes, and edges
Visual lesson

LangGraph: state, nodes, and edges

Included with Pro · 4:05
Lessons · 937 words

create_agent gave you one loop with one shape: model, maybe tools, model again. Real workflows have other shapes. Relay needs to classify a ticket before answering, take a different path for a high-severity one, and later pause for a person. LangGraph is the layer underneath create_agent that lets you draw that shape yourself. It has three parts, and they are smaller than the name suggests.

State is a typed dictionary that flows through the run. Nodes are ordinary Python functions that receive the state and return the keys they changed. Edges say which node runs after which, either fixed or decided by a function that looks at the state. The runtime does the rest: it merges each node's update into the state, follows the edges, and stops when it reaches END.

Pro

Continue reading

Pro unlocks every video lesson, the full notes and runnable code across the Python with AI course, from the language itself to agents, MCP, Langfuse and deployment.

Unlock full access to
Python with AIAI researchComplete system design
30% off with LAUNCH30ends in 7h 40m
Buy now
View all plans ·Already Pro? Sign in
124 online