Skip to main content

Agentic AI

  • Audience years 7 and up
  • Duration 20 min
  • Runs on booklet, cutouts

Key idea: An agent is a model that runs tools in a loop. It pauses generation, hands off to something outside itself, and continues with the result spliced in.

Used in My First Language Model and Build, break, extend --- ready-to-run lessons and talks that include this module.

Turn your Language model A system that predicts what text comes next based on patterns learned from training data. Your hand-built grid or cutouts spread is a language model. View in glossary into an Agent A language model that runs tools in a loop to achieve a goal. Instead of generating text directly, an agent calls external tools and uses their results to continue. View in glossary . Nothing about the model changes: you add a rule for when to pause, what to ask, and how to carry on once the answer comes back.

You will need

  • any model you can generate from—a pre-trained booklet works best, but a grid or a cutouts spread is fine
  • dice, pen and paper as per Generation
  • at least one phone per group, and three friends or group chats who’ll reply within a few minutes

Your goal

Generate a passage in which every sentence ends with a tool call: the model writes until it lands on punctuation, you text a friend for what comes next, and the reply goes into the text. Stretch goal: design a tool of your own (see the variation below) and bolt it on the same way.

Key idea

In practice, calling a language model an “agent” comes down to Tool use The mechanism by which a language model calls external tools (calculators, search engines, databases, code runners) during generation. Modern LLMs output structured tool calls; in the unplugged activity, sampling a "trigger word" plays the same role. View in glossary : the model produces something that the system around it treats as a request, generation pauses, the request goes out to a tool, and the result is written back into the text before generation continues. The loop is generate → call tool → splice in the result → keep generating. Here the tool is a text message to a friend.

The recipe

  1. Generate from your model as usual, rolling for each next token.
  2. When you land on a punctuation token (., ,, !, ?), pause. That’s a tool call.
  3. Text What comes next? “[the sentence so far]…” (everything since the last full stop) to three friends or group chats.
  4. Write down the whole of the first reply, then the punctuation token you rolled.
  5. Continue generating from that punctuation token.

Replies take time. If none has arrived by the time you hit the next punctuation token, leave a gap and back-fill it when one does.

Worked example

Your text so far is “the cat sat”, and the next roll gives you .. Pause: that’s a tool call.

Text What comes next? "the cat sat..." to three friends. The first reply back is “down by the river”.

Write down by the river, then the . you rolled anyway, and carry on generating from .:

the cat sat down by the river. …

The punctuation is the trigger, the question plus the sentence so far is the tool’s input, and the reply is the tool’s result. The reply’s words probably aren’t in your model’s vocabulary, which is why you resume from the punctuation you rolled rather than from the friend’s last word: the model can always continue from ., but it has no row for river.

Instructor notes

Running it

  • brief the room on the recipe before anyone rolls, and walk the worked example slowly; steps 2 and 4 are where groups go wrong (forgetting to write the punctuation back in after the reply)
  • ten minutes is plenty; keep groups moving and circulate
  • groups without a willing friend can text a group chat, a colleague across the room, or use one of the tools from the variation below

Variation: trigger-word cutouts

For the cutouts flavour, and for groups who want to design tools as well as call one, add explicit trigger tokens to the model instead of using punctuation. Each tool has a trigger word, a capability and a return format:

Trigger wordToolCapabilityReturns
ACTIONa chosen personperform a small physical actiona word for what they did
GOOGLEsomeone with a phonesearch the web for a continuationone word from the top result
FRIENDeveryone texts a friendask them what comes nextfirst reply wins

Add the trigger cutouts to the spread where they fit contextually (GOOGLE after a or the, ACTION after we or I), each closing with a . on the same cutout so the chain resumes cleanly after the tool returns. The CLI does this for you: llms_unplugged cutouts -i data/<text>.txt -n 2 --tool ACTION --tool GOOGLE seeds each trigger at the corpus’s most common contexts and prints it black-on-gold so it can’t be mistaken for a corpus word. This is the version we run in Build, break, extend.

Other tools to try, on the same pattern: LOOK (an object in the room returns a word for what it is), NAME (the room points at someone), TIME (a clock), ASK (a designated expert returns a short phrase). In each case something outside the model returns some text, and a closing token brings you back.

Discussion questions

  • what did the tool calls add that the bare model couldn’t? did the friends’ words fit the text, or derail it?
  • how does the model “know” to call a tool? (it doesn’t—it just landed on the trigger)
  • who was running the loop? (you were: you decided when to pause, who to ask, and what to splice back in. Take that away and the agent acts on its own)
  • what would you be comfortable letting an agent do without asking you first? where’s the line, and why—reversibility, who gets blamed, whether you’d notice a mistake?
  • could a tool’s reply change what the model generates next? (here, no—see below)

Connection to current LLMs

“Agentic AI” has become a buzzword, but in practice it really just means tool use in a loop. As Simon Willison puts it, an LLM (Large Language Model) A language model trained on a very large amount of text, with billions of parameters. The hand-built models in these lessons are tiny language models; ChatGPT, Claude, and Gemini are large language models. The core principles are identical---the difference is scale. View in glossary agent is something that “runs tools in a loop to achieve a goal”—and that’s exactly what your model just did.

Tool use The mechanism by which a language model calls external tools (calculators, search engines, databases, code runners) during generation. Modern LLMs output structured tool calls; in the unplugged activity, sampling a "trigger word" plays the same role. View in glossary (also called “function calling”) is how modern AI assistants act in the world:

  • the agentic loop: generate → detect a tool call → execute the tool → feed the result back → continue generating, exactly like your punctuation-and-text cycle
  • the harness: the software around the model that pauses it, makes the call, and splices the result back in. In the room, that was you
  • structured calls: real models emit a JSON-formatted tool call (function name, arguments) rather than a full stop, but the mechanism is the same
  • examples: web search, code execution, database queries, sending an email, booking a flight, moving money
  • chaining: real agents make many tool calls in sequence, planning and adjusting as results come in

The key insight: the model doesn’t know anything the tool returns—it only learns when to ask. A real model does differ in one way: it reads the tool’s result and conditions on it, whereas your bigram carries on from the punctuation as if the reply never happened, because one word of context can’t hold it. Everything the friend contributed is in the transcript, but not in the model’s next choice. The In-context Learning module is where the text you’ve already written starts to feed back in.