A chat bot for one

Ian McCrystal
9 min readApr 11, 2018

More and more in my work I find myself asking, “how should this feature make the user feel?” It turns out, product development is often as much about managing the user’s emotional state as it is about helping them achieve a goal.

We see this everywhere in tech: Twitter makes people feel heard. Uber makes people feel powerful. AirBnB makes people feel adventurous. Of course these products also solve problems, but if you removed the emotional aspect you might not recognize them.

So it’s useful to think of a product as the set of experiences and emotional responses through which some technology or solution is delivered.

For some things, feelings don’t matter very much, for others, the feeling *is* the objective. Most products land somewhere in the middle on this spectrum from pure utility to pure emotion. On the far right is what we’d probably call Art and on the far left, is Jira.

Just kidding, Jira makes me feel lots of things. 😊

As technologists, we tend to approach things from a utility mindset but I wanted to spend some time exploring the right end of this spectrum, so I recently set out to build a weekend project that was primarily about emotional delivery rather than problem solving.

The extra neat thing about this project is that it had an intended user base of one (well, two, if you count me), and I knew that user pretty well.

Here’s what I came up with:

❤️ Conianbot

👆 Facebook Messenger

Conianbot is an interactive time-capsule and storytelling bot that I gifted to my partner last Valentine’s day while she was traveling abroad for work. Conianbot knows about some of the best moments in our relationship and will deliver them when prompted or, while in story mode, it will weave these moments together into a multi-chapter story experience, starting with our first meeting and covering roughly the first 1.5 years of our relationship.

The story takes about 15 minutes to complete and does some pretty sappy stuff, like this:

The primary objective of this product was to deliver a delightful, emotional experience to my partner.

The secondary objective was to give us a little digital companion that we could return to at any time in the future.

The final objective was for me to learn how to build a chat bot! 🤖🔨

🛠 Implementation

** Skip this section if you don’t care about the tech.**

The bot server is built in python and is running on Heroku (free tier 🙌). It uses a PostgreSQL database to keep track of users and maintain their place in the story so they can leave and return whenever they want. The content is hosted on Amazon S3 and consists of a few dozen images, gifs, and some videos. The bot finds out about messages via webhooks that it receives from Facebook and POSTs responses to a Facebook Messenger api.

Here’s quick sketch of how it works:

The architecture of…love? 🤦

It took about 1 full weekend to build working basically around the clock. The majority of that time was spent plotting the story and iterating on the script. There are no tests, it won’t scale to millions of users, and there are probably some bugs I never found or bothered to fix.

The bot has a very limited vocabulary and, as a result, has to be quite directive in its messaging: It needs to present the user with clear signals about what is possible or what should happen next. It doesn’t do well with free text.

I considered adding an off-the-shelf NLP library to make it more “conversational” but, to be honest, I haven’t been impressed by any bots that try to go the free-text route so concluded that that wouldn’t really add much. So, when messages hit the server, we tokenize the content and attempt to match against known commands, mapping found commands to response functions that figure out how to respond, if at all.

Some responses are plain text, others include a set of options, and others deliver some type of media. There’s some randomness built in so that it feels less robotic and, if the bot gets something it doesn’t expect, it tries to guide the user back to the vocabulary it knows.

The story is broken into 10 bite-sized chapters so that it can be easily digested in chunks. My user tends to be on mobile, so I knew forcing her to consume everything at once would have been a mistake. Every time a chapter ends a “bookmark” is created in our database and the user has the option to continue, pause, or restart.

That’s basically it. Pretty simple!

🎁 Surface Area

It’s a chat bot so the interface is textual and largely determined by the Messenger platform (which does provide some in-line UI elements like menu buttons). Since I had little to no UI control the packaging became extremely important for the initial impression and setting up of the experience.

We’re used to digital products being personalized, but it’s often clear that what we’re dealing with is just a shallow approximation of bespoke-ness meant to be applied to thousands or millions of others. Never do we see something that has the look of a fully formed Product but with the real sense that it was created just for us.

That was the initial feeling I wanted to give my partner. I wanted her to feel special. Like she’d stumbled upon something that looked like everything else on the internet, but that existed solely for her.

For that, this thing needed to look legit! Which meant it had to be officially published by Facebook on their chat bot platform so that

  1. Anyone could message it
  2. It could have a m.me vanity url
  3. It could show up in searches

It also needed to have real brand assets.

So, in addition to coding, I had to create some images and fill out a chat bot application to be reviewed by a human at Facebook. One round of feedback later and it was “approved”.

Finally, there was a requirement that chat bots needed to surpass some minimum number of likes before they could be published, so I bought 300 fake likes on Fivvr to get it over this hurdle. Conianbot is quite popular in Indonesia!

You can find it on Facebook / in Messenger. It looks like this:

🚪 Onboarding / First boot

The experience begins when the user sends the first message. The bot will immediately try to authenticate the sender via a 1 question quiz and will not progress until the quiz is completed successfully. The answer to the quiz is something only my partner should know, so that anyone finding this bot would not have access to the content.

The purpose of this guarded-entry mechanic was, yes, for security, but more so, to create a sense of gravity in the user’s mind and add an air of mystery to the experience. I wanted to her to feel a sense of adventure. Like she was entering some forbidden space full of secrets that needed to be protected.

When the question is answered correctly there is an unlocking sequence…

and the user lands on a welcome video starring yours truly saying, again, some really sappy stuff (v. embarrassing. don’t watch.).

Through the welcome video we break the fourth wall and I verbally give the user the next command which, once entered, switches the bot into story mode and the aforementioned story script begins.

🗣“Oh, one last thing: Make sure to ask Conianbot to tell you a story.”

Like the guard, the video serves dual purpose: The practical purpose was to progress the flow but the emotional purpose was to transition her from mystery to familiarity and to set the sentimental tone for what was to come.

And off we go!

I won’t spoil the rest for anyone who wants to take it for a spin, just please don’t judge! 🙈

💡 Memories on demand

Once the story concludes the user is dropped into on-demand mode. Here they’re presented with a set of option buttons so it’s clear what things they can do next. I was really curious to see what path my partner would choose at this point. Spoiler, it was:

The other options are

  1. Photo: returns a random photo from a shared album we curate together
  2. Video: returns a random video clip from our adventures
  3. Song: returns a Spotify url to a song from a shared playlist, again selected randomly
  4. Story: replays the story.

There are also a few hidden commands like “Connie” and “Ian”, which she eventually found.

🚢 Launch

This was the simplest product launch I’ve been a part of, but it was also one of the most stressful! The one complication was that my partner was traveling for work at the time and was in a very different timezone so launch day landed a calendar day early for me, which I realized just in the nick of time!

Conianbot officially “launched” on Feb 14, 2017 via an early morning (Tel Aviv time) text message to my partner that said:

“Click this link and say ‘hi’ https://m.me/conianbot

…Quite a bit easier than trying to game ProductHunt! 🙂

If you’re interesting in running through it you can hit me up on Twitter and I’ll share the passcode.

👋 Final thoughts

This project was a lot of fun to build and it performed pretty well! It was also a neat opportunity for me to go deep on the emotional component of product building and experience design.

So, as I moved back toward the middle of the Jira/Art Spectrum™, the practical takeaway for me was to a). think of every step in whatever flow I’m building as an opportunity to deliver (or maintain) an emotional state for the user and then b). once I know what state I’m after, focus maniacally on the details until it feels right in testing. In this case I spent hours running through the story script again and again, tweaking language here, timing there, so that the punch-lines would hit just right.

But this project also made me ponder a few things. For example, I tried to inject some of my personality into the voice of the bot

and, while doing that, I couldn’t help but fantasize about some future scenario where I’m long gone but a loved one or relative can visit Conianbot to share these cherished moments from my life, narrated by a crude caricature of my sense of humor…

And that made me think more about how fleeting memories are and how valuable it is to just write things down. Which, in turn, made me yearn for a technology that would make those written-down memories come to life, as a way for us to project some part of ourselves into a future that we’ll never see.

And therein, and perhaps for the first time, I pinpointed why it is that I build things at all: Because I want to persist.

Thanks for reading 👋😊

If you liked this you can follow me on here or find me on Twitter. I’m trying to write more these days, we’ll see how it goes.

Thanks to John Kramer, Anvisha Pai, John Quinn, Pamela Vagata, and Jonathan Lowenhar for suffering through drafts of this and of course C for letting me share it. Also I’d be remiss if I didn’t mention that I took some inspiration from Esther Crawford and Chris Messina and their work on Esther Bot.

--

--