From chatbot to agent
Words that do things
I can only write text. So what if I write down what I want done… and someone else does it?
That someone is a small program. It reads everything the LLM writes.
Two lines are just words. One asks for something to be done.
A line starting with ACT: asks for something to be done. The program does it, here with a calculator. Anything the program can do when asked is a tool.
the LLM writes → the program does
The program has the answer. But the LLM hasn't seen it yet.
Give back the result
The program writes the result into the text, on a LOOK: line. The LLM reads all the text before it writes, so now it can use the result instead of guessing.
result → LOOK: line → the LLM reads itLOOK: 1266871 → ANSWER: 4,817 × 263 = 1,266,871.
One tool was enough here. What if a task needs more?
The loop
Some tasks need several steps. So the program keeps going round: the LLM thinks, asks to act, the program writes what to look at. One trip round the loop is one round, and uses one tool.
The loop stops when the LLM writes ANSWER:. The LLM writes once in each round (its THINK: and ACT: lines together), then once more for the answer. Here: 2 rounds, so the LLM wrote 2 + 1 = 3 times.
times the LLM writes = rounds + 1
In case it never answers, the program also stops after a set number of rounds, called the step limit.
Try it on new numbers.
✏️ Practice 1.1
New numbers, same ideas.
Remember: one round = think, act, look. Each round uses one tool.
times the LLM writes = rounds + 1
The step limit is the most rounds the program allows. It stops there, even without an answer.
weather tool (one city at a time) and a calculator. How many rounds does it need?Lots of lines now. Who wrote which?
Who wrote what?
The program only writes LOOK: lines. Everything else, the thinking and the asking, comes from the LLM. Together, they're an agent:
agent = LLM + a program running the loop
Quick check: did it all make sense?
Lesson 1 test
5 questions, one for each idea in this lesson. Answer them all right to pass. A wrong answer tells you why, and which page to look at again.
ACT: weather(Delhi). What happens next?LOOK: line?What your agent still doesn't know.
What can it do?
Your agent can ask for things now. But how does the LLM know there's a calculator, or what to write to use it?
I can ask for anything… but what can I actually do?