AI Dictionary of Terms

Expert Systems

An early branch of artificial intelligence (prominent in the 1970s and 1980s) designed to emulate the decision-making ability of a human expert by using a comprehensive, hand-coded knowledge base and a set of logical inference rules, rather than learning from data.

The Simple Version

Imagine a flowchart created by the world’s best mechanic to diagnose car problems.

An Expert System is a computer program built exactly like this, but with thousands of complex, interconnected rules. You ask it a question, it walks through its massive, human-written flowchart, and gives you an expert-level diagnosis. Unlike modern AI, it doesn’t “learn” from experience; it only knows exactly what the human experts programmed into it.

Detailed Explanation

Expert Systems were the first commercially successful form of AI, predating the machine learning revolution. They are a prime example of Symbolic AI or Good Old-Fashioned AI (GOFAI).

Core Architecture:

  1. Knowledge Base: The heart of the system. A vast repository of facts and heuristic rules (IF-THEN statements) extracted from human domain experts through a painstaking process called “knowledge engineering.”
  2. Inference Engine: The “brain” that applies logical rules to the knowledge base to deduce new information or reach a conclusion. It typically uses:
    • Forward Chaining: Starting with known facts and applying rules to reach a goal (data-driven).
    • Backward Chaining: Starting with a hypothesis and working backward to see if the facts support it (goal-driven).
  3. User Interface: Allows non-expert users to query the system and receive explanations for its conclusions.
  4. Explanation Facility: A crucial feature that allows the system to explain why it asked a certain question or how it reached a specific conclusion (e.g., “I recommend replacing the alternator BECAUSE the battery is charged AND the engine won’t turn over”).

Historical Examples:

Why Expert Systems Declined:

Key Characteristics

Business Context

While pure Expert Systems are largely obsolete, their legacy lives on:

Modern Revival & Hybrids:

Lessons for Modern AI: The “Explanation Facility” of expert systems is the direct ancestor of modern Explainable AI (XAI). The failure of expert systems due to brittleness is a cautionary tale for modern AI: systems that cannot handle edge cases or explain their reasoning will ultimately fail in production.

Real-World Analogy

A cookbook vs. a master chef. An Expert System is like a highly detailed cookbook. If you follow the steps exactly, you get a predictable result. But if you are missing an ingredient or the oven runs hot, the cookbook cannot adapt. A modern Machine Learning model is more like a master chef who can taste the dish, realize it needs more salt, and adapt on the fly based on experience.

Code Example

# A simple, modern implementation of an Expert System (Rule-Based Inference)

class ExpertSystem:
    def __init__(self):
        # The Knowledge Base: A set of IF-THEN rules
        self.rules = [
            {"if": ["fever", "cough"], "then": "possible_flu", "confidence": 0.8},
            {"if": ["fever", "stiff_neck", "headache"], "then": "possible_meningitis", "confidence": 0.95},
            {"if": ["possible_flu", "body_aches"], "then": "recommend_rest_and_fluids", "confidence": 0.9}
        ]
        self.facts = set()
        self.conclusions = []

    def add_fact(self, fact):
        self.facts.add(fact)
        self._infer()

    def _infer(self):
        # Forward chaining inference engine
        for rule in self.rules:
            # Check if all conditions in the 'if' part are met by current facts
            if all(condition in self.facts for condition in rule["if"]):
                conclusion = rule["then"]
                if conclusion not in self.conclusions:
                    self.conclusions.append(conclusion)
                    # Add the conclusion as a new fact to trigger further rules
                    self.facts.add(conclusion)
                    print(f"🧠 Inferred: {conclusion} (Confidence: {rule['confidence']})")

# Usage
doctor_ai = ExpertSystem()

print("User reports: fever, cough")
doctor_ai.add_fact("fever")
doctor_ai.add_fact("cough")

print("\nUser reports: body_aches")
doctor_ai.add_fact("body_aches")

print("\nFinal Recommendations:", doctor_ai.conclusions)
# Output will show the system logically chaining the symptoms to a diagnosis 
# and then to a recommendation, exactly as a human expert's flowchart would.

Common Misconceptions

Sources & Further Reading