#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
Home / Blog /

What is an Intelligent Agent?

Explore Basic Kinds of Agent Programs

Published
5 min read
Scroll Down

Answer in brief

An intelligent agent is anything that perceives its environment through sensors and acts on that environment through actuators, choosing actions that are expected to achieve its goals. A robot vacuum (bump sensors and dirt sensor in, wheels and brushes out) and a chess program (board position in, chosen move out) are both agents.

Russell and Norvig describe four basic kinds of agent programs, in order of increasing capability: simple reflex agents, model-based reflex agents, goal-based agents and utility-based agents. Any of these can be turned into a learning agent that improves with experience.

Agent = architecture + program

The architecture is the machine the agent runs on, with its sensors and actuators: a phone, a car's computer, a server. The agent program is the code that maps what the agent has perceived so far (its percept sequence) to an action. Exam answers often write this as:

agent = architecture + agent program

Agents are usually specified with PEAS: Performance measure, Environment, Actuators and Sensors. For an automated taxi, the performance measure is a safe, fast, legal and comfortable trip; the environment is roads, traffic and passengers; the actuators are steering, accelerator, brake and horn; the sensors are cameras, GPS, speedometer and so on. How hard an agent is to build depends on that environment, which is covered in properties of the environment in AI.

A rational agent is one that, for every possible percept sequence, picks the action expected to maximise its performance measure, given what it has perceived and what it knows.

The basic kinds of agent programs

1. Simple reflex agent

Chooses an action from the current percept only, using condition–action rules ("if car in front is braking, then brake"). It has no memory. It works well only when the right decision can always be made from what is visible right now, that is, in a fully observable environment. In partially observable environments it can loop forever.

2. Model-based reflex agent

Keeps an internal state: a model of the parts of the world it cannot see at the moment, updated from each new percept and from knowledge of how its own actions change the world. A car that remembers a vehicle in its blind spot after it disappears from the mirror is using a model.

3. Goal-based agent

Knows a goal, a description of desirable situations, and chooses actions that lead towards it, often by search or planning over future states. A route planner asked to "reach Lucknow" is goal-based. Changing the goal changes the behaviour without rewriting rules. Search methods such as A* are the tools these agents use.

4. Utility-based agent

Goals only say success or failure. A utility function scores how good a state is, so the agent can trade off speed against safety or cost, and choose well under uncertainty by maximising expected utility. A ride-hailing app choosing a route that balances travel time, toll cost and the chance of a traffic jam behaves like a utility-based agent.

5. Learning agent

Adds a learning element that improves the other parts from feedback. It has four components: performance element, critic, learning element and problem generator. The full architecture is explained in learning agent and its architecture.

Worked example: the two-square vacuum world

The textbook example has two squares, A and B, each either clean or dirty. The agent senses its location and whether that square is dirty. Here are a simple reflex agent and a model-based agent run for six steps, starting in A with both squares dirty:

def simple_reflex(percept, memory):
    location, status = percept
    if status == "Dirty":
        return "Suck"
    return "Right" if location == "A" else "Left"

def model_based(percept, memory):
    location, status = percept
    memory[location] = status              # update the internal model
    if status == "Dirty":
        memory[location] = "Clean"         # predict the effect of Suck
        return "Suck"
    if memory.get("A") == "Clean" and memory.get("B") == "Clean":
        return "NoOp"                      # model says the job is done
    return "Right" if location == "A" else "Left"

def run(agent, steps=6):
    world = {"A": "Dirty", "B": "Dirty"}
    location, memory, moves, log = "A", {}, 0, []
    for _ in range(steps):
        action = agent((location, world[location]), memory)
        log.append(action)
        if action == "Suck":
            world[location] = "Clean"
        elif action in ("Left", "Right"):
            location = "B" if action == "Right" else "A"
            moves += 1
    return log, moves

for agent in (simple_reflex, model_based):
    log, moves = run(agent)
    print(f"{agent.__name__:<14}{' '.join(log)}  (moves: {moves})")

Output:

simple_reflex Suck Right Suck Left Right Left  (moves: 4)
model_based   Suck Right Suck NoOp NoOp NoOp  (moves: 1)

Both clean the two squares in three steps. After that, the simple reflex agent keeps shuttling between A and B, because its current percept ("this square is clean") never tells it that the other square is clean too. The model-based agent remembers both squares and stops. If moving cost energy, the model-based agent would score much better on the performance measure.

Comparison table

KindUsesStrengthWeaknessExample
Simple reflexCurrent percept + rulesFast, simpleFails when the world is not fully visibleThermostat, automatic door
Model-based reflexPercept + internal stateHandles partial observabilityModel may be wrong; still rule-drivenVacuum robot tracking cleaned rooms
Goal-basedState + goal + search/planningFlexible; new goals without new rulesSearch can be slowRoute planner, puzzle solver
Utility-basedState + utility functionBalances trade-offs and uncertaintyDesigning a good utility function is hardRoute choice balancing time, cost, risk
LearningAny of the above + feedbackImproves over timeNeeds data and safe explorationSpam filter that adapts to new spam

Where you meet agents today

Game-playing programs are goal- or utility-based agents (see the minimax algorithm). Recommendation systems and spam filters are learning agents. The "AI agents" built on large language models, which call tools and plan multi-step tasks, are a modern form of goal-based agent; frameworks for them are discussed in CrewAI and multi-agent collaboration. For the wider question of what AI aims to do, see the meaning and goals of AI.

Sources: S. Russell and P. Norvig, Artificial Intelligence: A Modern Approach, ch. 2 "Intelligent Agents" (PEAS, agent programs, vacuum world)