No history yet

Introduction to AI Agents

What is an AI Agent?

An artificial intelligence (AI) agent is anything that can view its environment and act on that environment to achieve a goal. Think of it as an autonomous entity. A self-driving car, a smart thermostat, or even a software bot that buys stocks are all examples of agents.

Every agent interacts with its world through a simple loop. It perceives, it thinks, and it acts. This cycle is made possible by a few core components.

Sensors are the tools an agent uses to perceive its environment. For a self-driving car, sensors include cameras, GPS, and microphones. For a web-crawling bot, the sensor is the ability to read the HTML of a webpage.

Actuators are what an agent uses to act on its environment. A car's actuators are the steering wheel, accelerator, and brakes. A Roomba's actuators are its wheels and vacuum.

An agent's entire sensory input at any given moment is called a percept. The history of everything an agent has ever perceived is its percept sequence. An action is whatever the agent does in response.

percept

noun

The agent's perceptual inputs at any given instant.

Types of Agents

Not all agents are created equal. They range from incredibly simple to highly complex, depending on how they decide which action to take. We can classify them into a few main types.

Simple Reflex Agents These are the most basic agents. They make decisions based only on the current percept, ignoring the rest of the percept history. They operate on simple “if-then” rules. For example, if the car in front brakes, then brake. A smart thermostat is another example: if the temperature is below 68°F, then turn on the heat.

Model-Based Reflex Agents These agents are a step up. They maintain an internal model of the world. This model helps the agent keep track of the parts of the environment it can't currently see. For instance, a self-driving car needs to know where other cars were a moment ago to predict where they might be now, even if they're temporarily hidden behind a truck. This internal state allows them to handle partially observable environments.

Lesson image

Goal-Based Agents Knowing about the current state of the world isn't always enough. Sometimes, an agent needs a goal. Goal-based agents use information about a desired state to choose their actions. If you tell a GPS your destination, it doesn't just look at the current street. It considers all possible routes and chooses the sequence of turns that will get you to your goal.

Utility-Based Agents Having a goal is good, but what if there are multiple ways to reach it? A utility-based agent aims for the best outcome. "Utility" is a measure of happiness or desirability. A GPS might find two routes to your goal that take the same amount of time, but one has tolls and the other doesn't. A utility-based agent would choose the one without tolls to maximize your utility (saving you money).

Learning Agents These are the most advanced agents. They can operate in unknown environments and improve their performance with experience. A learning agent has a "learning element" that uses feedback to modify its behavior. For example, an AI that plays chess might lose a game. It analyzes that loss (feedback) to understand its mistake and will not make the same one again. Over time, it learns to become a better player.

Agent TypeDecision BasisExample
Simple ReflexCurrent percept onlyThermostat
Model-Based ReflexInternal state (model)Self-driving car tracking other vehicles
Goal-BasedA specific goal stateGPS navigation
Utility-BasedMaximum expected utilityRide-sharing app picking the most profitable fare
LearningExperience and feedbackA game-playing AI

Understanding these different types of agents and their core components is the first step toward building intelligent systems that can perceive, reason, and act in the world.

Quiz Questions 1/5

What is the primary function of an AI agent?

Quiz Questions 2/5

For a robotic vacuum cleaner like a Roomba, its wheels are considered actuators.