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

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

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

Tool descriptions: how an AI agent picks the right tool

An AI agent can have dozens of tools: weather, calendar, email and more. The AI model never sees the code of any tool. So how does it know which tools exist, and which one to use?

  1. 1 Look at everything the app sends the model with your question. Above your words sits a list you never typed: the tools the app can run.toolsweathercalendarmessageswebWill it rain at thepark on Saturday?the model

    Look at everything the app sends the model with your question. Above your words sits a list you never typed: the tools the app can run.

  2. 2 Each tool gets a name, a few plain words on what it does, and the blanks a request must fill. This is the tool description.weatherGives the forecastfor a place and a day.place:day:tool descriptiontool: weather

    Each tool gets a name, a few plain words on what it does, and the blanks a request must fill. This is the tool description.

  3. 3 The model reads that list the way it reads any text. Your question is about rain, and that fits the words of the weather tool best, so it asks for that one, and fills the blanks with the park and Saturday.weathercalendarmessageswebWill it rainat the parkon Saturday?the modelrequesttool: weatherplace: the parkday: Saturday

    The model reads that list the way it reads any text. Your question is about rain, and that fits the words of the weather tool best, so it asks for that one, and fills the blanks with the park and Saturday.

  4. 4 The model never sees the weather program itself. It knows the tool only from what the app writes about it, so those words decide.weatherGives the forecastfor a place and a day.place:day:the modelWords areall I get.the appthe weatherprogram

    The model never sees the weather program itself. It knows the tool only from what the app writes about it, so those words decide.

  5. 5 Give the weather tool a vague line, and the model may skip it, or pick the wrong tool. That is why people who build agents write these lines with great care.weatherdatawebFinds pageson the web.the model?

    Give the weather tool a vague line, and the model may skip it, or pick the wrong tool. That is why people who build agents write these lines with great care.

  6. 6 Now you ask for more: if it rains on Saturday, move the picnic to Sunday and tell Miva and Rono. That takes three tools, one after the other.youIf it rains onSaturday, movethe picnic toSunday and tellMiva and Rono.1weather2calendar3messagesweb

    Now you ask for more: if it rains on Saturday, move the picnic to Sunday and tell Miva and Rono. That takes three tools, one after the other.

  7. Quick check

    A trip to Rome.flightsFinds flightsbetween twocities on a day.hotelsFinds rooms ina city for somenights.Where can I sleepin Rome on Friday?Which tool doesthe model askfor, and why?

    A trip to Rome.

    Show the answer

    Hotels. The model compares what you ask with what each description says, and sleeping fits rooms, not flights.

  8. Go further

    Two more things about the list.place:day:parametersThe name of the blanksa request must fill,like the place andthe day fewer tools,better picksWith a long list, themodel chooses lesswell. OpenAI advisesfewer than about 20tools at a time. An appcan hold the rest backuntil they are needed

    Two more things about the list.

Next episode The agent loop: how an AI agent keeps going until the job is done

Share this comic

More comics