AI Agents and Tool Use — lecture notes
Language models that act: plan, call tools like search or calculators, read the results and continue until the task is done.
0:001. Introduction

A chatbot answers from what it already knows. An AI agent can take actions: search the web, run code, check a calendar, and use the results to finish a task.
0:132. A tool-using agent

Here the model does not guess the arithmetic. It calls a calculator tool: 2,450 times 0.18 is 441. It calls it again for the total, 2,891, and only then answers. The model decides which tool to call, reads the result, and continues.
0:313. The loop

Agents run a loop. Plan the next step, call a tool, observe the result, decide whether the task is done, and repeat until it is time to answer.
0:444. Safety

Agents need careful design. Show what they are doing. Ask for approval before payments, deletions or sending messages. Give only the permissions a task needs. And treat text found on web pages as data, not as instructions, to avoid prompt injection.
1:015. Recap

To recap. Agents combine language models with tools, loop through planning, acting and observing, get exact and current results, and should ask people before risky actions.
Key takeaways
- An AI agent uses a language model to plan and call tools in a loop.
- Tools provide exact computation and up-to-date information (441 VAT, 2,891 total in the demo).
- The loop: plan, call a tool, observe, decide, answer.
- Safe agents limit permissions, ask for approval and resist prompt injection.
Check yourself
- Why did the agent call a calculator instead of answering directly?
Show answer
Tools give exact results rather than guesses — Language models can make arithmetic mistakes.
- What should an agent do before sending an email on your behalf?
Show answer
Ask for your approval — Risky or irreversible actions need human approval.
- How should an agent treat instructions found inside a web page?
Show answer
As data, not as commands — This protects against prompt injection.
Go deeper
- AI Agents and Tool Use: LLMs That Act · The AI Lecture Hall
- Building an LLM Application End to End: From Idea to Production · The AI Lecture Hall
- Intelligent Agents, Environments and the PEAS Framework · The AI Lecture Hall
© 2026 Janin A Apurba, CSE, AUST · Advanced ICT Officer, CNRS-UNHCR. All rights reserved. Notes for the animated lecture at https://ai-in-motion.vercel.app/watch/ai-agents-and-tool-use.html