agent and environment
RL splits the whole world into just two pieces. The agent is the learner and decision-maker—the part you build and train. The environment is everything else: the world the agent lives in, which reacts to what the agent does. A chess program is the agent; the board, rules, and opponent are the environment. A warehouse robot is the agent; the shelves, floor, and packages are the environment.
The boundary is drawn around what the agent can directly control. Anything it cannot change by choice—even parts of its own body, like a robot's worn motor—belongs to the environment. At each step the agent sends an action into the environment, and the environment sends back a new situation and a reward. Keeping this line clear is the first step in framing any problem as RL.