Expert systems capture the knowledge of human specialists in a computer program that gives advice in a narrow field.
What Is an Expert System
An expert system is a program that mimics the decision-making of a human expert in a specific domain, using a knowledge base of facts and rules and an inference engine. It emerged in the 1970s–80s as the first commercially successful AI technology. Expert systems are narrow in scope, explain their reasoning, and deal with uncertain and incomplete information. Domains: medical diagnosis, fault diagnosis of machines, financial planning, geology, configuration of computers and legal advice.
Definition: Expert system. A computer program that uses a knowledge base of rules and facts from a human expert and an inference engine to give advice or solve problems in a specialised domain, with the ability to explain its conclusions.
Architecture
The main components are: the knowledge base (domain facts and heuristic rules, usually IF–THEN production rules); the inference engine (applies rules to facts using forward or backward chaining, resolves conflicts, handles uncertainty); the working memory (case-specific facts and conclusions so far); the user interface (asks questions and shows results); the explanation facility (answers "Why do you ask?" and "How did you reach this?"); the knowledge acquisition module (tools to collect knowledge from experts, by the knowledge engineer); and sometimes a learning module. Separating the knowledge base from the engine means that the same shell (CLIPS, Jess, Prolog) can be reused for new domains.
People Involved
The domain expert provides the knowledge; the knowledge engineer elicits and encodes it; the user consults the system. Knowledge acquisition is the main bottleneck.
Role, Advantages and Limits
Expert systems preserve scarce expertise, give consistent, available (24 × 7) advice, reduce cost and train novices, and do not tire. Limitations: narrow domain, no common sense, brittleness at the edge of knowledge, difficulty of knowledge acquisition and maintenance, no real learning (in classical systems), and responsibility questions when advice is wrong. Today their ideas live on in business rule engines, diagnostic tools and decision-support systems, often combined with machine learning.
Table 4.6: Expert system components
| Component | Function | Example |
|---|---|---|
| Knowledge base | Rules and facts | IF fever AND rash THEN measles |
| Inference engine | Reasoning | Forward or backward chaining |
| Working memory | Current case data | Patient's symptoms |
| Explanation facility | Justify conclusions | "I asked about rash because..." |
| Knowledge acquisition | Build the knowledge base | Interviews with doctors |
Example 4.6: A small rule-based diagnosis
Problem: Rules: R1 IF fever AND cough THEN flu-suspected; R2 IF flu-suspected AND body-ache THEN flu; R3 IF flu THEN advise rest. Facts: fever, cough, body-ache. What is concluded?
Solution:
- R1 matches fever and cough: add flu-suspected.
- R2 matches flu-suspected and body-ache: add flu.
- R3 matches flu: add advise rest.
- The explanation facility can list the chain R1 → R2 → R3 for "How?".
Result: The system concludes flu and advises rest, with the rule chain as its explanation.
rules = [({"fever", "cough"}, "flu-suspected"),
({"flu-suspected", "body-ache"}, "flu"),
({"flu"}, "advise-rest")]
facts = {"fever", "cough", "body-ache"}
trace = []
for _ in range(3):
for i, (cond, concl) in enumerate(rules, 1):
if cond <= facts and concl not in facts:
facts.add(concl)
trace.append(f"R{i}: {concl}")
print(trace)
Output
['R1: flu-suspected', 'R2: flu', 'R3: advise-rest']
Common mistakes
- Expecting an expert system to handle problems outside its domain.
- Mixing the knowledge into the program code instead of keeping a separate knowledge base.
- Underestimating the effort of knowledge acquisition.
- Treating the system's advice as infallible.
Key takeaways
- Expert system = knowledge base + inference engine + working memory + interface + explanation.
- Knowledge comes from domain experts through knowledge engineers.
- It is narrow, explains its reasoning and handles uncertainty.
- Limits: brittleness, no common sense, knowledge acquisition bottleneck.
Practice questions
- Name the main components of an expert system.
- What does a knowledge engineer do?
- What is the role of the explanation facility?
Answers to the practice questions
- Knowledge base, inference engine, working memory, user interface, explanation facility and knowledge acquisition module.
- Elicits knowledge from the domain expert and encodes it in the knowledge base.
- To tell the user why a question is asked and how a conclusion was reached.
Sources
- Official BCA syllabus Artificial Intelligence, course code 26BCA404DS04, Unit IV
