The environment in AI is everything that surrounds the agent but not the agent itself. The environment in which an AI functions can be considered as the entity that the agent used to make sense of things around it to eventually act upon things that can be used to effectively solve a problem. Based on the AI system, an agent can have the ability to either partially observe the surrounding environment or fully understand the same by keeping a track of the history and using the data it has learned from to assess the changes around it. In the case of sequential environments, the AI agent uses its memory to analyze past actions to directly determine the next suitable actions it has to take. A stochastic environment on the other hand is random in nature and it cannot be determined effectively by the agent.
If you are looking for an online course to learn Artificial Intelligence, check out this Artificial Intelligence Course by Intellipaat.