Make Your Own Expert System — Lab
Edit IF–THEN rules live and watch ten animal cases classify or fail. The brittleness wall — symbolic AI's central problem — in your hands.
An interactive companion to Make your own expert system — edit IF–THEN rules in real time and watch ten animal cases classify themselves or fail. The brittleness wall is the whole pedagogical point.
Make your own expert system
A real production-rule engine running in your browser. Add or remove IF-THEN rules. Watch ten test cases classify themselves — or fail to. The moment you hit the brittleness wall is the whole pedagogical point.
Before you start
Read this short panel first. It tells you what the lab is, what it is trying to make you see, and how you will know if you got there.
🎯 Purpose
The lab is a tiny animal-classification expert system. You have a list of rules of the form IF [facts] THEN [classification], and a list of ten test cases (each a set of animal facts). The engine runs your rules against each case and reports whether each case was classified or fell through. You can add, edit, and delete rules in real time. The classifications are simple labels (mammal, bird, fish, reptile, etc.), and the facts are short tokens like has-fur, lays-eggs, swims, flies. This is the exact mechanism that ran inside 1980s expert systems like MYCIN and XCON — just at hobby scale.
💡 What it is trying to make you see
That a rule-based system is fully transparent — you can point at the rule that fired and explain every classification — and fully brittle — anything not covered by an explicit rule simply fails. The companion article describes this dual property in words; the lab lets you experience both sides yourself. Start by removing one rule and watching what happens to the coverage. Then add a rule that handles a previously-unmatched case and watch the count rise. The trade-off is in your hands.
✅ What you should understand after playing
After a couple of minutes of editing rules, you should leave able to:
- Explain in one sentence why removing a single rule causes one or more test cases to suddenly fail — and why this is exactly what an LLM would NOT exhibit on the same task.
- Add a new rule and predict which test cases it will now match. Verify the prediction by running the engine.
- Catch yourself spotting the moment when the rule set almost handles all ten cases but a slight variation slips through — the famous "platypus problem" of symbolic AI in miniature.
If those three are true for you when you leave, the lab did its job. If not, try the worked example below: remove the "feathers" rule and watch what happens.
How to use it — 30 seconds
- Look at the rules. Six starter rules ship with the lab. Each says "if a case has these facts, classify it as X."
- Look at the cases. Ten animal cases on the right. Each shows the facts and the rule-engine verdict (matched / unmatched).
- Edit the rule set. Delete rules with the × button. Add rules with the form at the bottom. The cases re-classify automatically on every change.
A worked example
Delete the has-feathers → bird rule. Watch two cases (eagle, penguin) flip from matched to unmatched. Now add a new rule: flies AND lays-eggs → bird. Eagle is matched again — but penguin is still unmatched, because penguins don't fly.
This is symbolic AI's central problem. Every edge case (flightless birds, egg-laying mammals, fish that walk) needs its own rule, or the system silently fails on it. With twenty animals you can keep up. With twenty thousand, you can't.
The expert system
Rules on the left. Test cases on the right. Both update live as you edit.
Rules
Format: fact1, fact2, … → classification. All facts must be present for the rule to fire.
Test cases
Ten animals. The engine runs every rule against every case.
Lab #6. Companion to What is symbolic AI? The original recipe — and where it still wins. Feedback welcome.