# Rule-Based and Expert Systems

> How early AI was built from if-then rules that people wrote. Why expert systems boomed in the 1980s, and why rules break on messy tasks.

**Course:** [AI Basics](https://learn.benibix.com/learn/ai-foundations)  
**Time:** 11 min

**After this lesson you can:**

- Explain how a rule-based system decides
- Say what made expert systems useful
- Spot a task too messy for rules written by hand

## How AI was built from rules

A rule-based system is a program that decides by following rules people wrote. Each rule reads: if this is true, then do that. In the 1970s, one program at Stanford used about 600 such rules to suggest which germ was causing a blood infection. It never learned a thing by itself.

This was how most AI was built for its first 30 years. The idea behind it is called symbolic AI. Facts are written as words a person can read, such as 'a robin is a bird' and 'a bird has wings'. The program joins facts with logic to reach new ones.

The big strength is that you can read every step. Ask why it said no, and it can show the exact rule. That matters in a bank or a hospital, where someone must explain each choice. Rules are also cheap to run and easy to change.

An expert system is a rule-based program that copies how a human expert decides. Builders sat with doctors or engineers and asked how they worked. Then they wrote it all down as hundreds or thousands of rules. In the 1980s, many big firms bought one. They were the hot AI idea of that decade.

Then the rule books ran into trouble. Each new case needed a new rule, and new rules clashed with old ones. Experts could not put all they knew into words. Keeping a big rule book up to date took a whole team. Many firms gave up, and the money moved away.

Rules fail worst on messy tasks, like naming a face in a photo. No one can write the rules for what makes a face. There are too many angles, lights and hair styles. Learning from examples works far better there, which is why it took over.

Rules did not go away, though. Banks still block a card with rules like 'two countries in one hour'. Many apps join the two ways: a learned model gives a score, and a written rule decides what to do with it. People call rules old when they are often just the right tool.

![Two rows. In the top row, a person writes a rule, if a card pays in 2 countries in 1 hour then block it, and a program follows the rule to an answer. In the bottom row, examples go into training, which finds the patterns and makes a model of learned rules that gives the answer.](https://learn.benibix.com/diagrams/ai-rules-vs-learning.svg)

### Example: Lucy writes rules for refunds

Lucy's online shop gets 300 refund requests a week. She writes 12 rules, such as: if the order is under 30 days old and unopened, approve it.

The rules settle 240 requests on their own. The other 60 fit no rule, so a person reads them. She can show any customer the exact rule behind each answer.

**Words in this lesson:** [Rule-Based System](https://learn.benibix.com/term/ai/rule-based-system), [Expert System](https://learn.benibix.com/term/ai/expert-system), [Symbolic AI](https://learn.benibix.com/term/ai/symbolic-ai)

**Question:** Why did rules written by hand struggle with tasks like naming faces?

**Answer:** No one can write rules for every angle, light and face. A face can look different in endless ways. A rule book for all of them never ends, so learning from examples works far better.

---

Source: https://learn.benibix.com/learn/ai-foundations/rule-based-and-expert-systems
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
