Acadbyte
Start free

Agents & Tool Use

The moment a model can do something instead of just say something, a 95%-accurate step stops being good news. Why?

Advanced8 min2 concepts · 1 question · 1 card

From answering to acting

Everything so far has the model producing text for a human to read. An agent produces text for a machine to act on — then reads what happened and decides what to do next.

The mechanic is unglamorous. You describe some tools in the prompt:

search_orders(customer_id, status) -> list of orders
issue_refund(order_id, amount)     -> confirmation

The model, instead of answering, emits a request to call one:

search_orders("c_8812", "shipped")

Your code — not the model — runs it, and puts the result back in the context. The model reads the result and either calls another tool or answers.

That loop, repeated, is an agent:

observe -> decide -> act -> observe -> decide -> ...

Two things follow immediately

The model never executes anything. It writes a request. Your code decides whether to honour it. Every guarantee you have lives in that gap — this is the most important sentence in the topic.

The loop needs a stopping condition. Nothing in "predict the next token" produces "I'm done." You cap the iterations, or you pay for a model that calls search_orders forty times in a row because the results never quite satisfied it.

The rest of this topic comes with a free account

Reading stays open to everyone. The questions, the cards and the review schedule need somewhere to remember you — that’s all an account is for here.

Or start with the free track, which needs no account at all.

Next in GenAI in Practice

Structured Outputs & Function Calling

'Respond only with JSON' works 299 times, then breaks your parser at 2am. What makes it impossible to break instead of merely unlikely?

Read the preview