AI in Motion

Generative AIIntermediate1:13 video5 chapters

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.

▶ Watch the animated lecture

0:001. Introduction

Introduction — AI Agents and Tool Use

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

A tool-using agent — AI Agents and Tool Use

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

The loop — AI Agents and Tool Use

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

Safety — AI Agents and Tool Use

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

Recap — AI Agents and Tool Use

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

  1. 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.

  2. 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.

  3. 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

© 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