Introduction to Knowledge-Based AI
What is Knowledge-Based AI?
Knowledge-Based Artificial Intelligence (KBAI) is a type of AI that uses
stored knowledge (facts and rules) and logical reasoning to solve
problems and make decisions.
“A Knowledge-Based Agent is an AI system that uses an explicit Knowledge
Base (KB) made up of facts and rules to analyze situations, derive
conclusions and answers queries or take appropriate actions.”
Structure of Knowledge-Based AI System :-
[Link] Base:-
The Knowledge Base stores all the information required to solve problems
Specific information about the current situation.
What It Stores
2 Inference Engine (Brain of the System) :-
The Inference Engine is the core reasoning component of a Knowledge-
Based Artificial Intelligence (KBAI) system.
It is responsible for applying logical rules to the knowledge base in order
to derive new information or reach conclusions.
Functions of the Inference Engine
The inference engine performs several important theoretical functions:
1️⃣ Pattern Matching
It compares known facts with the conditions of rules.
If the condition of a rule is satisfied, the rule becomes eligible for execution.
2️⃣ Rule Activation (Rule Firing)
When a rule’s condition is satisfied, the inference engine executes it.
This process is called rule firing.
Example (Theoretical Form):
IF A AND B
THEN C
If A and B are true, then C is concluded.
3️⃣ Conflict Resolution
Sometimes multiple rules are satisfied at the same time.
The inference engine must decide:
• Which rule should be applied first?
• Which rule has higher priority?
This selection process is called conflict resolution.
4️⃣ Updating Working Memory
After firing a rule, new facts are added to the working memory.
These new facts may activate other rules.
This creates a chain of reasoning.
🔁 Reasoning Strategies Used by
Inference Engine
The inference engine mainly uses two reasoning techniques:
1️⃣ Forward Chaining (Data-Driven
Reasoning)
• Starts with available facts
• Applies rules
• Moves toward conclusion
Structure:
Facts → Rule Matching → New Facts → Conclusion
Used in:
• Monitoring systems
• Control systems
2️⃣ Backward Chaining (Goal-Driven
Reasoning)
• Starts with a goal or hypothesis
• Checks if rules support it
• Works backward to verify facts
Structure:
Goal → Required Rule → Required Facts
Used in:
• Diagnostic systems
• Expert advisory systems
Explanation Facility_-
The Explanation Facility is a component of a knowledge-based
system that provides justification and reasoning behind the
conclusions generated by the inference engine.
In simple words:
It answers the questions:
• Why?
• How?
User Interface:-
The User Interface (UI) is the component of a Knowledge-
Based AI system that allows communication between the
user and the system.
It acts as a bridge between:
• Human user
• Knowledge-based system
Command-Line Interface (CLI)
• User types commands
• Used in early expert systems
2️⃣ Menu-Based Interface
• User selects options from menus
3️⃣ Graphical User Interface (GUI)
• Buttons, forms, icons
• Most common today
4️⃣ Natural Language Interface
• Users type questions in normal language
• Used in chatbots
Solving One Problem Using
Knowledge-Based AI Model
Let’s solve one real-life problem using a complete
Knowledge-Based AI structure.
problem: Bank Loan Approval
System
A person applies for a loan.
Applicant Details:
• Income = ₹18,000
• Credit Score = 580
• Loan Amount = ₹2,00,000
System must decide:
Approve or Reject Loan?
Knowledge-Based AI Model Used
⃣: User Interface
User enters:
• Income = 18,000
• Credit Score = 580
• Loan Amount = 2,00,000
UI sends this data to the system.
: Knowledge Base (Stored Rules)
The system already has expert-defined rules:
Rule 1:
IF Income ≥ ₹25,000
AND Credit Score ≥ 650
THEN Loan = Approved
Rule 2:
IF Income < ₹20,000
AND Credit Score < 600
THEN Loan = Rejected
Inference Engine (Reasoning)
System checks conditions:
Income = 18,000 (< 20,000)
Credit Score = 580 (< 600)
Rule 2 condition satisfied
Rule fires.
Decision
Conclusion:
Loan = Rejected
Explanation Facility
If applicant asks:
“Why was my loan rejected?”
System replies:
“Loan was rejected because your income is below ₹20,000
and credit score is below 600 as per Rule 2.”
Complete Workflow Summary
User Input
⬇
Facts Stored
⬇
Rules Checked
⬇
Matching Rule Found
⬇
Rule Fired
⬇
Conclusion Generated
⬇
Explanation Given