Complex · Giving an agent something to stand on
Letting the agent choose when to look
Now the order agent may call search_handbook itself, when it decides it needs to. That makes its path harder to predict, in steps and in spend. So code sets a search cap: the most searches one task may make. The agent also needs a plain rule for when it is done. At the cap, it gives what it has found or hands the task to Milo.
Example
Maple Mart order agent, one task: reorder for the long weekend search 1 search_handbook: bakery holiday days found search 2 search_handbook: dairy holiday days found search 3 search_handbook: dairy holiday days the same again search cap: 3 searches a task -> stop, and pass Milo what it found so far
Try it Yourself
The search cap is 3. The agent has searched 3 times and is not done. What does it do next? Write one short sentence.
Exercise
Where does the search cap live?