On this page
You can build a working chatbot in an afternoon without any AI: a short list of if-then rules, played out on paper or written in Python. Then see what modern AI adds.
How does a chatbot work without AI?
A rule-based chatbot is a program that looks for keywords in your message and returns a reply someone wrote in advance. A famous early example is ELIZA, which Joseph Weizenbaum of MIT described in Communications of the ACM in 1966.
In Weizenbaum's paper, keywords in your sentence trigger decomposition rules that split it up, and reassembly rules build the reply. His example: the pattern 0 YOU 0 ME splits "It seems that you hate me", and the reply rule turns it into "What makes you think I hate you?" With no keyword, ELIZA gave a content-free remark or reused an earlier transformation. He also pointed out that the rules, which he called a script, are data kept separate from the program itself.
ELIZA understood nothing; it rearranged your words. Yours will work the same way.
How do you make a chatbot on paper?
This works in a classroom, or at the dining table with a parent playing the user.
Pick a narrow job, for example a study buddy for exam week.
Write one rule card per topic, with keywords on the front and a reply on the back.
Write a fallback card that says: Tell me more.
One person plays the bot. They may only check the cards in order and read out the first reply that matches. No thinking allowed.
The other person chats for five minutes and writes down every reply that felt wrong.
Four starter cards:
hello, hi, namaste: "Hi! What are you studying today?"
physics: "Which chapter: mechanics, optics or electricity?"
tired, sleepy: "Take a short break, then try one more question."
formula: "Which formula? Tell me the chapter first."
How do you build the same chatbot in Python?
Make a list called rules. Each item pairs a few keywords with one reply, in the same order as your cards.
Write a function called reply. Its first line turns the message into lowercase words: words = message.lower().split()
Loop over the rules: for keywords, answer in rules, if any keyword is in words, return answer.
After the loop, return "Tell me more." That is your fallback card.
In a while loop, read text = input("You: ") and print("Bot:", reply(text)). Stop when the user types bye.
For a next Python project, try writing a projectile simulation in Python.
What does a language model add?
Send the same six messages to your bot and to any AI chatbot, and write down both replies:
hi
Hi!
I'm studying physics, then as a separate message: the second one
my brain is fried
What is the formula for kinetic energy?
What is on page 112 of my physics textbook?
Your bot will probably miss message 2 (punctuation), message 3 (it treats every message alone) and message 4 (no keyword). A language model usually copes, because nobody wrote its replies in advance. In their textbook Speech and Language Processing, Daniel Jurafsky and James Martin describe left-to-right language models as predicting output tokens one by one, conditioning on the prior context. That context includes your earlier messages, which is why "the second one" makes sense to it. For a plain-English walk-through, read how large language models work.
Message 6 shows the cost. Your bot spots "physics" and asks which chapter, which is unhelpful but invents nothing. A language model cannot see your textbook, so watch whether it says so or invents an answer. In a 2025 paper, Adam Tauman Kalai and colleagues argue that language models sometimes guess when uncertain, producing plausible yet incorrect statements, because training and evaluation reward guessing over admitting uncertainty.
Rule-based or language model: which is better for what?
Predictable: a rule bot says exactly what you wrote, every time. A language model's wording varies.
Coverage: a rule bot only handles what you planned for. A language model copes with new wording.
Memory: your bot forgets each message. A language model uses the conversation so far.
Checking: you can point to the rule that fired. With a language model you check the answer itself, against your book or teacher.
Hand-written rules also powered early computer tutors: see intelligent tutoring systems before ChatGPT.
Teaching asks for more than a good reply to each message: it means following a student's reasoning. Fermi's AI tutor is built to hold a line of reasoning across a whole session, notice where you are stuck, and decide whether to explain, ask or show.
Start with the four cards tonight, and add one rule for every reply that felt wrong.



