Update appNew update is available. Click here to update.
Last Updated: Sep 23, 2023
Easy

Agent in Artificial Intelligence

Author Vidhu Chaudhary
0 upvotes

Introduction

The environment around us is composed of multiple components, each with its own purpose and unique attribute to facilitate its functioning. Humans are the most resourceful component of an active and growing environment as they can observe the living and nonliving parts of the environment and make the best use of each for their benefit.

agent in artificial intelligence

In artificial intelligence, in order to perceive and interpret information using simulations which are identical to the working of a human brain, we require a medium or a “human-like agent” which can derive useful information from the environment and make sensible decisions based on that information. Therefore, the role of an agent comes into play. Now, let us understand further what we imply by the term “agent” in artificial intelligence.

What is an agent in artificial intelligence?

An Artificial Intelligence system is composed of an agent and its environment. The agents act as mediators for information in their environment, and an environment can consist of multiple agents.

  • Human-Agent: The human agent has eyes, ears, and other organs which act as sensors. Similarly, the hands, legs, and other organs act as actuators.
     
  • Robotic Agent: The robotic agent has cameras and IR range finders which act as sensors. Similarly, various motors of robotic agent act as actuators.
     
  • Software Agent: It has keystrokes, file contents, etc., which act as sensors and files, and displays on the screen act as actuators.
     

Before moving forward, we should first know about sensors, effectors, and actuators.

  • Sensors: It is a device that can detect the change in the environment and send the information to other devices in the environment. An agent observes its surroundings with the help of sensors.
     
  • Actuators: They are the components of the machines in the environment that convert energy into motion. They are responsible for moving and controlling a system and can be in the forms of electric motors, gears, rails, etc.
     
  • Effectors: These devices affect the environment through actions. An agent can perform any action through effectors and they can be in the form of legs, wheels, arms, display screen, etc.


Now, when we discuss about an agent, there are a few properties of the corresponding environment in which an agent can act and they are as follows:

  • The environment in which there are a limited number of distinct and clearly defined states is a discrete environment, for example, chess, else it is a continuous environment such as driving.
     
  • An environment that does not undergo changes when an agent is working is a static environment else it is dynamic.
     
  • The environment can consist of multiple agents that may or may not be of the same kind.
     
  • The environment is accessible to an agent if the agent’s sensory apparatus can access the complete state of the environment.
     
  • If the next state of the environment is completely determined by the current state and the actions of the agent, then the environment is deterministic else it is non-deterministic.
     
  • In an episodic environment, an agent does not need to think ahead of time for its actions as it perceives and acts within the same episode, and subsequent episodes are not dependent upon the actions of the previous episodes.

Structure of an agent in artificial intelligence

Artificial intelligence is utilized to design agent programs that can implement the agent function.

The structure of an AI agent is composed of the architecture and an agent program. The architecture is the machinery on which the AI agents perform execution, and the agent function is used to map a percept to an action.

Formula for agent

Types of Agents in Artificial Intelligence

Agents are categorized into five types based on their degree of perceived intelligence and capabilities. Let us discuss each type of agent in detail.

1. Simple Reflex Agents

These are the simplest forms of agents and they make decisions based on the current percepts and ignore the rest of the percept history. They can only be successful in a fully observable environment. They function on the condition-action rule, which means it maps the current state to action, for example, a Room Cleaner agent will only work in a room if there is dirt. 

Problems that simple reflex agents face:

  • They have limited intelligence.
  • They do not have knowledge of non-perceptual parts of the current state.
  • They are mostly too big to generate and store.
  • They are not adaptive to the changes in the environment.
     
Simple Reflex Agents

2. Model-Based Reflex Agents

Model-based reflex agents are responsible for dealing with partial accessibility. This goal can be achieved by keeping track of the currently visible world and for executing it, these agents find a rule whose condition matches the current situation and then work. They can handle partially observable environments with the help of a model about the world. It keeps an internal state that depends on what it has perceived before and therefore, it holds information on the unobserved aspects of the current state. Updating these agents requires information about how the world evolves and how the agent’s actions affect the world.

Model-Based Reflex Agents

3. Goal-Based Agents

These agents make decisions based on how far they are currently from their set goal. Their action is intended to reduce the distance between the current position and the goal. This allows the agent to choose an action which reaches a goal among multiple possible actions. The knowledge that supports its decisions is represented explicitly and can be modified, which makes these agents more flexible. They require search and planning and their behaviour can be easily changed.

Goal-Based Agents

4. Utility-Based Agents

These agents use their end uses as building blocks and are used when there are multiple possible alternatives to decide the best one. They choose actions based on a preference for each state. A utility agent selects the action that maximizes the expected utility. A state is mapped onto a real number using a utility function, which describes the associated degree of happiness. 

Utility-Based Agents

5. Learning Agent

This agent can learn from its past experiences or it has learning capabilities. In the beginning, it starts to act with basic knowledge and later on it acts and adapts automatically through learning. A learning agent has four conceptual components, which are: Learning element, critic, performance element and problem generator. A learning element makes improvement, a critic takes feedback to describe how the agent is performing, a performance element selects external actions and a problem generator suggests actions that will lead to successful experiences.

PEAS Representation

PEAS representation is used to define the characteristics of an agent in artificial intelligence. Whenever an AI agent is defined, its properties can be grouped under PEAS representation. Each component of PEAS representation has a key aspect of the agent's behaviour. The PEAS is made of below words:

  • Performance measure (P): It is the unit which is used to define how successful the agent is.
     
  • Environment (E): It is the surrounding of the agent at every instance. 
     
  • Actuators (A): The actuators deliver the output of the agent's action to the environment.
     
  • Sensors (S): These are the receiving points of an agent. All the inputs to the agent are taken by the sensors.

Example of Agents with their PEAS representation

The below table shows some examples of agents with their peas components:

Agent

Performance Measure

Environment

Actuators

Sensors

Medical DiagnosePatient's health, costPatient, doctor, nurse, hospitalTest, treatment, diagnosisSymptoms 
Vacuum cleanerEfficiency, cleanliness, batteryRoom, carpet, floorWheels, brushesCamera, different sensors
Automated vehiclesSafety, time, comfort, distanceRoads, traffic, signals, vehiclesBreak, accelerator, horn, mirrorGPS, camera
TutoringMarks, attendanceClassroom, desk, chair, studentsDisplays, correctionsNotebook, eyes, ears
Part-picking robotPercentage of parts in right binsBinsJoined arms, handCamera, sensors

Frequently Asked Questions

What can improve the performance of an AI agent?

The performance of an AI agent can be improved by choosing the right algorithms, providing diverse data, utilizing resources like GPUs, tuning hyperparameters, using regularization techniques, employing ensemble methods, and leveraging pre-trained models.

What is more desirable for an AI agent?

For an AI agent, the most desirable traits include high accuracy and reliability in its predictions or decisions. This is because the predictions are judged based on the precision and the accuracy the agent is bringing. Similarly, efficient execution, adaptability, continuous learning, etc., are also desirable for an AI agent.

How does an AI agent interact with its environment?

An AI agent interacts with its environment through receiving and acting. It receives input from sensors, such as cameras or microphones, processes this input, makes decisions using algorithms and models, and then executes actions through actuators, like motors or displays.

Which agent deals with happy and unhappy states?

An AI agent that deals with happy and unhappy states is called an emotional or affective agent. They are designed to have emotions to certain stimuli. They may exhibit various emotional states based on their interactions with the environment or users.

Conclusion

In this blog, we understood what an agent is in an artificial intelligence system and what the role of an agent is. We also discussed different types of agents along with the structure of an AI agent. 

Recommended Reading -

Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive Programming, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio! But if you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc; you must look at the problemsinterview experiences, for placement preparations.

Nevertheless, you may consider our paid courses to give your career an edge over others!

Do upvote our blogs if you find them helpful and engaging!

Happy Learning!!

Previous article
Scope of artificial intelligence in future
Next article
Adversarial Search in Artificial Intelligence