As users we often know which movie we want to watch, but we can't figure out which online service is streaming the movie.
What it does
Flic let's you search for a movie, and then it tells you where it is available. Flic shows you subscription services, like Netflix and HBO, streaming services, like Vudo, Amazon, YouTube, iTunes and also movie theaters and where to get a physical copy.
How we built it
We built Flic in two phases. During phase 1, we directly integrated AWS Lex with Facebook Messenger as a Channel. All the backend code was in AWS Lambda. However, this did not give us enough control over the message formats in Messenger. In Phase 2, we added Botkit, which sits between Facebook and Lex.
- Messaging Platform: Facebook Messenger
- Transport Layer: Botkit ** Language: node.js ** Platform: AWS Elastic Beanstalk
- Natural Language Processor (NLP): Lex
- Business Logic: Lambda ** Application Framework: Serverless ** Language: node.js
- Movie Data: GoWatchIt API
- Bot Analytics: Dashbot
Challenges we ran into
We had two sets of challenges working on Flic - UX and Lex. The User Experience (UX) challenges were due to the amount of information we had to show and the limitations of message types in Facebook Messenger. Lex challenged us with the best place to store content and how to send custom message types to FB Messenger.
Since Flic is on Facebook Messenger and movies have LOTS of data, we wanted to take advantage of Messenger's various message types, e.g., Generic Templates, List Templates and Quick Replies. However, there was still too much information for Messenger templates, so we experimented with a variety of ways to show the information.
As an example, once a user picks a movie, we would have ideally shown them a List Template with all the viewing options. But a List Template is limited to 4 items, so we had to try a different approach.
Lex Content Management Challenge
The first challenge with Lex was how to handle static content. We typically populate our bots with general information, since users will ask:
- "What is SmallTalk?"
- "Tell me about you"
For these types of intents, we just need a static reply. Lex, unlike api.ai and wit.ai, does not provide a way to set a text message in the Fulfillment. Note: It is interesting that Lex does have a way to set a text message for a Slot Prompt
We finally addressed the static content issue by making a ContentService in Lambda to handle all of these types of "static" Intents. Currently the response messages are hard coded, but his could be updated to store content in S3 or a DB.
Lex Message Types Challenge
As mentioned, UX is very important to us, and we needed to use Messenger List Templates and Quick Replies. However, Lex does not support these message types. Lex only supports text messages and Generic Templates, using ResponseCards.
To overcome this in Phase 2, we:
- Removed Lex & Facebook Messenger integration
- Added a Botkit server in AWS Elastic Beanstalk
- Connected Botkit as a Webhook for Facebook Messenger
- Passed user messages from Botkit to Lex through PostText using aws-sdk
- Formed Facebook formatted response messages in Lambda
This left one big issue ... where to put the Facebook messages in the Lex response back to Botkit. We tried:
- adding a new property
- changing the ResponseCard data
But the JSON in the response is strongly typed, so that did not work. In the end, we added the FB messages as a JSON string to the sessionAttributes in Lambda. In Botkit, the JSON is parsed and the messages are sent to FB Messenger.
Accomplishments that we're proud of
We are thrilled that we were able to use all the Facebook message types and still use Lex. We did not want to sacrifice UX due to technical limitations.
What we learned
We learned a lot about Lex and Lambda. This was our first project using either, so it was great to jump in an get a working knowledge.
Using Lambda was a lot easier than we anticipated. And using Serverless made it a snap. We will definatley find new ways to use Lambda moving forward.
With Lex, we finishe with a list of features we love, but also a list of must have features for the roadmap. Much of our views are based on experiences with other NLPs.
- Lex - Strengths ** Security - set access level by user or group ** Versioning - saves versions ** Deployments - can deploy to different Alias
- Lex - Wishlist ** Tet Responses in Fulfillment - great feature for Intents without backend logic ** Custom Responses - all platform specific responses
What's next for Flic
There are three main areas in which we want to enhance Flic: adding additional intents, providing easier management and adding Flic on more platforms - specifically voice.
Currently Flic can show you where to wach movies. We want to add additional Intents such as:
- TV Shows - "Where can I watch Seinfeld"
- Actors - "List Clint Eastwood movies"
- Movie/Provider - "Is Good Bad and Ugly on NetFlix?"
- Genre/Provider - "What westerns are on Hulu?"
- Actor/Provider - "Are any Clint Eastwood movies showing on HBO?"
For our team, we want to make it easier to update Flic's content, so we will look into updating the ContentService. First step would be moving content to a S3 bucket, so non-technical team members can make updates to Lex for Sample Utterances and S3 for Flic's responses.
Finally, we want to add Flic to additional message platforms. Some possible platforms would be an Alexa Skill, SMS and Slack.