AI / LLM Integration
Agents: multiple-choice review
Six questions that cut across the whole unit. Each mirrors a decision you make designing or debugging a real agent — not a definition to recite, but a tradeoff to weigh when the loop is running on someone’s bill.
Confirm you can connect the loop mechanics, the economics of growing context, the several exits a loop needs, error-recovery hygiene, and the scripted-vs-agent call — the synthesis the lesson built toward.
A task that takes 5 agent steps costs about $0.05. The same agent on a 15-step task costs about $0.40 — roughly 8×, not 3×. Why?
An agent request that should cost $0.08 ran nine minutes and burned $12. The trace shows search_orders called 142 times with identical arguments, each returning the same empty result. No exception was thrown. What is the root cause?
A support flow always does the same three steps: look up the order, check refund eligibility, issue or deny the refund. A teammate proposes an open-ended agent with all three tools and recursion_limit=25. What is the better design and why?
A senior says 'treat the max-step cap as a seatbelt, not a steering wheel.' What does that mean operationally?
A long-horizon agent reaches step 40, and the history has grown past the model's context window. The framework silently truncates the oldest messages. What is the most likely consequence?
When a tool call fails, the common pattern is to feed the error text back to the model as the next observation. Why is this both a superpower and a trap?
The through-line is one design discipline: the loop re-sends its whole history each turn, so cost is quadratic in steps and a long run overflows the window and drops its own instructions. A naive loop has a single exit the model may never reach, so you add independent ones — natural stop, a step cap (the seatbelt), a wall-clock/token budget that actually caps the dollar figure, and a dedup/progress check that kills thrashing. Error-feedback is the recovery superpower and the runaway trap; bound it with per-tool retry caps. And before any of that, ask whether the path is known — if it is, script it, and reserve the open-ended agent for steps you genuinely cannot enumerate in advance.