17 patterns · 47 working examples
An AI agent's behavior needs written, versioned rules — like a contract — not scattered prompt tweaks nobody can audit or roll back.
17 patterns · 47 working examples
These aren't chapter titles — each one is an enforced rule your AI builds against. And the patterns don't just teach the shape: the working examples are real code that lands in your project.
Modeling an AI persona separately from which model providers back it
A memory graph deliberately kept narrow instead of open-ended
Recording an agent's reasoning steps without ever mutating history
Reconstructing a full agent turn from its individual model calls
How much an AI agent can do unsupervised, and who signs off on the rest
Letting a human take over an AI conversation and hand it back cleanly
Recurring AI agent work modeled as workflows instead of task fields
Structuring an agent's prompt so most of it can actually be cached
The control loop between a model and its tools, with real checkpoints
Swapping model providers without rewriting every call site
Giving an AI agent and a UI form the exact same tool, not two versions
Letting an AI agent navigate the app's real screens, not a shadow copy
Guardrails an agent can't argue its way around under pressure
Delegating work across a fleet of agents without one bottleneck plane
Keeping an agent's persona and limits from drifting under sustained pressure
Choosing an agent framework versus building the loop yourself
Nobody can answer "why did the AI do that" after the fact, because the behavior was never written down.