What an agent is
The percept–action loop, agent function versus program, rationality, environment properties and kinds of agent program.
From NLP to agents
The NLP course ended with a loop around a language model: emit a tool call, run it, put the result back in context, decide again. That loop is one instance of a much older idea. An agent perceives an environment and acts on it, over and over, so that the environment ends up in states someone wants.
A classifier or a one-shot chat answer is a function: one input, one output, done. Quality can be judged on that output alone. As soon as the system acts, the output changes the world and the next input depends on it. Moving away from a dirty square can be a mistake or a good idea depending on the rest of the room. This course builds agents from classical search through reinforcement learning to language-model agents that write code and operate computers.
The agent–environment loop
An agent perceives through sensors and acts through actuators. At step the environment is in state ; the agent receives a percept (often only part of ) and emits an action . The environment then moves, possibly at random: .
Two objects describe behaviour. The agent function maps every percept sequence to an action. The agent program is the code that implements with limited memory and time. A lookup table over sequences is hopeless: with and lifetime it needs rows. The design problem of the course is to find small programs that produce good agent functions.
Performance and rationality
A performance measure scores the sequence of environment states, not the agent’s opinion of itself. An agent is rational if for every percept sequence it chooses the action that maximizes given those percepts and its prior knowledge. Rational is not omniscient; rationality is relative to the measure; and a rational agent gathers information when looking is cheaper than acting blindly.
In the two-square vacuum world, a reflex “if dirty suck, else move” is nearly best when moves are free, but with move cost a waiting agent that checks the other square every steps does better (about vs points per step at dirt probability ). The counter carries information: after steps the unseen square is dirty with probability .
Task-environment properties
Classify the task environment before choosing a design:
| Axis | Easy end | Hard end |
|---|---|---|
| Observability | fully | partially |
| Uncertainty | deterministic | stochastic |
| Horizon | episodic | sequential |
| Time | static | dynamic |
| Values | discrete | continuous |
| Agents | single | multi-agent |
| Knowledge | known rules | unknown (must learn) |
Search assumes fully observable, deterministic, known worlds; MDPs add stochastic outcomes; games add an opponent; RL removes the known model.
Five kinds of agent program
Programs grow by what they compute before acting:
- Simple reflex — action from the current percept alone.
- Model-based reflex — internal state updated with transition and sensor models.
- Goal-based — search for action sequences that reach desirable states.
- Utility-based — maximize expected utility under uncertainty.
- Learning — improve any of the above from experience (critic, learning element, explorer).
LM agents and the course plan
A language-model agent fits the same frame: percepts enter the context, actions are text parsed by a runtime, the model is , and memory is the context window plus external notes. Practitioners often contrast fixed workflows (code decides the next step) with agents (the model decides); both are agents in this course’s sense.
Next: when the world is fully observable, deterministic and known, a goal-based agent can find a sequence of actions before acting — by search.
Check your understanding
The same questions as in Pulse. Answers are shared between modes.
Answers are saved on the server and tied to this browser until you sign in.