GACS Logo
AI Agents MasteryModule 1 / 12
AAM · Module 1Free preview

Foundations of AI Agents

What an AI agent is, how it differs from a chatbot, core components, and the agent lifecycle.

You're reading Module 1 free. Unlock the full 12-module diploma, the final exam, and a verifiable certificate for $499.

Log in to enroll
AI tutor · included with this diploma
Discuss this module with the AI tutor — chat or talk
Ask questions, get re-explanations, run scenario roleplays, or have it quiz you out loud.

What Is an AI Agent

An AI agent is a system that can perceive, reason, and act toward a goal. Unlike chatbots, agents operate autonomously, use tools, and follow structured decision loops.

Key Characteristics

AI agents have autonomy, memory, reasoning, and the ability to interact with external systems. They can plan, execute actions, and evaluate outcomes.

Agents vs Chatbots

Chatbots respond to user input. Agents pursue goals. Chatbots are reactive. Agents are proactive, tool-using, and capable of multi-step reasoning.

Why This Matters

Understanding the difference helps you design systems that go beyond conversation and into autonomous problem-solving.

Core Components

Every agent includes: a system prompt, memory, tools, a reasoning loop, and an execution environment.

The Agent Loop

Agents follow a cycle: Observe → Think → Act → Evaluate. This loop repeats until the goal is achieved.

Lifecycle Overview

Agents move through phases: initialization, goal interpretation, planning, action execution, evaluation, and termination.

Why Lifecycle Matters

Understanding lifecycle phases helps you design predictable, safe, and reliable agents.

Minimal agent loop — Observe → Think → Act
pip install openai
python
from openai import OpenAI
client = OpenAI()

def run_agent(goal, max_steps=5):
    scratch = []
    for step in range(max_steps):
        prompt = f"GOAL: {goal}\nHISTORY:\n{chr(10).join(scratch)}\nNext action (or DONE):"
        out = client.chat.completions.create(
            model="gpt-5-mini",
            messages=[{"role":"user","content": prompt}],
        ).choices[0].message.content.strip()
        scratch.append(f"step{step}: {out}")
        if out.startswith("DONE"): break
    return scratch

print(run_agent("Summarise what an AI agent is in one sentence."))

Workbook · hands-on exercises

Build the artifact, then self-check against the expected output.

  1. 1
    Build the minimum agent

    Task — Implement an Observe → Think → Act loop that terminates on the string 'DONE'. Test it on 3 goals.

    Expected output — Console transcript with numbered steps for each goal, ending in DONE within ≤5 steps.

  2. 2
    Chatbot vs agent

    Task — Write a 1-page markdown comparing your minimum agent to a plain chat completion on the same task.

    Expected output — compare.md with a 4-row table (autonomy, tool use, memory, evaluation).

  3. 3
    Failure-mode log

    Task — Run your agent on 10 prompts. Categorise every failure (loop, wrong tool, hallucination, refusal).

    Expected output — failures.csv with columns prompt, failure_type, last_step.

Module 1 Quiz

7 questions · 80% required to unlock the next module.

  1. 1. What makes an AI agent different from a chatbot
  2. 2. Which is true about agents
  3. 3. Which is NOT a core component of an agent
  4. 4. Which phase comes first in the agent lifecycle
  5. 5. What is an AI agent
  6. 6. Which component is essential to an agent
  7. 7. What is the agent loop