Module 1 gives REVIEWBOT two things every agent needs: memory and a way to show its work in real time.
An agent is a Durable Object
On Cloudflare, the Agent class is backed by a Durable Object. The key property is one instance per name: a given agent name always routes to the same instance. That instance has a stable identity and its own embedded SQLite storage, so state survives across requests, sessions, and days.
Typed state
REVIEWBOT models its work as a Review, defined with Zod: identifiers, a status, a riskTier, a verdict, and an array of findings where each finding has a severity, file, line, category, and message. Typed state keeps the agent, the workflow, and the UI agreeing on one shape.
State that broadcasts itself
Calling setState does two things at once: it persists to the Durable Object’s SQLite table, and it broadcasts the new state to every connected WebSocket client. You write no database code and no polling loop.
The live findings panel
Because state broadcasts, the findings panel in the browser updates within a second of any change, even changes made later by a background workflow. That real-time loop is what makes REVIEWBOT feel alive.
When you are ready, open the Foundations exercise to build it.