Live
The agent loop, by hand with the raw SDK
Before any framework, build the loop yourself so you are never mystified by one. An agent is a model in a loop with tools: it thinks, picks a tool, calls it, observes the result, and decides again, until the task is done.
You will write this raw, with the plain SDK, no LangGraph, so you see the whole mechanism: the model proposes a tool call, your code executes it, feeds the result back, and loops. Once you have built the loop by hand, every agent framework is just ergonomics over this, and you can debug any of them.
Go deeper (optional)