Knowledge-Based Agent in Artificial intelligence (AI)

In this page we will learn about Knowledge Based Agent in Artificial intelligence (AI), The architecture of knowledge based agent, Why use a knowledge base?, Inference system, Operations Performed by KBA, A generic knowledge-based agent, Various levels of knowledge-based agent, Knowledge level, Logical level, Implementation level, Approaches to designing a knowledge based agent, Declarative approach, and Procedural technique.

Knowledge-Based Agent in Artificial intelligence

  • For efficient decision-making and reasoning, an intelligent agent need knowledge about the real world.
  • Knowledge-based agents are capable of maintaining an internal state of knowledge, reasoning over that knowledge, updating their knowledge following observations, and taking actions. These agents can use some type of formal representation to represent the world and act intelligently.
  • Knowledge-based agents are composed of two main parts:
    • Knowledge-base and
    • Inference system

The following must be able to be done by a knowledge-based agent:

  • Agents should be able to represent states, actions, and other things.
  • A representative New perceptions should be able to be incorporated.
  • An agent's internal representation of the world can be updated.
  • An agent can infer the world's intrinsic representation.
  • An agent can deduce the best course of action.

The architecture of knowledge-based agent:

Knowledge Based Agent in AI in Artificial Intelligence (AI)

A generic architecture for a knowledge-based agent is depicted in the diagram above. By observing the environment, the knowledge-based agent (KBA) receives input from it. The input is taken by the agent's inference engine, which also communicates with KB to make decisions based on the knowledge store in KB. KBA's learning component keeps the KB up to date by learning new information.

Knowledge base: : A knowledge-based agent's knowledge base, often known as KB, is a critical component. It's a group of sentences ('sentence' is a technical term that isn't the same as'sentence' in English). These sentences are written in what is known as a knowledge representation language. The KBA Knowledge Base contains information about the world.

Why use a knowledge base?

For an agent to learn from experiences and take action based on the knowledge, a knowledge base is required.

Inference system

Inference is the process of creating new sentences from existing ones. We can add a new sentence to the knowledge base using the inference mechanism. A proposition about the world is a sentence. The inference system uses logical rules to deduce new information from the KB.
The inference system generates new facts for an agent to update the knowledge base. An inference system is based on two rules, which are as follows:

  • Forward chaining
  • Backward chaining

Operations Performed by KBA

Following are three operations which are performed by KBA in order to show the intelligent behavior:

  • TELL: This operation tells the knowledge base, what it discern from the environment.
  • ASK: This operation asks the knowledge base what action it should perform.
  • Perform: It performs the selected action.

A generic knowledge-based agent:

The structure outline of a generic knowledge-based agents program:

    function KB-AGENT(percept):  
        persistent: KB, a knowledge base   
    t, a counter, initially 0, indicating time   
    TELL(KB, MAKE-PERCEPT-SENTENCE(percept, t))   
    Action = ASK(KB, MAKE-ACTION-QUERY(t))   
    t = t + 1  
    return action

The knowledge-based agent receives a percept as input and responds with an action. The agent is in charge of the knowledge base, KB, and it comes with some real-world experience. It also features a counter that starts at zero to indicate how long the entire operation will take.
When the function is called, it conducts the following three operations:

  • To begin, it TELLS the KB what it sees.
  • Second, it asks the KB what action it should take.
  • Finally, the third agent program informs the KB of the action that was chosen.

The MAKE-PERCEPT-SENTENCE command constructs a sentence indicating that the agent perceived the specified percept at the specified time.

The MAKE-ACTION-QUERY command provides a statement that asks which action should be taken right now.

MAKE-ACTION-Statement creates a sentence stating that the selected action was carried out.

Various levels of knowledge-based agent:

1. Knowledge level:

The first level of a knowledge-based agent is the knowledge level, where we must explain what the agent knows and what the agent's goals are. We can correct its behavior using these specs. Let's say an automated taxi agent needs to get from station A to station B, and he knows how to get there, so this is a knowledge problem.

2. Logical level:

We understand how the knowledge representation of knowledge is stored at this level. Sentences are encoded in various logics at this level. At the logical level, knowledge is encoded into logical statements. We can expect the automated taxi agent to arrive at destination B on a rational level.

3. Implementation level:

Physical representation of logic and knowledge (implementation level). Agents at the implementation level take actions based on their logical and knowledge levels. At this phase, an autonomous cab driver puts his knowledge and logic into action in order to go to his destination.

Approaches to designing a knowledge-based agent:

Building a knowledge-based agent can be done in one of two ways:

1.Declarative approach:

A knowledge-based agent can be created by starting with an empty knowledge base and informing the agent all the sentences we wish to start with. Declarative approach is the name given to this method.

2. Procedural technique:

: We directly express desired behavior as a program code in the procedural approach. That is, all we need to do is develop a program that already has the intended behavior or agent encoded in it.
In the actual world, however, a successful agent can be created by mixing declarative and procedural approaches, and declarative information can frequently be turned into more efficient procedural code.