Session 1 — What is an agent
A study guide for a lecture that has already been given. It does not replace the slides.
Goals
- Define an agent without needing a language model.
- Tell who chooses the next action: a person, a fixed workflow, or a model.
- See why a good result on one input is not a rule.
Definition
An agent is a system that observes its environment and chooses actions to make progress toward a goal. A robot vacuum goes around an obstacle and returns to charge when the battery is low. There is no language model in this example, and there is an agent.
In an agent based on a language model the division of work is different:
| Part | Role |
|---|---|
| Goal | What counts as done |
| Context | What the model sees right now |
| Model | Proposes the next action |
| Code and tools | Carry out only an allowed action |
| Observation | Goes back to the model |
The important point is that the choice can change after an observation. If the order of actions is fixed in advance, it is a work plan, even if a model sits at every step.
Example: dividing jobs
Two identical workers. Each job runs once, without splitting. The basic rule sends the next job to the less loaded worker. A tie goes to the first worker.
In case A, sorting from longest to shortest shortens the finish time from 5 to 4. In case B both rules finish at 7, and there is a split that finishes at 6. So you cannot conclude from the first case that the new rule is always better.
The agent can propose the rule change and choose which test to run. The split itself is computed by ordinary code. If the test of the new version stops on a timeout, there is no report that it passed.
What may be changed
Editing a candidate plan can be allowed. Deleting an acceptance test is not allowed, because it improves a number without improving the plan. Publishing a change requires approval. These three decisions are enforced by the code, not by a sentence in the system instructions.
Short exercise
Pick a task you did this month. Write one action a tool could carry out, two possible results, and what would change after each one. Then write an action the system must block without approval.
Check your understanding
Reading
- Wooldridge and Jennings, Intelligent Agents: Theory and Practice, 1995.
- Yao et al., ReAct, ICLR 2023. arXiv:2210.03629
- Anthropic, Building effective agents, 2024.
Summary
Found a mistake on this page? Email the lecturer