Week 12 — Lesson 1: State, nodes and edges

3 min

The NorthPeak agent of Week 11 was a single hand-written loop, and every new step made it harder to read. LangGraph is a Python library that builds such a workflow as a graph you can draw and inspect. A LangGraph workflow is one dictionary, the state, that travels through functions, the nodes, along arrows, the edges. This lesson introduces those three words and runs the smallest graph that works, then looks at the state of the Exercise 1 router.

Three words, one drawing

In Week 11 you wrote an agent loop by hand. It worked. It was also hard to read: one long while with if branches inside. LangGraph asks you to cut that loop into pieces and to draw the pieces.

Preview — the rest of the lesson is for enrolled readers.

Already enrolled with a code?

Your access is tied to your account, not to this link. Sign in with the same email you used in class: your course is waiting, no need to enter the code again.

Sign inNo account yet? Create one
This lesson is part of the “Week 12 — Stateful workflows with LangGraph” module

The first modules of the course are open to everyone. For the rest you have three options: buy this course once and for all, subscribe, or enter the code handed out in class.

Are you a student on this course?

The code is tied to your account: sign in or create an account and it will be applied automatically when you come back.

No account yet? Create one