LangGraph fundamentals
State, nodes and edges: your first graphs and a first chatbot.
LangGraph runs an LLM application as a graph: steps that share one state, and edges that decide which step runs next, loops included. This module starts with the ideas (what a graph is made of, how a run proceeds, and when a graph beats a chain or create_agent), then builds a first graph with no model at all, then a chatbot whose conversation lives in the state, ending with the chatbot in one script with Gemini. Run the notebook cells in order, and try each practice task before you open its solution.
Lessons
- 1Introduction to LangGraphWhy agents outgrow chains, what LangGraph is and where it fits, state, nodes and edges, chains as DAGs and graphs with loops, how a run proceeds in super-steps, what the runtime adds, when to use it, interview questions and two practice tasks in plain Python.
- 2Your first graphInstall LangGraph, define a TypedDict state, write nodes that return updates and a routing function with a Literal hint, build and compile a StateGraph, draw it, invoke it, follow the state through a run, the mistakes compile catches and those it doesn't, interview questions and two practice tasks.
- 3A chatbot graphMessages in the state, reducers and add_messages, MessagesState, a chat model inside a node, invoking and streaming the graph, why it forgets between runs, how it compares with create_agent, the chatbot in one script with Gemini, interview questions and three practice tasks.