What it does
This is a product that will be used by 4xLabs (https://4xlabs.co/). Every money changer in our database will be using Monet to represent their outlet. A customer can message Monet from the Facebook page of the money changer and ask outlet-specific questions, including:
- The exchange rate between a pair of currencies
- If a certain currency is in stock / Which currencies they carry
- Opening Hours
- Contact Info
- Lodge a complaint
What makes it unique
Monet was developed for a business use case as an actual product that would address a customer need. The plan is to develop it into a useable product for each money changer outlet in the 13 cities in which we have a presence. This means there will be 600 copies of the bot running at once - it has to be able to handle the scale technically, but also in terms of diversity of users and inputs.
How we built it
We built the link between Facebook and Lex ourselves in order to pre-process the message before it reached Lex. The user flow is as follows:
Fb <--> API Gateway <--> Lambda <--> Lex <--> Lambda
We will send each money changer a link to a login dialog pop up. They can log into their Facebook pages and grant us permissions to add Monet to their page.
A customer sends Facebook a message, which gets passed onto Amazon's API Gateway. This gets translated into a format that Lambda understands and passed onto Lambda. Lambda processes this input and passes along the message to Lex. Lex detects the intent and passes the input to another Lambda function for fulfilment. We retrieve the exchange rates from our 4xLabs API, which has data about each money changer outlet & their rates. To send a message back to the user, we go back through this user flow again in reverse.
Challenges we ran into
- Lack of basic slot types (e.g. currencies). --> So I created my own custom slot type named "Currencies"
- Inability to receive meta data from Facebook without customly re-routing to a Lambda function --> Haven't implemented yet, but I plan on passing this data through the custom link between Facebook and Lex
- Inability to connect one Lex bot to multiple Facebook pages if I want one variable to be different in my Lambda function (the money changer outlet's page!) --> Haven't implemented yet, but I plan to pass this data through my custom link between Facebook and Lex
- I would test something with Lex, it wouldn't detect it. Then a couple of days later it would magically be able to!
- Has to be able to detect Singlish/broken English as it is most commonly spoken here. --> Added utterances from samples our existing chat solution. Still a work in progress!
What's next for money changer Chatbot
- Implement a booking feature to allow customers to reserve currency in advance before going down to the outlet to pick it up.
- Create another bot specifically for 4xLabs. Customers can message this bot to find out which money changer to go to.
- Add the Google Maps API to the bot so users can get directions when they ask location related questions
- Collect metadata and the page id from the Facebook message so we can custom route the bot.