Agents
Fiona French
Recap - Intelligent agents
• So, AI is about trying to produce intelligent agents
• In theory, they might:
Act like a human
Think like a human
Think rationally
Act rationally - this is something we can hope to achieve
What is an agent?
OUTLINE
• Agent
• Rational Agent
• Task Environment
• Environment Types
What is an agent?
An entity that PERCEIVES its environment using SENSORS and acts on its
environment using ACTUATORS
What is an agent?
• Human agent: eyes, ears, and other organs for sensors/observers.
hands, legs, mouth, and other body parts for actuators/reactors.
• Robotic agent: cameras and infrared range finders for sensors/observers
various motors for actuators/reactors.
• What are software sensors and actuators?
Eg. key inputs, data packets arriving ----- screen display, write files, send data
Percept
• Perceptual inputs - what the agent can sense OR The agent’s
perceptual inputs at any given time
• Percept sequence - the accumulation of percepts over time
OR The complete history of what the agent has perceived
Agent function v. agent program
• Agent function - A mapping of any given percept sequences to an action
f : P*(P0’ P1, …Pn ) -> A
• Agent can be thought of as a tool for analysing systems.
• Agent function is implemented by the agent program
• Agent program is concrete implementation of function using code
• Agent architecture is the structure that supports this
Design & Develop an AI Agent
1. Identify the percepts, actions, sensors and actuators
2. Map the percepts sequence with the actions – Agent Functions
3. Start the coding/ Implementation of the function – Agent Program
4. Build the architecture
Rationality
DEFINITION
For each possible percept sequence, a rational agent should select an action expected
to maximise its performance measure, given evidence provided by the percept
sequence and agent’s built-in knowledge.
Depends on:
• Performance measure defining success
• Agent’s prior knowledge of environment
• Actions it can perform
• Percept sequence to date
Vacuum cleaner Agent
• Agent (AI System): The robot (machine) that can
move and interact with objects.
• Environment: A two-part space where the agent
operates.
• Perceptions (Inputs): The agent detects objects
(pebbles) and its position.
• Actions (Outputs): The agent decides to move left or
right, push, or suck dirts.
Rational agent
• A rational agent does the “right thing”.
• But what is that?
How to determine what’s right?
Rational agent
How to determine what’s right?
o Look at consequences of actions
o Does sequence of actions have desirable outcome?
We need a PERFORMANCE MEASURE
o Evaluates any given sequence of environment state NOT agent state
Rational agent – Eg: Vacuum cleaner
agent
How do you measure its performance?
Check the qualities it should have to maximize efficiency?
- How much dirt cleaned in 1 hour?
- Reward for clean floor?
- Penalties for time / energy used
Rational agent
A rational agent follows these principles:
Perception: Observes the world
(Step 1).
Decision Making: Considers possible actions
(Steps 2-3).
Action Execution: Performs the best possible action
(Steps 4-6).
Goal Achievement: Stops when the objective is met (Steps 7-8).
Task environment
Before we design an intelligent agent, we must specify its “task environment”:
A task environment refers to everything an agent interacts with while performing its
tasks. It includes:
• Performance Measure – The criteria used to evaluate the agent's success.
• Environment – The external surroundings where the agent operates.
• Actuators – The mechanisms that allow the agent to take action.
• Sensors – The tools used to perceive and gather information from the environment.
P.E.A.S.
• Performance measure – which qualities it should have?
- A performance measure (typically imposed by the designer) is used to
evaluate the behavior of the agent in environment.
- It tells does agent do, what it’s supposed to do in the environment
• Environment – where it should act?
• Actuators – how will it perform actions?
• Sensors – how will it perceive environment?
P.E.A.S - Robot Taxi Driver
• Performance measure : Safety, speed, fuel efficiency,
passenger comfort, rule compliance.
• Environment : roads, other traffic, pedestrians, weather
conditions.
• Actuators : steering, accelerator, brake, signal, horn, display…
• Sensors : cameras, sonar, speedometer, GPS, accelerometer,
odometer, engine sensors
Medical Diagnosis System
•Agent
Performance measure:
•Environment:
•Actuators:
•Sensors:
19
Medical Diagnosis System
•Agent
Performance measure: Diagnosis accuracy, treatment suggestions,
speed, patient safety.
•Environment: Patient, hospital, staff, Medical records, research
databases.
•Actuators: Screen display (questions, tests, diagnoses,
treatments, referrals)
•Sensors: Keyboard (entry of symptoms, findings, patient's
answers), test results, MRI scans, wearable health trackers. 20
On-line math tutor
agent
•Performance measure:
•Environment:
•Actuators:
•Sensors:
21
On-line math tutor agent
•Performance measure: Maximize student's score on test,
Accuracy of solutions, clarity of explanations, student
engagement, learning progress, response time.
•Environment: Set of students, math problems, virtual
classrooms.
•Actuators: Screen display (exercises, suggestions, corrections)
•Sensors: Keyboard, mic for voice inputs 22
Chatbot (e.g., ChatGPT, Google
Bard, Customer Support Bots)
•Performance Measure?
•Environment ?
•Actuators ?
•Effectors ?
23
Chatbot (e.g., ChatGPT, Google Bard,
Customer Support Bots)
• Performance Measure: Accuracy, relevance, response time,
user satisfaction.
• Environment: Conversations with users, text inputs.
• Actuators: Screens, speaker for voice responses (for voice
assistants).
• Sensors: Keyboards for user text input, mic for voice-based
chatbots). 24
Agents working Environment
•Types
Characteristics or Properties of an Environment
• Fully observable vs. Partially observable (Accessible vs. inaccessible)
• Deterministic vs. nondeterministic (stochastic)
• Episodic vs. sequential
• Static vs. dynamic
• Discrete vs. continuous
• Single agent vs. multi-agent
25
Task environment: Properties
1. Fully / partially observable (unobservable) – relevance
Fully observable
• Can access the complete state of environment at any point in time
• Can detect all aspects that are relevant to the choice of action
Partially observable
• An environment might be partially observable because of noisy and inaccurate
sensors or because parts of the state are simply missing from the sensor data
Eg., “partially-observable “ agent is a robot that has sensors to detect “only” smoke
but cannot detect water when it is in the same environment.
Task environment: Properties
2. Single / multi-agent - competitive or cooperative?
(communication skills, random behaviour is unpredictable)
Task environment: Properties
3. Deterministic / stochastic - uncertain outcomes, probability
• If the next state of the environment is completely determined by the current state
and the agent’s action, then it’s Deterministic, otherwise Stochastic
Eg., A game is generally considered deterministic, even though there are many moves
that “might” be available…and Taxi driving is clearly stochastic in this sense, because
one can never predict the behavior of traffic exactly
Task environment: Properties
4. Episodic / sequential - short-term actions have long-term consequences
Episodic
• The agent’s experience is divided into atomic episodes
• Each episode consists of the agent perceiving and then performing a single
action
• The next episode does not depend on the actions taken in the previous
episode (depend only on episode itself)
Eg., spotting defective parts on an assembly line is episodic
Many classification tasks are episodic.
Task environment: Properties
4. Episodic / sequential - short-term actions have long-term consequences
Sequential
• The current decision could affect all future decisions.
Eg Chess and taxi driving are sequential: in both cases, short-term actions can have
long-term consequences.,
Task environment: Properties
5. Static / dynamic (semi-dynamic) - changing environment
• If the environment can change while the agent is deliberating (acting) & agent is
continuously asking what to do next, then it’s dynamic environment otherwise
static environment.
E.g.
• Driving is dynamic
• Crossword puzzle is static
Task environment: Properties
6. Discrete / continuous - state of environment over time
If the environment states are limited and the agent’s percepts and actions are limited
then the environment is discrete otherwise continuous.
Eg : chess environment has a finite number of distinct states (excluding the clock),
Chess also has a discrete set of percepts and actions.
Taxi driving is a continuous-state and continuous-time problem: the speed and
location of the taxi and of the other vehicles sweep through a range of continuous
values.
Types of Environments
Types of Environments
Task environment: Properties
Fully / partially observable (unobservable) - relevance
Single / multi-agent - competitive or cooperative?
(communication skills, random behaviour is unpredictable)
Deterministic / stochastic - uncertain outcomes, probability
Episodic / sequential - short-term actions have long-term consequences
Static / dynamic (semi-dynamic) - changing environment
Discrete / continuous - state of environment over time
Known / unknown - agent’s knowledge of environment
Structure of Intelligent Agents
Agent = architecture + program
The architecture makes the percepts from the sensors available to the program,
runs the program, and feeds the program's action choices to the actuators as they
are generated.
Agent Types
1. Simple reflex agent - Condition action rule
if car-in-front is braking, then initiate braking
2. Model-based reflex agent - Model of world
3. Goal-based agent - Search and planning
can change goals, flexibility
4. Utility-based agent - Utility function
high quality behaviour maximises expected utility
5. Learning agent
Learning agents
PERFORMANCE STANDARD
CRITIC SENSOR
E
N
Provides V
FEEDBACK I
CHANGES KNOWLEDGE
Performance R
Learning O
element element N
M
Learning E
GOALS N
ACTUATOR T
PROBLEM
GENERATOR
Weekly exercise – Mind Map 03
Submission deadline – on or before 21st
march 2025 , 10 PM
o Email id : -
[email protected] o Email subject :- AI – Mindmap Lecture 3- Batch no-
RegNo
- Thank You -