Intermediate
40 mins
Teacher/Student led
+90 XP

AI Agents, Software That Plans and Acts

Learn the difference between chatbots that answer questions and AI agents that plan and act in loops to reach goals. Direct an agent through a coding task and then switch roles to act as the agent yourself.

Teacher Class Feed

Load previous activity

    1 - Start ~4 mins

    A loop of four students around a goal flag, with a friendly robot at the top: one plans with a light bulb, one works at a laptop beside cogs, one checks a chart with a magnifying glass, and one ticks a checklist, with arrows leading round from each to the next.You have already trained a model and used it inside a program. Today the question is different: what happens when software is given a goal and allowed to plan, use tools, and act in a loop until the job is done?

    Today

    That kind of software is called an AI agent. You will direct one on the board, then take turns being the agent yourselves.

    2 - Agent or Chatbot? ~4 mins

    How an AI agent works: a person sets the goal, then the agent loops through plan, act, observe and adjust. After it observes, if the goal is met it stops; if not, it goes round again. A person can stop it at any time.

    A chatbot answers. You ask a question, it replies with text. The conversation stops until you type again.

    An AI agent is a model given a goal. It works through four phases:

    PhaseWhat the agent does
    PlanIt plans the steps needed to reach the goal.
    ActIt uses tools: it writes a file, runs code, searches or sends a message.
    ObserveIt looks at what happened: an error message, a result or a web page.
    AdjustIt adjusts the plan and tries the next step.
    The difference

    It keeps looping through plan, act, observe, adjust until the goal is met or it is stopped. A chatbot waits; an agent keeps going.

    3 - Direct the Agent: the Goal and the Roles ~5 mins

    Your class is about to direct an AI coding agent. One person is the error-spotter: their job is to call out when something looks wrong. Everyone else confirms the goal, predicts the next step before it happens, and names which phase is running: plan, act, observe, or adjust.

    Three cards saying who does what while the class directs the agent. The agent does the work on the board, one move at a time: plan, act, observe, adjust. The error-spotter is one person who calls out when something looks wrong. Everyone else confirms the goal, predicts the next step and names the phase that is running.
    Goal

    Write a short program that asks for two numbers and prints their sum. If anything breaks, fix it.

    4 - Watch the Agent, Then Debrief It ~9 mins

    Your teacher will run a live agent on the board, or walk through a worked example one move at a time. Before each new move is shown, write or say: next phase = ? next action = ?

    The worked example

    Show move 1

    Plan. The agent says: "I will write a short program that asks for two numbers, adds them, and shows the total."

    Predict: what tool will it use first?

    Show move 2

    Act. The agent writes this program:

    a = input("First number: ")
    b = input("Second number: ")
    print(a + b)

    Predict: what will it print when someone types 3 and then 4?

    Show move 3

    Observe. It runs. The output is 34, not 7.

    Error-spotter: what went wrong?

    Show move 4

    Adjust. The agent says: "The inputs were treated as text, so + joined them together. I need to convert them to whole numbers first."

    Predict: what will it change in the program?

    Show move 5

    Act again. The agent changes the program and runs it with 3 and 4:

    a = int(input("First number: "))
    b = int(input("Second number: "))
    print(a + b)

    Predict: what will it print now, and what will the agent do after that?

    Show move 6

    Observe. The output is 7. The goal is met, so the agent stops.

    After the run, answer as a class:

    • Which steps were plan, act, observe, adjust?
    • Where did the agent need a human watching it?
    • How is this different from a chatbot that only explains how to add two numbers?
    • Observe and adjust is debugging: the agent runs a test, reads what went wrong, and fixes it. Where did you see that today?
    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2026. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more