Lesson 1.1~15 min

What is an AI Agent?

Module 1: Introduction to AI Agents

What is an AI Agent?

An AI agent is a system that perceives its environment through sensors, reasons about what it perceives, and takes actions through actuators to achieve specific goals.

The Agent-Environment Interaction Loop

Every AI agent follows a fundamental cycle:

  1. Perceive — The agent observes its environment through sensors (cameras, microphones, text input, API data, etc.)
  2. Reason — The agent processes observations and decides what to do (using rules, ML models, or LLMs)
  3. Act — The agent takes an action that affects the environment (sending a message, moving, calling an API)
  4. Feedback — The environment changes, and the cycle repeats

Agents vs. Traditional Programs

AspectTraditional ProgramAI Agent
InputFixed, predefinedDynamic, from environment
Decision-makingHardcoded logicAdaptive reasoning
AutonomyNonePartial to full
LearningNoOften yes
Environment awarenessNoYes

A Simple Example

Consider a thermostat:

  • Sensor: Temperature sensor
  • Reasoning: If temperature < target, turn on heater
  • Actuator: Heater switch
  • Environment: The room

This is the simplest form of an AI agent — a simple reflex agent.

Modern AI Agents

Today's AI agents are far more sophisticated. An LLM-powered agent like ChatGPT:

  • Perceives through text input (and images, files)
  • Reasons using a large language model
  • Acts by generating text, calling tools, writing code
  • Adapts through conversation context
# Conceptual structure of an AI agent

class SimpleAgent:

def __init__(self, tools, llm):

self.tools = tools

self.llm = llm

self.memory = []

def perceive(self, input):

self.memory.append({"role": "user", "content": input})

def reason(self):

response = self.llm.generate(self.memory)

return response

def act(self, decision):

if decision.requires_tool:

result = self.tools[decision.tool_name].execute(decision.args)

return result

return decision.text

Key Takeaways

  • An AI agent is defined by its ability to perceive, reason, and act autonomously
  • Agents exist on a spectrum from simple (thermostat) to complex (autonomous vehicles)
  • Modern agents often use LLMs as their reasoning engine
  • The agent-environment loop is the fundamental pattern underlying all agent architectures

Test Your Knowledge

5 randomized questions from a pool of 10. Pass with 60% to unlock the next lesson.

All Modules