You use AI agents every day, but an agent isn’t an LLM. It’s an LLM wrapped in a harness of plain code. In this video, Stephen Gruppetta builds that harness from scratch in Python with the OpenAI API and shows the single change that turns a chatbot into an agent.
You’ll start with one chat-completion call that can’t see your files. Then you’ll add a loop, a growing message history so the model remembers the conversation, and tool definitions so it can ask the harness to list and read files. The last step swaps an if for a while, and the model starts chaining tool calls on its own until it has an answer.
By the end, agents like Claude Code and Codex stop being a mystery: you’ll know what they send to the model, why long conversations get expensive, and where permissions and memory fit in.
Resources mentioned in this lesson:
Tutorial
Pydantic AI: Build Type-Safe LLM Agents in Python
Learn how to use Pydantic AI to build type-safe LLM agents in Python with structured outputs, function calling, and dependency injection patterns.