Four different products are sold as agents and only one of them lets the model choose what happens next. Six topics define that one precisely, show the stateless function underneath it, price the open-endedness against a fixed pipeline, hand you Sundry and its support queue, and then build the whole thing in forty lines — followed by an honest list of the eleven things wrong with what you just built.
6 topics
An agent is a program that calls a model in a loop, hands it tools it may ask for, executes what it asks for, feeds the result back, and decides when to stop. Four steps of control flow, written by you, wrapped around a function that cannot remember anything and cannot execute anything. Everything an agent appears to be — memory, judgement, planning, restraint — is scaffolding around that call, and this chapter builds the smallest version of it that does real work.
The idea that makes the rest of the book predictable is the second topic here: the model is a pure function from a list of messages to one more message. Nothing is retained between calls, so every turn re-sends everything, and the bill, the context budget, the drift on long threads and the entire security posture all fall out of that single fact. Once it lands, most agent behaviour stops being mysterious and becomes a question about what was in the context.
The chapter ends on Sundry — an online marketplace for home and outdoor goods, 4,200 support tickets a week, nine internal tools, a policy library with 2,000 seller supplements nobody has read end to end, and Vera, who has been told to put AI on the queue. Her first agent is forty lines long, resolves 61% of a 120-ticket eval set at $0.41 a ticket, and is wrong in eleven named ways. Each of those eleven is a chapter later in this book.