This is a javascript version of ELIZA, the old chatbot from the 1960s, originally written by Joseph Weizenbaum. This version runs two copies of ELIZA, and allows you to send chat messages from one bot to the other. Additionally, there are three more personalities: an incel, a redpiller, and a sex therapist.
You can play the game at: ELIZA X ELIZA
It’s not a very good game, but is pretty eerie. It sometimes has interesting exchanges because one bot will dig into the other bot’s scripts to find keywords, and insert them into its responses, and will trigger a better response in turn.
Building it
I just asked Work (which is OpenCode) to build it. It failed due to some problems with writing large javascript files, so I decided it needed to be factored into multiple scripts.
To do this, I asked Work to tell me about ELIZA, and then to study the original code. It turns out people are recovering the sources of ELIZA. See ELIZA Archaeology Project.
I assumed this reading stuffed the context with enough information to do a better job writing code.
It then produced the application, script by script.
It produced an ELIZA that was in javascript. That, in itself, wasn’t novel, and has been done before.
Then, I asked it to make a two-pane version of ELIZA, with a feature that would turn the output of the first chat, into the input of the second chat.
Going dark
Then, I asked it to make three new personalities: a sex therapist, an incel, and a redpiller.
The LLM made up scripts for each of these personas, and made the persona selectable.
The conversations were boring, so I added a feature to seek out keywords in the other bot’s scripts, and insert them into the conversation.
(What might work better would be to write responses that include keywords to trigger interesting responses from other bots.)
Reading scripts
It’s more fun to read the bot guts than using the bot:
I wonder how the LLM pulled these phrases out of its model.