Worked example: a research agent
Watch the loop and every guardrail work together on one realistic task.
Let us put the whole module together on one realistic task and watch every piece work at once. The goal: produce a short, sourced brief answering "what are the leading approaches to X, with at least three credible sources that agree on the basics."
The setup (before the loop runs).
- Goal: a brief with at least three credible, agreeing sources.
- Stop condition: stop when three sources agree on the basics and the brief is written.
- Step limit: at most, say, 12 search-and-read actions.
- No-progress rule: if three searches in a row turn up nothing new, stop and report what was found.
- Powers: read and search only. It cannot send, post, or spend. The finished brief is shown to a human before it goes anywhere.
The loop in action.
- Think: I need current sources on X. Act: search. Observe: five results, two look credible.
- Think: read the two credible ones. Act: open them. Observe: they agree on the basics; I have two of three.
- Think: I need a third independent source. Act: search a different angle. Observe: a strong third source that agrees. That is three.
- Think: my stop condition is met. Act: write the brief, citing the three. Observe: brief is complete.
- Stop — the goal is reached, well under the step limit.
Now watch a guardrail save the run. Suppose at step 3 the searches keep returning the same two sources and nothing new. The no-progress rule trips after three empty tries: the agent stops and reports "I found two agreeing sources but could not find an independent third — here is what I have, do you want me to broaden the search?" Instead of looping forever or inventing a fake third source, it escalated to you. That is a good failure.
And the human checkpoint. Because the agent only reads and drafts, the brief it produces is a proposal. You read it, check the sources are real, and only then use it or publish it. The consequential step — putting the brief in front of others — stayed with you.
What this shows. A useful agent is the loop (think, act, observe, repeat) plus a clear goal, plus the three guardrails (step limit, stop condition, no-progress detection), plus a human in the loop for anything consequential, plus the fewest powers needed. That is the whole recipe, and it is the same recipe whether the task is research, coding, or inbox triage.
Recap. On a research task, the loop runs think-act-observe-repeat toward a clear goal — gather three agreeing credible sources and write the brief — and stops when the stop condition is met, well within the step limit. When sources dry up, the no-progress rule makes the agent stop and ask rather than spin or fabricate, which is a good failure. And because the agent only reads and drafts, the finished brief is a proposal a human approves before it goes anywhere. Loop plus clear goal plus the three guardrails plus human approval plus least-powers is the complete recipe for a reliable agent.
Design your own agent on paper using the research-agent template. Write its goal, stop condition, step limit, no-progress rule, the minimum powers it needs, and the one point where a human must approve. If you can fill in all six, you can specify a reliable looping agent for almost any task.
Enjoying the free lessons? Get an email when we publish new courses and updates — no spam, unsubscribe anytime.
Discussion (0)
Ask a question or share what worked for you. Comments are reviewed before they appear.
No comments yet. Be the first to start the discussion!