How to Build a Reliable System Around an Unreliable AI Agent
The model will be wrong sometimes. Architecture decides whether that costs a retry or a customer: schemas, validators, state machines, idempotent actions.
Contents
Where do you put the deterministic parts so a bad generation cannot hurt you?
Should the model decide the control flow, or should your code?
How do you stop the model returning something you cannot parse?
What should a validator do when the output is wrong?
The pattern: a deterministic state machine with model-filled slots
How do you stop a retry from sending the same email twice?
When do you retry, and when do you stop and ask a human?
Where does the human approval gate go?
The boundary: what belongs to your code, and what belongs to the model
Frequently asked questions
Contain the agent before you scale it
buildAcademy teaches builders where to draw the boundary between deterministic code and the model, the same architecture we apply in every buildDay build.
See buildAcademyRelated Guides
Human Approval Before an Automated Send: The Legal and Engineering Case
Why anything your automation sends a customer needs a human checkpoint in Australia, the three approval patterns, and how to stop one becoming a rubber stamp.
AI Evals: How to Know Your Output Is Actually Right
A demo proves an AI feature can work. Evals tell you how often it does: what to measure, how many cases to start with, and where LLM judges quietly lie.
Multi-Agent Orchestration: What Works and What Just Multiplies Your Problems
Anthropic measured a 90.2% gain from multi-agent research. Stanford measured coding success halving with two agents. Both are right, and here is why.