Intelligent Agents
Most AI can be described as an agent: it senses its environment and chooses actions to reach a goal.
What you will learn
- Define agent, environment, percept and action
- Break a real AI into the agent model
- See goals as what drives behaviour
The agent model
A huge amount of AI fits one simple picture. An agent is anything that senses its environment and acts on it to reach a goal.
| Part | Meaning | Vacuum robot example |
|---|---|---|
| Environment | The world it works in | Your rooms |
| Percepts | What it senses | “dirt here”, “wall ahead” |
| Actions | What it can do | move, turn, suck |
| Goal | What success means | a clean floor |
The agent runs a loop forever: sense → think → act → sense again.
# The agent loop, in pseudo-Python
while True:
percept = sense(environment) # what do I see now?
action = decide(percept) # the "AI" lives here
do(action) # change the worldNote: Output: (There is no output — this is the shape every agent program follows. The intelligence is inside decide().)
Agents do not need a body
A spam filter is an agent too: its environment is your inbox, its percept is a new email, its actions are inbox or spam, and its goal is a clean inbox. Same model, no robot.
Tip: When you meet any AI, ask the four questions: what is its environment, what can it sense, what can it do, and what is its goal? That instantly tells you how it works.
Q. For a self-driving car, “press the brake” is an example of a…
✍️ Practice
- Map a thermostat onto the agent model (environment, percepts, actions, goal).
- Write the sense–decide–act loop in words for a chess AI.
🏠 Homework
- Choose any AI product and fill in all four parts of the agent model for it.