
Building an AI Agent from Scratch, Part 2: Tools, or How I Learned to Stop Worrying and Hand the Model a Knife
In Part 1 we established the simple truth: LLMs can only produce text. The harness is the babysitter that turns that text into action. Today we build the action part. The tools. The hands. This is the fun chapter, by which I mean it’s the one where we voluntarily give a probabilistic text generator the ability to touch the filesystem and then act surprised when it tries to read /etc/passwd. All the code below is lifted straight from the repo — a single agent.py file you can clone and run. Strap in. ...
