Knowledge based agent
Knowledge based agent
AGENT
▪ Anything that perceives environment through sensors and act upon that
environment through actuators.
▪ An agent is a computer program or system that is designed to perceive its
environment, make decisions and take actions to achieve a specific goal or
set of goals.
▪ An Agent runs in the cycle of perceiving, thinking, and acting.
▪ An agent can be:
▪ Human-Agent: A human agent has eyes, ears, and other organs which work for
sensors and hand, legs, vocal tract work for actuators.
▪ Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP for
sensors and various motors for actuators.
▪ Software Agent: Software agent can have keystrokes, file contents as sensory input
and act on those inputs and display output on the screen.
▪ World around us is full of agents such as thermostat, cellphone, camera,
and even we are also agents.
2
AGENT – COMPONENTS
3
AGENT – SIMPLE REFLEX AGENT
The Simple reflex agents are the simplest agents. These agents take decisions on the basis of
the current percepts and ignore the rest of the percept history.
It doesn’t consider any a part of percepts history during their decision and action process
4
AGENT – MODEL BASED REFLEX AGENT
These are the agents with memory. It stores the information about the previous state, the current
state and performs the action accordingly.
Model: It’s knowledge about “how things happen within the world.
Internal State: It’s a representation of the present state-based on percept history.
The previous and the current state get updated quickly for deciding the action.
Ex: Searching robot - if the agent is a self-driving car and the goal is the destination,
then the information of the route to the destination helps the car in deciding when to
turn left or right.
6
AGENT – UTILITY BASED AGENT
There can be many possible sequences to achieve the goal, but some will be better than others.
The utility is a function that maps a state to a real number that describes the degree of happiness. The
utility function specifies the appropriate trade-off in case the goals are conflicting.
•Critic: The Critic evaluates how well is the agent performing vis-à-vis the set performance
benchmark.
•Learning Elements: It takes input from the Critic and helps Agent improve performance by
learning from the environment.
•Performance Element: This component decides on the action to be taken to improve the
performance.
•Problem Generator: Problem Generator takes input from other components and suggests actions
resulting in a better experience.
8
KNOWLEDGE-BASED AGENT IN AI
▪ An intelligent agent needs knowledge about the real world for taking decisions
and reasoning to act efficiently.
▪ Knowledge-based agents are those agents who have the capability of maintaining
an internal state of knowledge, reason over that knowledge, update their
knowledge after observations and take actions. These agents can represent
the world with some formal representation and act intelligently.
▪ Knowledge-base is required for updating knowledge for an agent to learn with
experiences and take action as per the knowledge.
▪ Knowledge-based agents are composed of two main parts:
▪ Knowledge-base and
▪ Inference system.
9
KNOWLEDGE-BASED AGENT ARCHITECTURE
Knowledge base: It is a collection of sentences. These sentences are expressed in a language which is
called a knowledge representation language. The Knowledge-base of KBA stores fact about the world.
Inference system: Inference means deriving new sentences from old. Inference system allows us to
add a new sentence to the knowledge base. A sentence is a proposition about the world. Inference
system applies logical rules to the KB to deduce new information. Inference system generates new facts
so that an agent can update the KB. An inference system works mainly in two rules:
• Forward chaining
• Backward chaining
10
OPERATIONS PERFORMED BY KBA
▪ TELL: This operation tells the knowledge base what it perceives from the
environment.
▪ ASK: This operation asks the knowledge base what action it should perform.
▪ Perform: It performs the selected action.
11
KNOWLEDGE REPRESENTATION
12
KNOWLEDGE TO REPRESENT
▪ Object: All the facts about objects in our world domain. E.g., Guitars contains
strings, trumpets are brass instruments.
▪ Events: Events are the actions which occur in our world.
▪ Performance: It describes behavior which involves knowledge about how to do
things.
▪ Meta-knowledge: It is knowledge about what we know.
▪ Facts: Facts are the truths about the real world and what we represent.
▪ Knowledge-Base: The central component of the knowledge-based agents is the
knowledge base. It is represented as KB. The Knowledgebase is a group of the
Sentences (Here, sentences are used as a technical term and not identical with the
English language).
13
APPROACHES TO KNOWLEDGE REPRESENTATION
It is the simplest way of storing facts which uses the relational method. Here, all the facts about a
set of the object are set out systematically in columns. Also, this approach of knowledge
representation is famous in database systems where the relationship between different entities is
represented. Thus, there is little opportunity for inference.
Example:
This is an example of representing simple relational knowledge.
▪ Inheritable knowledge
15
APPROACHES TO KNOWLEDGE REPRESENTATION
▪ Inferential knowledge
▪ Example: Let's suppose there are two statements: Marcus is a man
▪ All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)
16
APPROACHES TO KNOWLEDGE REPRESENTATION
▪ Procedural knowledge
▪ Procedural knowledge approach uses small programs and codes which describes how to
do specific things, and how to proceed.
▪ In this approach, one important rule is used which is If-Then rule.
17