Skip to main content
[aditude-amp id="stickyleaderboard" targeting='{"env":"staging","page_type":"article","post_id":2032013,"post_type":"guest","post_chan":"none","tags":null,"ai":false,"category":"none","all_categories":"bots,","session":"D"}']
Guest
How to build a better bot than President Obama’s in 15 minutes
President Barack Obama at the Global Entrepreneurship Summit 2016 Silicon Valley.
Image Credit: Screenshot
Last week the White House launched its first chatbot. The fact that the most powerful man on the planet is using a chatbot to receive messages has gotten a lot of people excited.
But some in the press wanted to see more. In his VentureBeat article, John Brandon noted that while the White House bot might serve as a cool new way to contact the president, it misses many opportunities, like utilizing a sophisticated artificial intelligence for language recognition and providing people with additional info about the president.
We have to admit, as we read the headlines, our imagination at Chatfuel went wild. Our Chatfuel group chat was suddenly buzzing with ideas, ranging from useful (think citizen feedback, district issues, messaging local representatives) to fun and silly (creating a way for people to vote on which suit the president should wear to the next cabinet meeting, or to suggest how the Obama family’s Christmas tree should be decorated).
But in the end, the real question was: How long would it take to build a full-featured bot that’s worthy of the White House?
AI Weekly
The must-read newsletter for AI and Big Data industry written by Khari Johnson, Kyle Wiggers, and Seth Colaner.
Included with VentureBeat Insider and VentureBeat VIP memberships.
Going into building a chatbot worthy of a president requires planning ahead, as with any other bot. So we started with a small but useful feature set.
Our presidential bot needed to:
Allow users to reach out to the president in a dedicated form
List the latest news about the president
Give virtual tours of the White House
This example provides a nice chance to show readers how easy it can be to build your first bot.
After editing the welcome message, we’ll formulate a Default answer. That’s a standard reply the bot makes when it’s unsure of a user’s intentions; it points users to the Main Menu — which we’ll set up next.
The Main Menu serves as a place where users can check their available options and start their journey.
At any point, you can use “Test your bot Button” to open up a Messenger window with your bot. Do that to check out how your Main Menu would be displayed to users.
In order to teach our bot when to bring up the Main Menu, we’ll switch to the AI Setup tab. Remember, the Main Menu serves as an anchor point for your users when they get lost, so let’s make it easy for them to call up. In this example, we’ve added phrases like “Menu,” “I am lost,” “Go back,” and “restart” and pointed them to our Default answer content block. The AI will automatically recognize similar expressions as well.
Now let’s replicate the original functionality of the White House bot by creating a new content block with the name “Post Office.” In this instance, we’ll use our User input plugin to receive and forward messages and users’ inputs. You can accomplish that by adding a new card and selecting Plugins from the menu.
The results will be sent to an email message, and we’ll add a “success message,” as well as another card with a small YouTube video where President Obama emphasizes the importance of letters like these. Basically, we’ve just replicated the White House bot’s original functionality. Now we’re going to expand it a little bit by adding the option to find news from the White House.
We’re going to use the White House RSS feed and link it to our bot by creating a new block, choosing Plugins, and picking the RSS import plugin.
Below is where we’ll add the URL to the RSS feed, as well as a subscription title.
Now we’re going to go back to our Main Menu content block to link it back to our newly created “News from the President” content block.
Afterward, we’ll return to the AI tab to teach our bot what it needs to do when someone wants more news about the president.
White House tours seem to be a big hit these days, so we want to enable our users to find out more about them and then link to the virtual tour on whitehouse.gov, as well as a page with information about in-person tours. We’ll do that by creating a new block called “White House Tour” and include cards and an image gallery that showcases rooms throughout the White House.
And we’ll create a follow-up card that links to the pages on whitehouse.gov, with two buttons.
Here is an overview of what our completed tour block looks like.
Last but not least, we have to go back to the AI section and link our new content block to the Main Menu.
And voila! You just built a White House-worthy bot in 15 minutes. And that’s just the tip of the iceberg — there are so many more possibilities, since chatbot technology and frameworks are evolving and becoming more and more powerful.
VentureBeat's mission is to be a digital town square for technical decision-makers to gain knowledge about transformative enterprise technology and transact. Learn More