Unit 6 Overview: Knowledge-Based Agents and Inference
Unit 6: Knowledge-Based Agents and Inference — Overview
Last week you learned the language of formal logic — how to write propositions, evaluate connectives, and test for entailment. This week you’ll see that language put to work inside an AI agent. A knowledge-based agent stores facts and rules in a knowledge base, then uses an inference engine to derive conclusions and decide what to do.
Get an introduction to knowledge-based agents and how they use logic to reason and act.
Learning Objectives
By the end of this unit you will be able to:
-
Explain how a knowledge-based agent uses a knowledge base and an inference engine to act intelligently.
-
Implement the TELL and ASK interface to add facts and query a knowledge base.
-
Apply inference rules — modus ponens, and-elimination, and resolution — to derive new facts.
-
Trace forward chaining (data-driven) inference through a step-by-step example.
-
Trace backward chaining (goal-driven) inference through a step-by-step example.
-
Explain what Horn clauses are and why they make inference computationally efficient.
-
Describe the frame problem and at least two strategies for solving it (STRIPS assumption, successor-state axioms).
-
Build a domain-specific expert system using a forward-chaining inference engine in Python.
Why Knowledge-Based Agents Matter
Knowledge-based agents separate what an agent knows from how it reasons. You can add new domain facts without touching the inference algorithm — and the same algorithm works equally well for medicine, robotics, or tax law.
This separation was the foundation of the expert-system revolution of the 1970s–1980s. MYCIN used 600+ rules to diagnose blood infections and matched the accuracy of junior doctors. XCON configured VAX computer systems using 10,000+ rules, saving Digital Equipment Corporation millions of dollars annually. The same principles appear today in clinical decision-support tools, financial compliance engines, and smart-home automation.
Knowledge-based AI is explainable by design: the system can always show you the chain of rules it used to reach a conclusion. This traceability is increasingly important as organizations are held accountable for automated decisions.
Reading Assignments
- Berkeley CS 188 Online Textbook: Logic and Knowledge Representation
-
Sections on KB agents and inference.
- Berkeley CS 188: Propositional Logic in Practice
-
Forward and backward chaining algorithms, Horn clauses.
Weekly Schedule
| Days | Topic | Activity |
|---|---|---|
1—2 |
KB agents, tell-ask interface, inference rules |
Read 6.1 and 6.2; watch Videos 15 and 16 |
3—4 |
Forward chaining and backward chaining |
Read 6.3 and 6.4; watch Video 17 |
5—6 |
Horn clauses, the frame problem, expert systems |
Read 6.5, 6.6, and 6.7 |
7 |
Expert System Lab |
Complete lab notebook; submit by end of day |
Prerequisites: This unit builds directly on Unit 5 (Propositional Logic). You should be comfortable with truth tables, logical connectives (AND, OR, NOT, implies), and the concept of entailment before beginning. If you need a quick review, revisit Section 5.1 before reading Section 6.1.
Based on the UC Berkeley CS 188 Online Textbook by Nikhil Sharma, Josh Hug, Jacky Liang, and Henry Zhu, licensed under CC BY-SA 4.0.
This work is licensed under CC BY-SA 4.0.