LangGraph tutorial: Python setup, tools and agent memory

Build LangGraph workflows step by step, from string state to tool loops and MemorySaver, with uv setup and OpenAI API calls.

Player not loading? Watch on YouTube

This LangGraph course builds small Python examples to explain how state moves through nodes and edges. It starts with a string and a greeting function, introduces TypedDict state, then adds conditional routing. The speaker compares LangGraph with LangChain and says explicit graph control helps him inspect each step of larger workflows.

Setup covers VS Code, uv, a virtual environment, environment variables and API keys. The speaker recommends Python 3.11 through 3.13, while the description lists Python 3.12+. A langgraph.json file connects the examples to the development interface for graph inspection. The graphs run locally, but the model examples call OpenAI's API and require an API key and funded access; this is not an offline model tutorial.

Later examples use MessagesState to maintain conversation messages and bind a multiplication tool to a chat model. The course separates a model's tool request from execution through ToolNode, then uses tools_condition to route requests. A math AI agent adds addition and subtraction and returns tool results to the model so it can produce a final response or request more work. The final example introduces in-memory checkpointing with MemorySaver and a thread_id configuration to keep conversation state associated with a thread.