An agent harness with a memory module bolted on, trailing a long receipt

Building an AI Agent from Scratch, Part 3: Memory, the Plan, and the Bill That Comes With Both

In Part 1 we built the loop. In Part 2 we handed the model some knives — tools, sandboxed so it couldn’t read your SSH keys. Both parts leaned on a thing I kept gesturing at and refusing to explain: the Session object. The agent’s memory. Time to explain it. Here’s the uncomfortable foundation everything in this post sits on: The model remembers nothing. Each call to Bedrock is a blank slate. The model that answered your last question has no idea it ever existed. It is a brilliant amnesiac, waking up fresh every single time, and the only reason it appears to “remember” the conversation is that you shove the entire transcript back in front of it on every request. Memory isn’t a model feature. It’s a thing your harness does, by hand, at a cost. And the bill — we’ll get to the bill. ...

June 12, 2026 · 10 min · Ken Kitts
An agent harness reaching across a network to a remote rack of tools behind a locked door

Building an AI Agent from Scratch, Part 4: Remote Tools, or Trusting a Knife You Didn't Forge

In Part 2 we forged our own knives: a calculator that parses an AST instead of calling eval, file tools locked in a sandbox, every input frisked by code we wrote and could actually read. We trusted those tools because we built them. This post is about handing the model a knife from a stranger’s kitchen, sight unseen, and saying “go nuts.” That’s the Model Context Protocol, or MCP. It lets a tool live on someone else’s server, behind a login, and still show up on the model’s menu like it grew there. And here’s the part that should make the back of your neck prickle: ...

June 12, 2026 · 11 min · Ken Kitts
An agent harness wired up to a set of tools

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. ...

June 10, 2026 · 12 min · Ken Kitts
An agent harness wrapping a language model

Building an AI Agent from Scratch, Part 1: What Even Is an Agent Harness?

You’ve seen the demos. AI agents booking flights, writing code, querying databases, probably filing your taxes while whispering sycophantic flattery. Very impressive. Very “the future is here, and it’s kinda scary.” Here’s the simple secret nobody mentions in the keynote: LLMs can only produce text. That’s it. They can’t run code. They can’t check the time. They can’t read a file. They are the world’s most confident interns — full of opinions, zero ability to actually do anything. All they do is predict the next token and hope you’re impressed. ...

June 8, 2026 · 7 min · Ken Kitts