In reinforcement learning, the agent is the learner and decision-maker. It observes the state of an environment, takes an action, receives a reward and the next state, and over many rounds learns to act in ways that earn the most reward in total. A program learning to play Atari games, a robot arm learning to grasp, and a thermostat controller learning to save energy are all agents in this sense.
This is the older, technical meaning of the word. It is related to, but not the same as, an AI agent: a large language model running in a loop with tools. An LLM-based AI agent usually isn’t learning from rewards while it works; it is following instructions. The two meet when LLMs are trained with reinforcement learning, where the model plays the RL agent during training.
The boundary that defines it
Sutton and Barto’s textbook draws a sharp line: anything the agent can’t change arbitrarily counts as part of the environment. A robot’s motors and sensors are environment; so is the reward calculation. The agent is only the part that decides. That split keeps the problem clean. The agent controls actions, the environment controls consequences, and the reward is the single number that says how things are going.
What’s inside
The diagram’s loop has one moving part that learning changes: the policy, the rule the agent uses to pick actions. Depending on the method, an agent may also carry:
- A value function, estimating how much future reward a state or action is worth.
- A model of the environment, predicting what happens next, which lets it plan by imagining outcomes before acting. Model-based agents have one; model-free agents learn from experience alone.
DeepMind’s DQN is a well-known model-free agent: a single network that learns from screen pixels and the game score. A 2015 follow-up ran the same agent, unchanged, across 49 Atari games.
The hard parts
An agent faces problems that supervised learning doesn’t. Nobody tells it the right action, only how well things went, often many steps later, so it has to work out which earlier choices deserved the credit. It must balance trying new actions against repeating ones that worked (exploration vs. exploitation). And it optimizes the reward literally: if the reward can be earned in an unintended way, a capable agent will tend to find it.