Building Eliza - Creating An AI Chatbot with My 10 Year Old

"I had not realized ... that extremely short exposures to a relatively simple computer program could induce powerful delusional thinking in quite normal people."

Joseph Weizenbaum, 1968

If there is any doubt a chatbot would seem like science fiction to an average person in the 1980s, one just has to watch a “clap-on, clap-off” infomercial.

A generation ago, natural language processing was more magic than something that would show up in a product that would sit on your kitchen counter. Did most people imagine that Siri and Alexa would become an invisible part of the landscape of life? Now, my kids don't even register computer interactions as novel, though I still remember when these appeared as a sci-fi dream. When I was their age, human machine interfaces didn't extend much beyond the "clap-on, clap-off" infomercials which became part of the public consciousness with its sticky catch-line that I still remember three decades later.

Conversational AI systems were what you saw in the movies like WarGames. I never expected that I would build a bot with my 10 year old son that could hold its own against the movie's WOPR computer, minus the ability to launch a game of global thermonuclear war.

Although the prospect of building a chat bot may have seemed remote to me when I was a kid growing up in small town Maine, the groundwork had already been established. What does it take to make this happen? In this article, I provide some background on building my kid's first AI chatbot and show you how to adapt one for yourself. We worked from the ground up and now have a simple system that can hold its own against the best poop conversations younger siblings and a few adults can throw at it.

"Clap on, clap off, the clapper." I still remember the ad 30 years later. I hope someone gave that marketing person a raise!

"Would you like to play a game?" Wargames was nominated for three Academy Awards and introduced people to networks and talking computers. When released, the protocol TCP/IP had just been introduced and there were fewer than 1000 computer hosts on the internet.

IT Turned Out to Be Easy to Trick friends into believing they were talking to a real girl Named Eliza over a modem.

Using natural language processing to interact with a user can all be traced back to the Eliza program which was created between 1964 and 1966 at the MIT Artificial Intelligence Laboratory by Joseph Weizenbaum. The ground work extends even further back to the 1950s, but computational limits kept a real chatbot far from anything most people, or my 10 year old self, would get to experience even in the 1980s.

Eliza simulated conversation by using pattern matching and substitution to give users an illusion of understanding on the part of the program. Despite its simplicity, Eliza was remarkably effective. The basic program script was able to elicit emotional responses from users who began to perceive understanding and motivation in the program's output. Weizenbaum wrote, "I had not realized ... that extremely short exposures to a relatively simple computer program could induce powerful delusional thinking in quite normal people." Users unconsciously assumed Eliza's questions implied interest and emotional involvement, even when they knew that the program did not have real emotions.

I was first exposed to Eliza in the summer of 1992 where I created a simple version of Eliza in Scheme for an introductory computer class. The following year I was tricking friends into believing they were talking to a real girl over a modem when they were really just talking to the computer. The ease of this deceit was remarkable. The program was not always accurate, but I found that the user would simply ignore these and move on. It was a bit like they were talking to a crazy person they couldn't quite make sense of. It probably didn't hurt that a new mysterious girl would seem intriguing to almost any high school boy.

I decided it would be fun to make a modern version of this with my 10 year old son as a project for the two of us to do together. Eliza Bickford is a modern implementation of the original chatbot which uses Natural Language Processing and artificial intelligence to have a conversation with its user. Similar to the classic Eliza, it acts as a Rogerian therapist but can also answer questions about Minecraft, Fortnite, and human spaceflight by leveraging a database of more than 8000 keywords and associated responses. It can be easily extended to include knowledge about other topics and more advanced interactions. To interact, simply type in responses and it will have a conversation with you. A screenshot of the Scratch project (which runs best in a computer browser) is below. You can try it out and easily make edits at:

How Eliza Bickford Thinks

"No matter how sophisticated or powerful our thinking machines become, there still will be two kinds of people: those who let the machines do their thinking for them, and those who tell the machines what to think about."

C.J. Lewis

Arthur C. Clarke once said that any sufficiently advanced technology is indistinguishable from magic. In the case of Eliza, its behavior is pretty straightforward to follow and you can quickly start to think of ways to make it better. We extended the basic ideas of the original Eliza by using a dictionary of thousands of keywords, nouns, verbs, and adjectives to expand the richness of the responses and provide knowledge on specific topics.

The Scratch program “Eliza” sprite contains the natural language processing and response generation code. It works by first splitting inputs into discrete words which are processed to generate responses. The picture below shows the program flow for the following types of responses which are generated:

  • Generic : Using a canned response such as “Can you elaborate on that?”
  • Simple Parsing: Changing "My head hurts" to "Why do you say your head hurts?“ by adding a starting phrase and switching pronouns.
  • Keywords: Finding a keyword such as “joke” in the input produces a response such as “Why was 6 afraid of 7? Because 7, 8, 9”.
  • Dictionary: Combining a starter phrase with definitions so an input with the adjective “arduous“ gives “In what ways is it difficult and tiring?”
  • Logic: Generating a response if a pre-determined logic combination is found in the input. For example, “Apollo” AND “11” could give “Columbia/Eagle was launched with crew Aldrin, Armstrong, Collins”. The code can easily be modified for more advanced logic beyond the current a AND b cases.

Making Her Seem Alive

We became the god of this artificially created being and wielded the power of a kingdom that extended no further than our imaginations.

So what makes a computer seem human? Arguably this includes how it looks and how it sounds. We'll start with speech which is a major ingredient to make a hunk of Silicon appear human like. People always seem to focus on making robots look human when its the sound of someone's voice that I think it really allows the brain to make the leap. When I was almost 10 years old in the early 1980s, my father bought a Texas Instruments TI 99/4a computer which had a speech synthesizer which had the amazing ability to translate text into speech you could actually here. A few years later I got an Atari 1040ST as my first real computer. It came with a text to speech program that would say whatever you wanted it to in a boring metallic monotone voice. It sounded alien, from the future, or maybe just plain weird. Whatever it was, it was amazing and a superpower. I could command a machine so it came alive. I became the god of this artificially created being and wielded the power of a kingdom that extended no further than my imagination.

For our version of Eliza, Scratch conveniently offers and easy to use add-on that converts text strings into speech. It doesn't sound quite as smooth as Alexa or Siri, but it is still pretty good when you compare it to the tinny robot sounds that I first heard on my Atari. What is missing in scratch is the ability to talk to her. You still need to type responses, just like the original Eliza.

I could only imagine and dream about what I saw on Star Trek. Now my 10 year ago son is now surrounded with tools that he can talk to and interact with which doesn't seem that different than the computer on Enterprise, albeit stuck at a walking pace instead of warp speed. The next step to make Eliza seem real is to make her look real. Years ago I had used a program named Poser to create realistic 3D characters. Now there is a free tool called Daz 3D which can create very realistic looking character images. You pay for content, but there is enough free stuff to get you started. At this point, my son had lost interest, but I pushed ahead to create and animate Eliza which you can see below.

This is an example Eliza rendering done in Daz 3D. The character is posable and can be fully customized.

This was the first outfit and hair I chose. I eventually went with something a bit more conservative looking.

Even though I assumed I would only use the free stuff, I eventually broke down and purchased this hair content.

Flipping through images is a simple way to animate the character when real time rendering is not possible.

What happens When an 8 Year Old TalkS to Eliza.

Now that Eliza is running, it is interesting to see how it interacts with users. Nate's younger brother Luke (age 8) was the first test subject. As you might imagine, he focused on the hot topics for his age bracket. Here's a typical sample:

  • Eliza: Hi, I'm Eliza. What would you like to talk about?
  • You: poop
  • Eliza: Did you poop?
  • You: no i bet you did
  • Eliza: Are you sure?
  • You: yes
  • Eliza: I understand. Tell me more.

That kept the kids laughing for a while, but I also wanted to see how it would respond to other conversations. Here's a an example that follows along with Weizenbaum's original Rogerian therapist conversation:

  • Eliza: Hi, I'm Eliza. What would you like to talk about?
  • You: men are all alike.
  • Eliza: What resemblance do you see?
  • You: They're always bugging us about something or other.
  • Eliza: What are you thinking of?
  • You: Well my boyfriend made me come here.
  • Eliza: How does everyone else around you feel about that?

These types of conversations aren't that much different than what the original Eliza could do 50 years ago. What has really changed is the ability to leverage large keyword databases to generate responses. You can ask Eliza about manned space flights or Fortnite among other topics, and will often be able to generate a specific response like those shown below.

  • You: Tell me about Apollo 17.
  • Eliza: Apollo 17 was launched on Thursday, December 7, 1972, and flew for 301.9 hours, with crew Cernan, Evans, Schmitt using call sign America.
  • You: Please give me info on Viking mountain.
  • Eliza: In Fortnite season 9, "Viking Mountain" (B6) has 11 chests and is very popular as a landing spot.


There is still a lot of room for improvement, but you can see how the basic structure works and can probably visualize how to make it better with some simple additions and tweaks.

It is relatively easy to add additional keywords by loading in text files which contain the words and associated responses. I would keep track of them in Excel and then save it as a text file which could then be read into the project's relevant list variables. With a bit of extra work you can add more elaborate logic.

I always thought a great science fair project would be to build a chatbot around a new topic using this as a foundation. I encouraged Nate with a bot that answered questions about his school or something else he liked. Although I thought that would be cool, his interests had moved elsewhere by that point. A Scratch remix might be a great project for someone else though.

The keywords and responses variables store a few thousand basic outputs for a simple knowledge-base that you can easily modify to create a custom chat-bot on any topic. The logic variables enable more complex interactions.

Eliza was created by Nate (age 10) and Jim Bickford as a fun father and son programming project. We hope that you are able to enjoy it and find it useful as a starting point for your own project.

You can try it out and make your own version by looking inside and remixing the project: