Agents
An agent is an entity that perceives its environment through sensors and acts upon it through actuators, choosing actions to maximize a performance measure. Formally modeled as a function from percept histories to actions, agents unify decision theory, control, and AI. They apply wherever autonomous, goal-directed behavior is modeled — from robotics and economics to reinforcement learning. The modern framework was crystallized by Russell & Norvig (1995), building on von Neumann, Wiener, and Bellman.
Intelligence and goal-directed behavior can be factored cleanly into three pieces: a percept stream coming in, an action stream going out, and an agent function that connects them. Rationality is then not a property of internal mechanism but of input-output behavior: an agent is rational if its agent function selects, for each percept sequence, an action expected to maximize a performance measure given what the percepts reveal. Everything else — planning, learning, perception — is engineering machinery for implementing or approximating this ideal mapping.
Formal Statement
Let be the set of possible percepts (sensor readings) and the set of possible actions (actuator commands). A percept sequence is a finite string . An agent is defined by its agent function
Derivation hint: This is a definition, not a derived result — it formalizes "the action depends on everything observed so far." Note the domain is , the Kleene star (all finite sequences), capturing full history dependence. The agent program is the concrete algorithm running on an architecture (physical/computational substrate) that implements (or approximates) . We write agent = architecture + program.
A task environment is specified by the tuple
Derivation hint: "PEAS" is a checklist, not an equation; it is numbered here only to satisfy formatting. The performance measure is a function used to grade behavior — crucially it is defined over states of the environment, not over the agent's internal beliefs.
Given a performance measure , a percept sequence , and the agent's prior knowledge , a rational agent selects
i.e. the action whose expected performance, conditioned on evidence and knowledge, is greatest. Derivation hint: The expectation is over the agent's posterior beliefs about hidden environment states, formed by conditioning a prior on the percept sequence (Bayesian updating). Rationality is bounded by what is knowable from and — not omniscience.
For sequential decision problems with states , the agent's behavior is captured by a policy (or for stochastic policies), and performance is the expected cumulative reward:
For a Markov Decision Process with transition kernel , reward , and discount , there exists an optimal policy whose value function satisfies the Bellman optimality equation
and the optimal agent acts greedily: . Derivation hint: Apply the principle of optimality — an optimal policy's tail is optimal for the subproblem. The right-hand side is a contraction mapping in -norm with modulus ; Banach's fixed-point theorem gives existence and uniqueness of .
If an agent's preference relation over lotteries (probability distributions over outcomes) satisfies completeness, transitivity, continuity, and independence, then there exists a utility function such that for lotteries ,
and is unique up to a positive affine transformation , . Derivation hint: Continuity gives, for each outcome between best and worst , a unique indifference probability with outcome ; set . Independence ensures these indifference probabilities combine linearly across compound lotteries, yielding the expected-utility form.
Why It Holds / Derivation
Step 1. Define the Bellman optimality operator on bounded functions :
Derivation hint: This packages the one-step lookahead in equation [4] into an operator so we can study its fixed points abstractly.
Step 2. Show is a -contraction in the sup-norm . For any :
Derivation hint: Use , then bound the difference of the two expectations by since transition probabilities sum to 1.
Step 3. Since the space of bounded functions with sup-norm is complete, Banach's fixed-point theorem gives a unique fixed point , satisfying equation [4]. Iterating converges geometrically: — this is value iteration.
Step 4. The greedy policy w.r.t. achieves , so it is optimal. Hence a rational sequential agent's behavior is well-defined and computable (in the finite case).
∎A founder of the agent's mathematical core. With Oskar Morgenstern he wrote Theory of Games and Economic Behavior (1944), proving the expected-utility theorem (equation [5]) that justifies treating rational behavior as scalar maximization, and establishing the minimax theorem for two-player zero-sum games — the prototype of an adversarial agent. His work on self-reproducing automata and the stored-program architecture (the "von Neumann architecture") underpins the architecture half of "agent = architecture + program."
Building Intuition
Think of an agent as a thermostat that learned philosophy. The dumbest agent — a thermostat — maps the single percept "too cold/too hot" to "heater on/off"; its agent function is a tiny lookup table. Scale this up: a chess program's agent function maps a board (percept) to a move (action), but the table is astronomically large, so it's computed by search rather than stored. A self-driving car's percepts are camera frames and lidar; its actions are steering and throttle. In every case the behavior is the function from what-it-has-seen to what-it-does. Rationality just asks: of all functions you could implement, are you choosing the action that does best on average given what you actually know? Note the two humilities baked in: "on average" (the world is stochastic) and "given what you know" (you can't act on hidden facts). A rational agent is not omniscient or infallible — it is the best bet against its own ignorance.
```svg
```
Worked Examples
Given: Two squares . Percept = (location, status) where status ∈ {Clean, Dirty}. Actions: Left, Right, Suck. Performance: +1 per clean square per time step, over 100 steps.
Steps. Build the agent function as a table for the simplest reflex agent:
| Percept | Action |
|---|---|
| [A, Dirty] | Suck |
| [A, Clean] | Right |
| [B, Dirty] | Suck |
| [B, Clean] | Left |
Compute performance if both start dirty. Step 1: at A=Dirty → Suck (A clean). Step 2: A=Clean → Right. Step 3: at B=Dirty → Suck (B clean). From step 3 onward both squares clean: score per step. Over steps 4–100 (97 steps) plus partial earlier credit: clean-square-steps . Approximate total clean-square count (after both clean by step 3).
Boxed answer:
Given: States , actions stay, go, . Rewards: , , , . Transitions: go from → w.p. 1; everything else stays put.
Steps. Guess the agent should reach and stay. Compute (stay loops forever in with reward 10):
Now : action "go" yields ; action "stay" yields . Since 90 > stay value, optimal is go:
Boxed answer:
Common Misconceptions
"A rational agent always does the right thing / never fails." False. Rationality (equation [3]) maximizes expected performance given available evidence. An agent that crosses a road after looking both ways is rational even if a meteor then strikes it. Rationality ≠ omniscience, ≠ clairvoyance, and ≠ perfection. Confusing the performance measure (defined over real environment states) with the agent's internal utility estimate (its possibly-wrong beliefs) is the single most common error.
"Bigger/more autonomous = more 'agent.'" Agency is binary in the formal definition — anything with the perceive→act loop is an agent, including a thermostat. What varies is sophistication (reflex vs. model-based vs. goal-based vs. utility-based vs. learning agents), not agenthood.
A robot vacuum that re-cleans an already-clean square seems irrational. But if its sensor is noisy (status reading is unreliable), then re-checking can raise expected performance by reducing the chance of leaving dirt. Under partial observability the "wasteful" action is optimal. Conversely, the Allais paradox is a genuine counterexample to humans being vNM-rational: people systematically violate the independence axiom, so no single utility function (equation [5]) can represent their choices — proving humans are not the rational agents of the theory.
Connections
The agent framework is a hub linking several fields. The sequential-decision core is exactly a Markov Decision Process, whose solution via equation [4] is Dynamic Programming (Bellman). When the agent must learn and from experience instead of knowing them, you get Reinforcement Learning (Q-learning, policy gradients approximate ). The preference foundations (equation [5]) belong to Decision Theory and Expected Utility Theory. Multi-agent interaction — where each agent's environment contains other agents — is Game Theory, with von Neumann's minimax and Nash equilibrium as solution concepts. The continuous-state, control-oriented version is Optimal Control and the Hamilton-Jacobi-Bellman Equation. Belief-tracking under partial observability links to Bayesian Inference and POMDPs.
Real-World Applications
Historical Development
Subtleties & Limits
The clean theory frays at the edges. (1) Bounded rationality: equation [3] requires an intractable expectation and argmax; real agents have finite compute, so what is the right notion of optimal-given-resources? Russell's "rational metareasoning" and Simon's satisficing are partial answers, but no fully satisfactory theory of computationally bounded rationality exists. (2) Reward specification / alignment: the performance measure must be defined over environment states, yet specifying to capture genuine human intent is unsolved — misspecified rewards cause reward hacking and pose AI safety risks. (3) Non-stationarity and multi-agent recursion: when the environment contains other learning agents, the "stationary MDP" assumption behind equation [4] breaks, and equilibrium existence/learnability becomes subtle. (4) Continuous, high-dimensional, partially observed worlds push value iteration into approximation territory with weak convergence guarantees. (5) The hard question of agency itself: whether sophisticated function-approximators "really" have goals, or merely behave as if they do, remains philosophically contested.
See Also
Markov Decision Process · Reinforcement Learning · Decision Theory · Game Theory · Dynamic Programming · Expected Utility Theory · Optimal Control · Bayesian Inference · Bounded Rationality