Learn AI An open course in artificial intelligence
Language: English

Module 16 / 17

AI Agents: Models That Act

Understand how LLMs plan steps, call tools and finish tasks within clear safety limits.

Level: Intermediate Duration: 25 min

01 From Chatbot to Agent

A chatbot answers one message and stops. An agent runs an LLM in a loop: it reads the goal, picks a step, calls a tool, reads the result and decides the next step until the task is done. The ReAct pattern alternates reasoning and action. Example: a support agent checks an order status, reads the return policy, then prepares a refund. Use an agent only when the steps cannot be fixed in advance; a fixed flow is cheaper and easier to test as an ordinary workflow.

02 Tool Calling and Function Schemas

Each tool is described with a name, an explanation and a JSON Schema for its arguments, for example get_order(order_id: string). The model does not run code itself; it returns a structured call, the application validates the arguments and executes it, and the result goes back to the model. The Model Context Protocol (MCP) standardises how applications expose tools and data to models. Clear tool descriptions, validated arguments and informative error messages often matter more for an agent's success than the choice of model.

03 Memory, Planning and Multi-Agent Systems

Short-term memory is the conversation history in the context window; long-term memory usually lives in a database or vector store and is retrieved when relevant. For long tasks, an agent can break the goal into a step-by-step plan and update it after each result. The orchestrator-worker pattern hands subtasks to several agents working in parallel, for example researching several sources at once. Every extra agent adds token cost, latency and points of failure, so start with one simple agent.

04 Agent Safety and Evaluation

Text from web pages, emails or documents can contain prompt injection that tells the agent to do something else. Give tools the least privilege possible, run code in a sandbox, cap the number of steps and the budget, and ask a human to approve hard-to-reverse actions such as transferring money or deleting data. Keep a trace of every step for auditing. Evaluate agents on a set of real tasks and measure success rate, number of steps, cost and critical errors; benchmarks such as SWE-bench and τ-bench take the same approach.

Open the interactive version with quiz and progress