AI Notes
Master expert systems. Architecture, knowledge base. AI systems 2024.
What Are Expert Systems?
An expert system is an AI program that emulates the decision-making ability of a human expert in a specific domain. Unlike general-purpose AI, expert systems encode specialized knowledge through rules, facts, and reasoning mechanisms to solve problems that normally require human expertise—medical diagnosis, financial planning, equipment troubleshooting, or legal reasoning.
Expert systems were among the first commercially successful AI applications in the 1970s and 1980s. MYCIN diagnosed blood infections, DENDRAL identified chemical structures, and XCON configured computer systems at Digital Equipment Corporation. While modern machine learning has supplanted expert systems for many tasks, the architecture remains relevant in domains requiring explainable decisions, regulatory compliance, or situations where training data is scarce but expert knowledge is available.
Architecture of an Expert System
Core Components
| KNOWLEDGE | WORKING | |
|---|---|---|
| BASE | MEMORY | |
| (rules & | (current | |
| facts) | case data) |
Knowledge Base
Contains domain expertise encoded as:
IF-THEN Rules
IF temperature > 100°F AND cough = yes AND headache = yes
THEN diagnosis = flu (confidence 0.8)
Facts
normal_body_temperature = 98.6°F
flu_incubation_period = 1-4 days
Meta-rules (rules about rules)
IF confidence < 0.5 THEN ask_more_questions
IF two_rules_conflict THEN prefer_more_specific_rule
Working Memory
Stores facts about the current problem being solved:
Inference Engine
The reasoning mechanism that applies rules to facts:
Forward Chaining (data-driven)
Start with known facts
Find rules whose conditions are satisfied
Fire those rules → add new facts
Repeat until goal reached or no more rules fire
Backward Chaining (goal-driven)
Start with a hypothesis (goal)
Find rules that could prove the goal
Check if rule conditions are met
If not, set conditions as sub-goals
Repeat recursively
Worked Example: Medical Diagnosis Expert System
Knowledge Base (Simplified)
| Rule 1 | IF fever AND runny_nose AND sneezing THEN cold (0.7) |
| Rule 2 | IF fever AND cough AND body_ache THEN flu (0.8) |
| Rule 3 | IF fever AND rash AND joint_pain THEN dengue (0.9) |
| Rule 4 | IF high_fever AND stiff_neck AND confusion THEN meningitis (0.95) |
| Rule 5 | IF cough AND no_fever AND duration > 3_weeks THEN TB_screening (0.6) |
Forward Chaining Trace
| Working Memory | {fever=yes, cough=yes, body_ache=yes, runny_nose=no} |
| Cycle 1 | Check all rule conditions |
| Rule 1: fever ✓, runny_nose ✗ | NOT FIRED |
| Rule 2: fever ✓, cough ✓, body_ache ✓ | FIRED! |
| Rule 3: fever ✓, rash=unknown | NOT FIRED |
| Rule 4: high_fever=unknown | NOT FIRED |
| Rule 5: cough ✓, no_fever ✗ | NOT FIRED |
| Result | Add "diagnosis = flu (confidence 0.8)" to working memory |
| Cycle 2: No new rules fire | HALT |
| Output | "Likely diagnosis: Influenza (80% confidence)" |
Backward Chaining Trace
| Goal | Is this dengue? |
| Step 1 | Rule 3 can prove dengue |
| Need | fever AND rash AND joint_pain |
| Step 2: Check fever | YES (in working memory) |
| Step 3: Check rash | UNKNOWN → ASK USER |
| User response | "No rash" |
| Step 4: Rule 3 fails | dengue ruled out |
| Goal | Is this flu? |
| Step 1 | Rule 2 can prove flu |
| Need | fever AND cough AND body_ache |
| Step 2: All present | flu confirmed (0.8) |
Knowledge Acquisition
The "knowledge engineering bottleneck" is the biggest challenge in building expert systems:
Methods
1. Expert interviews: Structured sessions with domain experts
2. Protocol analysis: Expert thinks aloud while solving problems
3. Case-based learning: Study expert's past decisions
4. Document analysis: Extract rules from manuals/textbooks
Challenges
- Experts often can't articulate their reasoning (tacit knowledge)
- Multiple experts may disagree
- Knowledge changes over time (maintenance burden)
- Rare edge cases are hard to capture
Advantages and Limitations
Advantages
- Explainable: Can trace every reasoning step (unlike neural networks)
- Consistent: Same input always produces same output (no randomness)
- Preserves expertise: Captures knowledge of retiring experts
- Works with few examples: Rules can encode knowledge without training data
- Regulatory compliance: Reasoning is auditable and verifiable
Limitations
- Brittle: Fails on cases outside its rule set (no generalization)
- Knowledge bottleneck: Extremely expensive to build and maintain
- No learning: Cannot improve from experience without manual updates
- Narrow domain: Each system solves one specific problem type
- Combinatorial explosion: Many rules create complex interactions
Expert Systems vs. Machine Learning
| Aspect | Expert Systems | Machine Learning |
|---|---|---|
| Knowledge source | Human experts | Data |
| Explainability | High (rule trace) | Low (black box) |
| Maintenance | Manual rule updates | Retrain on new data |
| Generalization | Poor (brittle) | Good (interpolation) |
| Data requirements | Minimal | Large datasets |
| Best for | Rare events, compliance | Pattern recognition |
Modern Relevance
Expert systems aren't dead—they've evolved:
| Clinical Decision Support | Rule-based alerts in hospitals |
| "Patient on Drug X prescribed Drug Y | interaction warning" |
| Business Rules Engines | Drools, IBM ODM |
| Hybrid Systems | Neural networks + rule-based verification |
| Knowledge Graphs | Modern evolution of knowledge bases |
Interview Questions
Q: When would you choose an expert system over machine learning? A: When you need explainable decisions (medical, legal), have limited data but available domain experts, require regulatory auditability, or the domain has well-defined rules that rarely change. Also when errors must be traceable to specific logic.
Q: What is the difference between forward and backward chaining? A: Forward chaining starts with facts and derives conclusions (data-driven, good when many conclusions possible). Backward chaining starts with a hypothesis and tries to prove it (goal-driven, good when you're testing specific possibilities). MYCIN used backward chaining; production systems use forward chaining.
Q: How do expert systems handle uncertainty? A: Through certainty factors (MYCIN), Bayesian probability networks, fuzzy logic membership values, or Dempster-Shafer theory. Each rule carries a confidence score that propagates through the inference chain.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Expert Systems - Knowledge-Based AI.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Artificial Intelligence topic.
Search Terms
artificial-intelligence, artificial intelligence, artificial, intelligence, expert, systems, introduction, expert systems - knowledge-based ai
Related Artificial Intelligence Topics