Intelligent Agents
What intelligence means operationally, how rational agents connect perception to action, and how environment assumptions determine an AI system's design.
Artificial intelligence is easiest to misunderstand when it is defined by examples. Chess programs, recommendation systems, autonomous vehicles, medical decision-support tools, and language models are all called AI, but no particular technique appears in every one of them. A more durable definition begins with agency: an intelligent system receives information about an environment, uses computation to choose an action, and is evaluated by the consequences of that action.
This definition shifts attention away from whether a machine appears human. The engineering question is not “Does it look intelligent?” but “Does it choose effective actions for the task, using the information and resources available to it?”
Four Views
Definitions of AI are often organized along two dimensions:
| Goal | Human standard | Rational standard |
|---|---|---|
| Internal process | Think like a human | Reason correctly |
| External behavior | Act like a human | Act to achieve the best expected outcome |
Thinking or acting like a human is useful when the goal is cognitive modelling or natural interaction. A tutoring system, for example, may need a model of common human misconceptions. Rational action is broader and more useful for engineering: the system should choose the action expected to achieve its goals, even if its internal procedure differs completely from human thought.
Logical correctness alone is not enough. An agent may not have time to prove the best action, may lack relevant observations, or may face random outcomes. Rational behavior therefore combines inference, uncertainty, utility, and computational limits.
AI History
Artificial intelligence has repeatedly changed its preferred representation of intelligence.
Early work emphasized symbolic computation: logical circuits, theorem proving, game playing, and general problem solving. These systems demonstrated that machines could manipulate abstract symbols, but many worked only in small, carefully specified worlds.
Knowledge-based systems later encoded specialist rules explicitly. They succeeded in narrow diagnosis and configuration tasks, then became difficult to maintain when rule collections grew, exceptions multiplied, and the surrounding world changed. Expectations fell when general intelligence did not follow automatically from larger rule bases.
Probabilistic and statistical methods shifted attention toward uncertainty and learning from observations. Better data, faster hardware, and improved optimization later made large neural models practical for perception, language, and control. Transformer models and large-scale generative systems continued that trend by learning broad representations from large datasets.
These phases did not simply replace one another. Modern systems combine search, rules, probability, learning, retrieval, and human control. The historical lesson is that success in one benchmark does not establish general understanding. Every technique depends on assumptions about representation, data, computation, and environment.
Two recurring failures illustrate this point:
- Early language systems could transform words without enough world knowledge to resolve ordinary ambiguity.
- Early linear learning models could represent only limited decision boundaries; problems such as XOR required richer internal representations.
Failure analysis is part of AI. A limitation reveals which information or computation the model lacks.
AI Areas
AI includes several interacting areas:
- language: speech recognition, text generation, translation, question answering, dialogue, search, and classification;
- perception: recognizing objects, faces, scenes, sounds, and events from sensor data;
- robotics: connecting perception, planning, control, and physical action;
- reasoning: deduction, constraint solving, satisfiability, diagnosis, and explicit knowledge;
- decision making: routing, scheduling, recommendation, fraud detection, medical support, and resource allocation;
- learning: improving predictions or policies from data and experience.
The boundaries are porous. A robot may use learned vision to estimate state, probability to represent uncertainty, search to plan motion, and feedback control to execute safely. An apparent language problem may require knowledge retrieval, logical consistency, and human oversight.
This course focuses on the computational ideas shared across these areas. Mechanical design, large-scale model training, and domain-specific deployment require additional study.
Rationality
A rational agent selects the action that maximizes expected performance given:
- the percept sequence received so far;
- the actions available to it;
- its knowledge or model of the environment; and
- the computational resources available at decision time.
Rational does not mean omniscient. Suppose a delivery robot chooses the shortest route based on a reliable map, but an unreported road closure makes that route slow. The choice may still have been rational when it was made. Rationality judges the decision from the information available before the outcome, not with hindsight.
When outcomes are uncertain, the central quantity is expected utility:
EU(action) = Σ P(outcome | action, evidence) × U(outcome)
An action with the highest possible reward is not necessarily rational if it succeeds only rarely or carries unacceptable risk. Expected utility forces the designer to represent both likelihood and consequence.
Task Objectives
An agent faithfully optimizes the performance measure it is given, not the unstated intention of its designer. A routing system asked only to minimize travel time may choose unsafe roads. A content recommender rewarded only for watch time may learn to promote sensational material. A good objective must capture quality, cost, safety, fairness, and other constraints that genuinely matter.
This is one of the deepest lessons in AI: many failures are not failures of optimization. They are successful optimization of an incomplete objective.
Agent Loop
An agent repeatedly participates in a loop:
environment → sensors → percept → agent → action → actuators → environment
A percept is the information received at one moment. A percept sequence is the complete history available to the agent. The agent function maps percept sequences to actions:
f : P* → A
The agent program is the concrete implementation of that function. The distinction matters: the mathematical mapping describes desired behavior, while the program must approximate it using finite memory and time.
PEAS
Before selecting an algorithm, describe the task using:
- Performance measure — how success is evaluated;
- Environment — the world in which the agent operates;
- Actuators — how the agent can affect that world;
- Sensors — what the agent can observe.
Consider an automated campus-room scheduler:
| PEAS element | Example |
|---|---|
| Performance | Few clashes, required capacity, fair time distribution, low room changes |
| Environment | Courses, instructors, rooms, time slots, institutional rules |
| Actuators | Assign, move, or remove a scheduled class |
| Sensors | Enrollment, availability, room capacity, existing assignments |
This description immediately suggests a constraint satisfaction problem. Without it, a team may start coding a search algorithm before agreeing on what a valid or good schedule means.
Environments
The environment determines which methods can work. Important dimensions include:
Observability
In a fully observable environment, sensors expose everything relevant to the decision. A chess board is fully visible. Driving is partially observable because intentions, hidden vehicles, sensor noise, and future road conditions remain unknown.
Partial observability requires memory, state estimation, or probabilistic belief. The agent must reason about what the world might be, not only what it currently sees.
Uncertainty
In a deterministic environment, an action has a predictable result. In a stochastic environment, the same action may produce different outcomes. Search methods work naturally with deterministic transitions; probabilistic models and decision processes are needed when uncertainty is significant.
Dependence
In an episodic task, each decision is largely independent. Classifying separate images is close to episodic. In a sequential task, present actions change future choices. Route planning, game playing, and dialogue are sequential.
Change
A static environment does not change while the agent is deciding. A dynamic environment does. A slow but exact algorithm may be rational for a static puzzle and useless for a robot moving through traffic.
State Scale
Board games have discrete states and actions. Robot motion includes continuous position, velocity, time, and control signals. Continuous problems often require approximation, optimization, or discretization.
Participants
Other agents may be cooperative, neutral, or adversarial. A timetable generator is mostly single-agent. Chess is adversarial. Road traffic is multi-agent and only partly cooperative.
These labels are not decorative. Each is an assumption that should appear in the system specification and in the limits of any result.
Architectures
Different tasks require different internal structures.
Reflex Agents
A reflex agent chooses an action from the current percept:
def thermostat(temperature, target=24.0):
if temperature < target - 0.5:
return "heat"
if temperature > target + 0.5:
return "cool"
return "idle"
This can be rational when the relevant state is directly observable and the rules are stable. It fails when history matters or the current percept is ambiguous.
Model-Based Agents
A model-based agent maintains an internal state describing aspects of the world that are not currently visible. A cleaning robot remembers which rooms it has visited. A network monitor tracks recent traffic, not just the latest packet.
The update has the general form:
new_state = update(old_state, previous_action, new_percept)
The model need not be a perfect simulation. It only needs to preserve information relevant to good decisions.
Goal-Based Agents
A goal identifies acceptable states. The agent considers future action sequences and asks which ones reach a goal. This leads directly to state-space search and planning.
Goals distinguish success from failure but do not rank multiple successful outcomes. If two routes both reach the destination, a bare goal provides no preference between them.
Utility-Based Agents
A utility function assigns a numerical preference to outcomes. It can represent time, energy, risk, comfort, fairness, or a carefully designed combination. Utility makes trade-offs explicit and supports decisions under uncertainty.
Learning Agents
A learning agent improves from data or experience. A useful conceptual decomposition is:
- a performance element that chooses actions;
- a learning element that changes the performance element;
- a critic that evaluates outcomes;
- a problem generator that encourages informative exploration.
Learning does not remove the need for task design. The designer still chooses the data, feedback signal, constraints, and evaluation procedure.
Learning Modes
In supervised learning, examples pair inputs with desired outputs. The system learns a model that should generalize to unseen examples. Spam classification and image recognition are typical tasks.
In reinforcement learning, an agent acts, observes consequences, and receives rewards. It seeks a policy mapping situations to actions that maximizes long-term reward. Feedback may be delayed, and exploration itself changes what the agent learns.
These modes answer different questions:
- supervised learning asks, “What output matches this input?”;
- reinforcement learning asks, “What action leads to good future outcomes?”;
- planning asks, “Given a model, which action sequence reaches the goal?”;
- probabilistic inference asks, “What should I believe after this evidence?”
A learning agent may contain all four. It can learn a transition model from experience, use inference to estimate hidden state, plan with the learned model, and improve its policy from reward.
Design Example
Suppose we want an agent that helps prioritize programming support requests.
- Percepts: submission state, error category, waiting time, deadline proximity, and whether the issue blocks the whole group.
- Actions: request more information, suggest a diagnostic, assign a teaching assistant, escalate, or close.
- Performance: reduce unresolved blocking time without systematically disadvantaging quieter or less experienced students.
- Environment: partially observable, dynamic, sequential, multi-agent, and uncertain.
A simple “serve the newest request” rule ignores urgency. “Serve the easiest request” improves throughput but may starve difficult cases. “Serve the longest-waiting request” improves fairness but may ignore a widespread outage.
A rational design needs a utility or priority model with safeguards:
def priority(request):
urgency = 20 / max(request["deadline_hours"], 0.5)
blockage = 15 if request["blocks_progress"] else 0
breadth = min(request["affected_students"], 10) * 2
fairness = min(request["waiting_minutes"], 60) / 3
return urgency + blockage + breadth + fairness
request = {
"waiting_minutes": 30,
"affected_students": 4,
"blocks_progress": True,
"deadline_hours": 2,
}
print(priority(request))
The formula is not “the intelligence.” It is an explicit hypothesis about what should matter. It must be tested against realistic cases, reviewed for unintended incentives, and revised when behavior conflicts with institutional values.
Evaluation
An AI evaluation should separate at least four questions:
- Task performance: Does it solve the intended problem?
- Generalization: Does it work outside the examples used during development?
- Efficiency: How much time, memory, data, energy, and human attention does it consume?
- Impact: Who benefits, who bears risk, and what happens when it fails?
Average accuracy alone can hide serious defects. A diagnostic model with 95% accuracy may fail systematically on a small population. A route planner may be fast on typical maps but time out on the exact dense layouts where it is most needed. Evaluation must include edge cases and disaggregated results.
Common Mistakes
- Equating intelligence with human imitation. A calculator does not calculate like a person, but its different procedure is not a defect.
- Calling any automation AI. A fixed script may be useful without perception, reasoning, adaptation, or uncertainty.
- Assuming rational means morally good. Rationality is relative to the objective; a harmful objective can be optimized rationally.
- Ignoring environment assumptions. An algorithm proved optimal for a static deterministic graph does not inherit that guarantee in a changing world.
- Treating a benchmark as the real task. Once a score becomes the target, systems may exploit the measurement rather than improve the intended outcome.
- Confusing fluency with knowledge. Convincing output is evidence of presentation quality, not necessarily truth or grounded understanding.
Applications
The agent view applies across AI:
- search agents plan routes and action sequences;
- constraint agents assign rooms, staff, or frequencies;
- game agents choose actions against opponents;
- probabilistic agents update beliefs from evidence;
- fuzzy controllers translate vague rules into continuous control;
- generative systems select likely continuations under learned models.
The methods differ, but the discipline remains the same: define the environment, information, choices, objectives, and evaluation before choosing the machinery.
Exercises
- Write a PEAS specification for an automated irrigation system. Identify at least two objectives that can conflict.
- Classify a fraud-detection environment along every dimension introduced in this chapter. Defend each classification.
- Give an example of an action that is rational when selected but produces a bad outcome. Explain why this is not a contradiction.
- Design a utility function for an elevator controller. What undesirable behavior might result from optimizing only average waiting time?
- Convert the thermostat into a model-based agent that remembers whether heating was recently activated and avoids switching too frequently.
- For the support-priority agent, construct three requests that reveal a weakness in the sample priority formula. Propose a correction and explain its trade-off.