UNIT-4
What is an Intelligent Agent?
An intelligent agent is a system (either software or hardware) that can:
1. Perceive its environment: It collects information from its surroundings using
sensors or input.
2. Think: It processes this information, applies reasoning, and makes decisions.
3. Act intelligently: It performs actions based on its reasoning to achieve
specific goals.
In simple terms, an intelligent agent observes, thinks, and acts to solve problems or
complete tasks efficiently.
Examples:
1. Google Maps:
1. It takes your location and real-time traffic data as input.
2. It processes this information to calculate the fastest or shortest route.
3. Finally, it guides you step-by-step to your destination.
2. Robot Vacuum Cleaner (e.g., Roomba):
1. It senses the size of the room and detects obstacles like furniture.
2. It plans an efficient cleaning path.
3. It navigates around the room while avoiding obstacles and cleaning the
floor.
Categories of Agents Based on Architecture:
1. Logic-Based Agent
2. Reactive Agent
3. Layered Architecture
4. Belief Desire Intention Agent
1. What is a Logic-Based Agent?
• A Logic-Based Agent is an intelligent agent that uses logical reasoning to
make decisions and take actions. It stores knowledge about its environment in
the form of facts and rules and uses these to deduce new conclusions and plan
its actions.
Architecture of a Logic-Based Agent
• A logic-based agent typically consists of the following components:
1. Knowledge Base (KB): This is the agent's memory, where facts and rules
about the environment are stored.
Example:
1. Fact: "Room A is dirty."
2. Rule: "If a room is dirty, clean it."
2. Inference Engine: This acts as the agent's brain. It applies logical reasoning
to combine rules and facts to draw conclusions.
Example: Given the fact "Room A is dirty" and the rule "If a room is
dirty, clean it," the inference engine deduces: "Clean Room A."
3. Perception (Sensors): Sensors collect data from the environment and update
the knowledge base.
Example: If the agent detects that Room A is dirty, it adds this fact to
the KB.
4. Action Module: Based on the inference engine’s conclusion, this module
executes the appropriate action in the environment.
Example: The agent cleans Room A.
5. Goals: Predefined objectives guide the agent’s actions.
Example: The agent's goal is to clean all dirty rooms.
Advantages of a Logic-Based Agent
1. Sound Reasoning: If the knowledge base is correct, the agent's decisions are
always accurate.
2. Explainable Decisions: The agent's actions are transparent because they are
based on logical rules and reasoning.
3. Flexibility: Logic-based agents can adapt to new situations by adding or
modifying rules in the knowledge base.
4. Predictability: The agent's behavior can be predicted by analyzing its logical
rules, ensuring consistent responses.
5. Reusability: The knowledge base and reasoning mechanisms can be reused
across different domains with minimal changes.
Disadvantages of a Logic-Based Agent
1. Slow Reasoning: Logical reasoning can be complex and time-consuming.
2. Inflexibility: These agents struggle in uncertain or dynamic environments
where rules may not fully apply.
3. High Maintenance: Regular updates to the knowledge base are needed to
keep it accurate and relevant, which can be labor-intensive.
4. Limited Learning: Logic-based agents typically lack the ability to learn
from experience or adapt automatically.
5. Complex Implementation: Designing and maintaining a comprehensive set
of logical rules requires significant expertise and effort.
2. What is a Reactive Agent?
A Reactive Agent is a type of agent that takes immediate action based on the current
state of its environment without using complex reasoning or planning. These agents
operate using a simple "sense-act" architecture, which means:
1. The agent senses the environment.
2. Based on predefined rules, it performs an action in response.
Reactive agents lack memory or long-term planning capabilities and rely entirely on
"if-then" rules to decide actions.
Features of Reactive Agents
1. Simplicity: Reactive agents are simple to design and operate without
involving complex reasoning or future planning.
2. No Internal Model: They do not build or use an internal representation of the
environment. Actions are based only on the current state.
3. Rule-Based Behavior: Their decisions follow predefined rules in the form of
"if-then" statements.
4. Fast Response: They react quickly to changes in the environment.
Architecture of a Reactive Agent
1. Perception Module (Sensors):
o Collects data about the current state of the environment.
2. Rule Base (Condition-Action Rules):
o Contains predefined rules that map specific conditions to corresponding
actions.
o Example: "If obstacle ahead, turn left."
3. Action Module:
o Executes the appropriate action based on the rule base.
Examples (Real-Life Scenarios)
1. Automatic Door System:
o Condition: If a person approaches (motion detected),
o Action: The door opens automatically.
2. Obstacle Avoiding Robot:
o Condition: If an obstacle is detected ahead,
o Action: The robot turns left to avoid it.
3. Air Conditioner:
o Condition: If the room temperature is greater than 25°C,
o Action: The air conditioner turns on.
Advantages of Reactive Agents
1. Fast Decision-Making: They respond quickly to changes in the environment.
2. Simple Design: No need for complex reasoning or planning.
3. Robust in Dynamic Environments: Work well in rapidly changing
environments due to their immediate response.
4. Low Resource Requirement: These agents require less computational
power due to their lack of reasoning and memory storage.
5. Ease of Maintenance: With minimal rules, updating or modifying their
behavior is straightforward.
Disadvantages of Reactive Agents
1. No Learning or Memory: They do not consider past states or learn from
experiences.
2. Limited Intelligence: Cannot handle complex problems or multi-step tasks.
3. Inefficiency: May perform repetitive actions unnecessarily.
4. Poor Long-Term Planning: They lack the capability to anticipate future
consequences or strategize.
5. Dependency on Current Inputs: Their decisions rely solely on the present
state, which can be insufficient in complex scenarios.
Applications of Reactive Agents
1. Industrial Robots: Reactive robots quickly respond to obstacles on assembly
lines.
2. Home Automation Systems: Smart lights turn on as soon as motion is
detected.
3. Autonomous Vehicles: Use reactive systems to avoid obstacles in real time.
3. Layered Architecture in Intelligent Agents
Layered architecture in intelligent agents organizes the agent's functionality into
multiple layers. Each layer is responsible for specific tasks or behaviors, enabling
the agent to handle complex problems systematically. The layers interact with each
other to process information and make decisions.
Key Concepts of Layered Architecture
1. Modularity: The agent is divided into distinct layers, each responsible for a
specific functionality.
o Example: Perception, reasoning, and action layers.
2. Abstraction: Each layer operates at a different level of abstraction.
o Lower layers deal with basic tasks, while higher layers handle complex
reasoning.
3. Interaction: Layers communicate with each other to share information and
coordinate actions.
4. Hierarchical Design: Layers are arranged hierarchically, with information
flowing between adjacent layers.
Architecture of Layered Agent:
1. Perception Layer:
o Gathers raw data from the environment using sensors.
o Processes data to create a representation of the current state.
o Example: A robot detects an obstacle ahead.
2. Reasoning Layer:
o Analyzes the data from the perception layer to make decisions or plans.
o Uses logical reasoning, heuristics, or learned models.
o Example: Decides to turn left to avoid the obstacle.
3. Action Layer:
o Executes the decisions made by the reasoning layer.
o Controls actuators or other mechanisms to interact with the
environment.
o Example: The robot turns left as planned.
Example of Layered Architecture
Autonomous Drone
1. Perception Layer:
o Collects data using cameras and sensors.
o Detects obstacles, weather conditions, and the drone's location.
2. Reasoning Layer:
o Plans a safe route to the destination.
o Adjusts the flight path based on real-time obstacle detection.
3. Action Layer:
o Controls the motors to navigate the planned path.
o Executes maneuvers to avoid obstacles.
Advantages of Layered Architecture
1. Scalability: New functionalities can be added by introducing additional
layers.
2. Modularity: Easier to develop, test, and maintain as each layer is
independent.
3. Robustness: Failures in one layer can often be handled without affecting
others.
4. Flexibility: Supports both reactive and deliberative behaviors.
Disadvantages of Layered Architecture
1. Complexity: Designing interactions between layers can be challenging.
2. Overhead: Communication between layers adds computational overhead.
3. Latency: Sequential processing in vertical architectures may slow down
decision-making.
Applications of Layered Architecture
1. Robotics: Autonomous robots use layered architecture for navigation,
obstacle avoidance, and task execution.
2. AI Assistants: Virtual assistants like Siri and Alexa process user inputs,
reason responses, and act on commands.
3. Self-Driving Cars: Layered architecture handles perception, decision-
making, and vehicle control.
4. Industrial Automation: Automated systems use layers for monitoring,
reasoning, and executing manufacturing tasks.
4. Belief-Desire-Intention (BDI) Agent
The BDI Agent is an advanced type of intelligent agent that models human-like
reasoning. It is based on three core mental states: Beliefs, Desires, and Intentions.
These agents use these states to make decisions and act purposefully in their
environment.
Key Concepts of BDI Agent
1. Beliefs: Represent the agent's knowledge or information about the
environment and itself. These are dynamic and can change as the agent
perceives new information.
o Example: "The robot believes there is an obstacle ahead."
2. Desires: Represent the agent's goals or objectives. These are the states the
agent wishes to achieve.
o Example: "The robot desires to move to the destination without hitting
any obstacles."
3. Intentions: Represent the agent's committed plans of action to achieve its
desires. Intentions are specific and guide the agent's behavior in achieving its
goals.
o Example: "The robot intends to turn left to avoid the obstacle."
Belief-Desire-Intention Architecture
The architecture of a BDI agent consists of the following components:
1. Belief Base:
o Stores the agent's beliefs about the environment.
o Continuously updated based on sensory inputs.
2. Desire Module:
o Contains the agent’s goals or what it wants to achieve.
o These goals guide the decision-making process.
3. Intention Module:
o Contains the plans the agent is committed to executing to achieve its
desires.
o It is based on the current beliefs and desires.
4. Reasoning Mechanism:
o The agent uses reasoning to decide which desires to pursue and convert
them into intentions.
o Ensures the agent does not continuously change plans without
achieving its goals.
5. Execution Module:
o Executes the agent's intentions by interacting with the environment.
Example: Robot Navigation
Scenario:
A robot must navigate through a room to reach a charging station while avoiding
obstacles.
1. Beliefs:
o "There is a wall to the left."
o "The charging station is located at (5, 10)."
2. Desires:
o "Reach the charging station."
o "Avoid obstacles."
3. Intentions:
o "Move forward if the path is clear."
o "Turn right if there is an obstacle ahead."
Process:
The robot senses its surroundings and updates its beliefs.
Based on its beliefs, it prioritizes the desire to avoid obstacles.
It forms the intention to turn right and executes the action.
Advantages of BDI Agents
1. Human-Like Reasoning: Mimics human decision-making, making it
suitable for complex and dynamic tasks.
2. Adaptability: Can update its beliefs and adjust plans based on changes in the
environment.
3. Goal-Oriented: Focuses on achieving specific goals, ensuring purposeful
behavior.
4. Real-Time Decision-Making: Effective in dynamic environments where
decisions need to be made quickly.
Disadvantages of BDI Agents
1. Complexity: Designing a BDI agent requires careful modeling of beliefs,
desires, and intentions.
2. Resource-Intensive: May require significant computational resources for
reasoning and planning.
3. Limited Memory: Beliefs may become outdated in highly dynamic
environments.
Applications of BDI Agents
1. Autonomous Vehicles:
o Self-driving cars use BDI principles to navigate, avoid obstacles, and
follow traffic rules.
2. Virtual Assistants:
o Digital assistants like Siri or Alexa manage tasks based on user goals
and contextual information.
3. Robotics:
o Robots in manufacturing or delivery use BDI to adapt to changing
conditions.
4. Game AI:
o Game characters use BDI to exhibit goal-directed and adaptive
behaviors.
Multiagent System (MAS)
Definition: A Multiagent System (MAS) is a system comprising multiple agents that
interact within an environment to solve problems or achieve goals. These agents can
be software entities, robots, or other intelligent systems, designed to work
independently or collaboratively. MASs leverage the strengths of individual agents
to tackle complex tasks more efficiently.
Key Features of Multiagent Systems
1. Autonomy: Each agent operates independently, without requiring continuous
guidance.
Example: Delivery drones plan their own routes to avoid collisions and minimize
delivery time.
2. Collaboration or Competition: Agents may cooperate to achieve a shared goal
or compete for limited resources.
Example: Traffic management systems collaborate to optimize traffic flow across a
city.
3. Communication: Agents exchange information to make informed decisions or
negotiate with each other.
Example: Smart home devices, such as thermostats and lighting systems,
communicate to maintain comfort while conserving energy.
4. Decentralization: No single agent controls the entire system; decision-making is
distributed among agents.
Example: Stock trading bots operate independently but influence each other through
market dynamics.
Real-Life Example of MAS: Smart Traffic Management System
Scenario: Traffic lights at intersections act as independent agents.
Functionality:
Each traffic light monitors traffic at its intersection using sensors.
They communicate with adjacent traffic lights to adjust signal timings
dynamically.
Goal: Minimize congestion citywide by coordinating traffic flow efficiently.
Agent Communication in MAS:
In Multi-Agent Systems (MAS), agent communication refers to the interaction and
exchange of information between autonomous agents to achieve their individual or
collective goals. Communication is a fundamental component of MAS, enabling
coordination, collaboration, negotiation, and decision-making.
Example to Understand Agent Communication:
Imagine a food delivery app like Zomato or Swiggy:
1. Customer Agent: Places an order for a pizza.
2. Restaurant Agent: Accepts the order and starts preparing the food.
3. Delivery Agent: Picks up the food from the restaurant and delivers it to the
customer.
Here, these agents (Customer, Restaurant, Delivery) exchange messages like:
Customer to Restaurant: "I want to order a pizza."
Restaurant to Delivery Agent: "The pizza is ready for pickup."
Delivery Agent to Customer: "Your pizza is on the way."
This exchange of information is an example of agent communication.
How Agents Communicate?
1. Messages:
o Agents send and receive messages.
o Example: A message could be "Order ID 12345 is ready for delivery."
2. Language:
o Agents need a common "language" to understand each other.
o Example: They may use structured formats like:
(REQUEST : sender Restaurant :receiver Delivery :content "Pickup order 12345")
3. Protocols:
o Just like humans follow rules in a conversation (e.g., one person speaks
at a time), agents follow communication protocols.
o Example:
First, the customer orders food.
Then, the restaurant confirms.
Finally, the delivery agent picks it up.
Types of Communication:
1. Direct Communication: Agents send messages to each other explicitly.
Example: A warehouse robot requests assistance from another robot to lift a heavy
item.
2. Indirect Communication: Agents leave signals or markers in the
environment for others to interpret.
Example: Ants leave pheromone trails to guide others to food sources.
3. Protocols and Languages: Agents follow predefined communication
protocols or languages.
Example: Smart devices in a home use MQTT (Message Queuing Telemetry
Transport) to exchange data.
Applications:
1. E-commerce:
o Chatbots talk to customers to help them shop.
o Payment systems and delivery services communicate.
2. Smart Homes:
o Your Alexa or Google Assistant talks to devices like lights and fans to
turn them on/off.
3. Robotics:
o In a warehouse, robots communicate to move boxes without bumping
into each other.
Negotiation and Bargaining in MAS
In MAS, negotiation and bargaining are processes where agents communicate and
interact to resolve conflicts, allocate resources, or make decisions that satisfy their
individual or collective goals. These methods are particularly useful when agents
have conflicting interests or limited resources and must find a mutually acceptable
solution.
Key Concepts in Negotiation and Bargaining:
1. Negotiation:
o A process where agents communicate to reach an agreement.
o Involves offers, counteroffers, and concessions.
o Can be bilateral (between two agents) or multilateral (involving
multiple agents).
2. Bargaining:
o A specific type of negotiation focused on dividing a resource or
deciding terms of exchange.
o Involves agents proposing values and making compromises.
3. Strategies:
o Competitive: Agents aim to maximize their own benefit.
o Cooperative: Agents aim for a fair and balanced outcome.
4. Protocols:
o Define rules for negotiation, such as who makes offers and how
counteroffers are handled.
o Examples: Auction protocols, alternating offers protocol.
5. Utility:
o Measures how satisfied an agent is with an outcome.
o Agents aim to maximize their utility (value from the agreement).
Steps in Negotiation and Bargaining:
1. Problem Identification:
o Agents identify a conflict or need (e.g., resource sharing).
2. Offer Generation:
o Agents propose initial solutions or demands.
3. Response:
o Agents evaluate offers and respond (accept, reject, or counter).
4. Iteration:
o The process repeats with revised offers until agreement or termination.
5. Agreement/Termination:
o If all agents agree, negotiation ends; otherwise, it may fail.
Real-Life Example: Negotiation in Ride-Sharing Apps
Scenario:
In a ride-sharing app like Uber or Ola:
A Passenger Agent wants a ride at a low cost.
A Driver Agent wants to earn a higher fare.
Steps:
1. Problem Identification:
o The passenger enters a ride request, specifying their budget or route.
o The driver evaluates the request based on distance and fare.
2. Offer Generation:
o The app (mediator agent) suggests a fare, such as ₹150.
o The driver can propose a counteroffer, say ₹180.
3. Response:
o The passenger can accept ₹180, reject it, or counter with ₹160.
4. Iteration:
o The negotiation continues until both agree on a fare or cancel the
request.
5. Agreement:
o If ₹160 is acceptable to both, the deal is finalized, and the ride is
booked.
Challenges in Negotiation and Bargaining
1. Complexity:
o Negotiations can become computationally expensive with multiple
agents or issues.
2. Incomplete Information:
o Agents may not have complete knowledge of others' preferences or
limits.
3. Fairness:
o Ensuring all agents feel satisfied with the outcome.
4. Conflict Resolution:
o Handling situations where agents fail to reach an agreement.
Applications
1. Resource Allocation:
o In cloud computing, servers negotiate resource sharing.
2. E-commerce:
o Buyers and sellers negotiate product prices.
3. Smart Grids:
o Houses negotiate electricity usage during peak hours.
4. Robotics:
o Robots in a warehouse bargain for task assignments.
Arguments in Multiagent Systems
Arguments are structured pieces of information that agents use to justify actions,
influence decisions, or resolve conflicts. Argumentation enables agents to engage in
logical discussions to collaborate or negotiate.
Why Argument are Needed?
Conflict Resolution: Resolve disputes between agents with differing goals.
Decision Support: Choose the best action in uncertain situations.
Persuasion: Convince agents to adopt a specific course of action.
Collaboration: Build consensus for joint tasks.
Process of Argumentation:
Proposal: One agent makes a suggestion.
Example: "Let’s split the tasks equally."
Justification: Reasons are provided to support the suggestion.
Example: "This ensures fairness and faster completion."
Counter arguments: Other agents provide opposing views.
Example: "But some tasks require specialized skills."
Evaluation: All arguments and counterarguments are assessed.
Example: "Let’s divide tasks based on expertise."
Conclusion: A consensus is reached.
Example: "Agreed, we’ll assign tasks based on skills."
Real-Life Example:
Scenario: Autonomous cars at an intersection.
Arguments:
Car 1: "I should go first because I arrived first."
Car 2: "I should go first as I’m carrying an emergency patient."
Evaluation: Prioritize Car 2 while ensuring safety for others.
Trust and Reputation in MAS
Trust and reputation in MAS are mechanisms that help agents decide whether they
can rely on other agents for cooperation or services. These concepts are crucial in
systems where agents are autonomous and interact frequently in uncertain
environments.
What is Trust in MAS?
Trust in MAS is the belief of one agent in the ability, reliability, and honesty of
another agent to act as expected in a specific situation. Trust is subjective and can
vary between agents based on their past interactions and perceptions.
Key Features of Trust:
1. Dynamic Nature:
o Trust changes over time based on interactions.
o Example: If an agent delivers tasks on time, trust increases.
2. Context-Dependent:
o Trust is specific to a task or situation.
o Example: An agent trusted for delivering files may not be trusted for
securing sensitive data.
3. Quantifiable:
o Trust can be represented as a numerical value (e.g., a score between 0
and 1).
What is Reputation in MAS?
Reputation is the collective opinion or perception about an agent based on feedback
or observations from multiple agents. While trust is personal and subjective,
reputation is more public and shared.
Key Features of Reputation:
1. Aggregated Feedback:
o Reputation is built by combining evaluations from multiple agents.
o Example: An agent gets high reputation if many others report positive
interactions.
2. Influences Trust:
o Agents use the reputation of others to make trust decisions.
o Example: If many agents say Agent A is reliable, Agent B is more likely
to trust Agent A.
3. Global View:
o Unlike trust, reputation reflects a broader, system-wide perspective.
How Trust and Reputation Work Together?
Trust is personal and depends on direct experience.
Reputation helps in forming trust when there is no prior interaction.
For instance:
Agent A interacts with Agent B for the first time and has no direct trust.
Agent A checks the reputation of Agent B in the system.
Based on this reputation, Agent A decides whether to trust Agent B.
Real-Life Example: Online Marketplace
Imagine Amazon or Flipkart as a MAS where:
1. Sellers are agents offering products.
2. Buyers are agents purchasing products.
Trust:
A buyer trusts a seller based on past purchases (e.g., fast delivery, good
quality).
Reputation:
A seller’s reputation is based on customer reviews and ratings from all buyers.
Buyers trust sellers with higher ratings, even if they haven’t interacted before.
Why Are Trust and Reputation Important in MAS?
1. Facilitates Cooperation:
o Agents trust each other to work together and complete tasks.
o Example: Robots in a factory trust one another to assemble different
parts.
2. Reduces Risk:
o Trust ensures reliable behavior, minimizing chances of failure or fraud.
o Example: Autonomous cars rely on trusted communication for safe
navigation.
3. Improves Efficiency:
o Agents save time by avoiding unreliable or malicious agents.
o Example: A cloud server allocates tasks to agents with high reputation.
Models of Trust and Reputation in MAS
1. Direct Trust Models:
Based on personal experiences.
Example: If Agent A cooperates successfully with Agent B three times, Agent
A’s trust in Agent B increases.
2. Reputation-Based Models:
Use feedback from others to calculate an agent’s reputation.
Example: If most agents rate Agent B highly, its reputation improves.
3. Hybrid Models:
Combine direct trust and reputation for better decision-making.
Example: An agent uses its own experience and consults others for feedback.
4. Probabilistic Models:
Use probability to predict the trustworthiness of an agent.
Example: Predicting the chance that Agent B will deliver a task on time.
Applications of Trust and Reputation in MAS
1. E-commerce Platforms:
o Buyers trust sellers based on ratings and reviews.
o Example: Amazon’s star rating system.
2. Autonomous Vehicles:
o Cars trust other vehicles and traffic systems for safe coordination.
3. Cloud Computing:
o Servers allocate tasks to trusted virtual machines.
4. Healthcare Systems:
o Agents share sensitive patient data only with trusted entities.
5. Social Networks:
o Users trust connections and content based on reputation scores.