TapinYour learning

Medium · How an agent uses a tool

The trace: every step, written down

Every step the agent takes is written to a trace. A trace line says which tool was asked for, the inputs, the result and how long it took. It also says how much model use the step spent. When the milk never comes, the trace says which of four things went wrong.

Video coming

Example

Milo: “The milk never came.” Four different causes: 1 wrong tool check_stock was called, not place_order 2 wrong amount cases: 0 was sent 3 blocked by check the values check stopped it 4 dairy failed the dairy’s system was down Maple Mart trace line place_order milk, 12 refused by the values check 0.2 s

Try it Yourself

The trace line says: place_order, milk, 12, refused by the values check. Which of the four causes is it?

Exercise

Why keep a trace of every step?

Project: Plan one weekly job at Maple Mart
Project: Wire Maple Mart’s reorder agent, from the tool to the gateway
Project: Make Maple Mart’s order agent production-ready