Series · COMPLETE

Building an AI Agent

Nine parts, from the bare loop to a thing that survives contact with real tasks. Written while building it, not after.

09 / 09parts published

AI

  1. 01The Agent LoopCall the model, parse a tool call, run it, feed the result back. The whole mechanism takes an afternoon — everything else in this series is what happens after.
  2. 02How I Structure AI Agent ReposA clean, boring layout that survives an agent growing from one script into a system — and the one rule that keeps it clean.
  3. 03Tool Use: Giving the Agent HandsThe tool schema is a contract, not a suggestion. Most tool-calling failures are the contract being too loose, not the model being too dumb.
  4. 04How AI Agent Memory Actually WorksMemory in AI agents isn't one thing. It's a stack of storage, indexing, and retrieval systems that fail in different ways.
  5. 05Planning and Reasoning: When One Call Isn't EnoughOne tool call at a time works until the task has more than one step with a dependency between them. Then the loop needs an explicit plan, not just a next guess.
  6. 06Evaluation: How Do You Know It Worked"Looks right" and "is right" are different claims — an agent only checked by eyeballing the transcript will drift for weeks before anyone notices.
  7. 07Guardrails: Stopping the Agent From Hurting ItselfCapable and safe to leave unattended are different claims. Guardrails close the gap — permission boundaries, confirmation on the irreversible, and a cap on how much one bad turn can do.
  8. 08Observability: Watching an Agent ThinkPart four called episodic memory the layer most agents skip. This is that layer, built — every decision logged, because a silent failure is the only kind you can't debug.
  9. 09Shipping an Agent That Survives Contact With RealityNine parts from the bare loop to a system with real memory, evaluation and guardrails — what actually mattered, and the one layer that made every other layer debuggable.

navigate · open · esc close