You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

How AI agents work: an AI that can only write, and still gets things done

Tool calls: how an AI agent acts when its model can only write

Ask an AI assistant if it will rain tomorrow. It answers with the real weather forecast. But the AI model inside it can only write text, and it cannot go on the internet. So who got the forecast?

  1. 1 Saturday is picnic day at the park with your friends Miva and Rono. So you ask your assistant app: will it rain?youWill itrain at thepark onSaturday?your assistant app

    Saturday is picnic day at the park with your friends Miva and Rono. So you ask your assistant app: will it rain?

  2. 2 The app sends your question to the model, the program that writes the answers. It has no eyes on the sky and no hands for a button. All it can ever do is write text.the modelRain? I canonly write.

    The app sends your question to the model, the program that writes the answers. It has no eyes on the sky and no hands for a button. All it can ever do is write text.

  3. 3 So it writes something else: a short request in a form the app can read, with the tool, the place and the day. Then it stops and waits.the modelDone. NowI wait.requesttool: weatherplace: the parkday: Saturday

    So it writes something else: a short request in a form the app can read, with the tool, the place and the day. Then it stops and waits.

  4. 4 The app reads that request and does the work itself. It runs a tool, a small program with one job, here the weather. The request is a tool call.requesttool: weatherplace: the parkday: Saturdaytool callthe appWeather?I run it.tool: weather

    The app reads that request and does the work itself. It runs a tool, a small program with one job, here the weather. The request is a tool call.

  5. 5 The tool answers: rain from 2 pm. The app pastes this tool result under your question and sends it all back to the model.resultrain from 2 pmtool resultthe appWill it rain at thepark on Saturday?resultrain from 2 pmthe model

    The tool answers: rain from 2 pm. The app pastes this tool result under your question and sends it all back to the model.

  6. 6 The model reads the result like any other text and writes your answer. It never touched the weather: it asked, and the app did the rest. That pair is the heart of every AI agent. Yet you never told the model a weather tool exists.the modelRain from2 pm. Picnicin themorning?you

    The model reads the result like any other text and writes your answer. It never touched the weather: it asked, and the app did the rest. That pair is the heart of every AI agent. Yet you never told the model a weather tool exists.

  7. Quick check

    Lights out.Your app also has atool for your kitchenlight. You ask it toswitch the light off.Which programflips the switch?

    Lights out.

    Show the answer

    The app. The model only writes a request for the light tool, and the app runs it.

  8. Go further

    Two names you may meet.request function callingAnother name for atool call, used byOpenAI: the samerequest, the same stoptools on the company'scomputersSome tools, like a websearch, run on the AIcompany's computers.A program runs themthere, never the model

    Two names you may meet.

Next episode Tool descriptions: how an AI agent picks the right tool

Share this comic

More comics