< all projects28 steps · easy · Rebuild
An agent from scratch, step by step
You will have built a working tool-using agent with the standard library, one small function at a time: five functions that read a reply, four that survive a busy API, five that describe and run tools, four that make the loop, four that meter it, and six that read a run back and grade it. Each step is a few lines with its own tests, and the earlier functions are provided to the later ones, so the pieces compose without you re-implementing anything. The parts write six files; the ending assembles them and runs the agent over 20 scripted tasks. This is the same system as *An agent from scratch*, cut finer: that project asks for eight modules framed as tickets, this one asks for twenty-eight functions framed as questions.
Part 01 · 5 steps
Replies
Read what a model sent back.
Part 02 · 4 steps
Retries
Survive a busy API.
Part 03 · 5 steps
Tools
Describe a tool, and run the one the model asks for.
Part 04 · 4 steps
The loop
Call, act, observe, repeat.
Part 05 · 4 steps
The budget
Count calls and tokens, and price them.
Part 06 · 6 steps
The trace and the grade
Read a run back and score it.