Lesson 10 10 min

Add a check and a stop rule

Decide how a helper checks progress and when it must stop searching.

Learning goal

I can give a pretend agent a way to check an answer and a clear stopping point.

How it works

An agent can repeat a step if a tool gives an incomplete result. A check tells it whether the result meets the goal. A stop condition says when further tries must end. Both can be written before the agent starts.

Think of it like this

Think of looking for a missing art tool in two approved drawers. If you find it, you stop. If both drawers are empty, you ask the art teacher. A computer needs the allowed places, the success test, and the try limit spelled out.

Worked example

At Chalk Club, the job is to find this week’s glue count. The first sheet shows last week’s six. That fails the date check. The second has this week’s date but no number. That fails the count check. The two-try rule has been reached, so the agent reports both misses and waits for a person.

What to remember

Check what counts as success. Set a clear limit and report what happened when you stop.

  1. Look up the listRead one approved supply sheet.
  2. Did it answer the question?Look for this week’s date and the glue count.
  3. YesReport the count and finish.
  4. NoTry once more if allowed. Then stop and ask.
A check can say “try again,” but the stop rule puts a limit on that choice.Read a sheet and check the date and count. If both are present and current, report the count. Otherwise, try one more approved sheet if allowed. After two checks, stop and ask a person.

Key words

Agent
A system that can work toward a goal in steps, sometimes using tools. People decide which tools it can use and which actions need approval.
Stop condition
A rule that tells a helper when to end its work, such as after two tries or when a person says stop.
More AI Agents lessons

Activity

Run the two-try search

Materials Three fictional slips and a pencil.

  1. Write a slip “Last week: 6 glue sticks”, another “This week: count blank”, and a third “This week: 4 glue sticks”.
  2. Tell the helper to try at most two slips. Feed it the first two slips. Have it check the date and count and then say why it stopped.
  3. Reset and use the first and third slips. Try again. Compare the message the helper gives when it succeeds with the message it gives when it cannot finish.

Talk it through The helper can say it tried twice and did not find a usable count. That report gives the adult a next step.

Quick check

1. What should the check look for?
Answer and explanation

A date from this week and a glue count. Both checks are needed for the question about current supplies.

2. After two bad results, what should the helper do?
Answer and explanation

Stop and say what it checked. The stop rule limits the search. Reporting the miss lets a person decide how to continue.