How AI agents actually work, explained from first principles.

Explaining Agents is a technical blog for developers, engineers and curious builders who want to understand what an AI agent really is underneath the hype. An AI agent is a large language model called in a loop, with ordinary software running its tools and feeding the results back. Each post here takes one piece of that system and builds it up from the basics, with diagrams, worked examples and short, runnable Python you can try yourself.

The series starts with the agent loop and moves on to the parts every real agent needs: tool use and function calling, the harness that decides when to stop, context windows and token costs, memory, multi-agent setups and evaluation. The goal is always the same: derive the idea, test it, and say plainly where it breaks.

New here? Start with What Is an Agent Loop? How an AI Agent Actually Runs, which builds a working loop in about 30 lines of code.

What Is an Agent Loop? How an AI Agent Actually Runs

Abstract illustration of a loop with a model at its center, framed by surrounding software.

An agent loop is a language model called over and over, with ordinary software carrying out its actions and feeding back the results. This post builds the loop from first principles: the equation, the harness that must decide when to stop, why tokens read grow with the square of the steps, a traced run, and about 30 lines of Python you can run offline.