Recently, while cleaning up our Whatsapp contacts, we realised we had a lot of chats used purely for appointments, services and daily reporting. These many but infrequently used chats constantly hog the top of our contact lists, making it a hassle to chat with the people who matter, such as family and friends. This was when we thought of using Twilio API to bundle all these chats into one single channel.
Some time later, it dawned on us that one benefit of grouping all these chats together is that messages can technically be automated to be sent to any contact. This was when we decided to incorporate Wit.AI to differentiate messages sent and train intents, so as to produce an AI model to send subsequent messages automatically.
What it does
Bandung has 4 important features:
Bundling up of one-time/temporary/bot contacts! Everyone has these type of contacts, be it the local pizza shop, the dentist, your personal doctor, the plumber, or even a duty officer that you have to report to everyday. Condense all these chats into a single channel!
Facilitates easy reference by codifying name You don't have to remember the people's numbers, or even need to save them to your contact list! Simply
$add <code_name> <contact_number>(e.g.
$add pizza 65656565). The next time you have to Whatsapp the pizza store for ordering, just refer to them using
@pizza <message>. Example:
@pizza can i have a large hawaiian pizza with 2 garlic bread?
Keep track of conversations via
@lastRetrieve last sent messages with
Automate your sending of messages! Each time you send a message with
@<code_name>, it will be used to train Bandung's Wit.AI app in the backend. This means that after sending a substantial amount of messages with Bandung, you no longer need the
@personanymore! Simply just type your message and Bandung will automatically send it if the confidence level is more than 80%!
How we built it
Firstly, two SQLite3 databases were set up to store contacts and messages. Then, following the Twilio API tutorial, a minimal (but nicely-designed!) Flask app was created with Twilio API's webhook pointing to it. When the logic of adding and sending messages was done, we implemented a WitBot class to train and query messages.
For installation instructions, refer to GitHub.
Challenges we ran into
Learning Twilio APIs (sometimes via excessive trial and error). Also, in making the demo video, we had to implement an additional map to obscure our real phone numbers, which was very tedious.
Accomplishments that we're proud of
Thinking up of combining Wit.AI with Twilio API and making a working prototype.
What we learned
It was the first hackathon for two of our team members! We all learnt how to use Twilio APIs with ngrok (mapping of ports for testing our Flask app) and had fun training intents with utterances on Wit.AI.
What's next for Bandung
Bandung can be further optimised for group and work settings, where there are multiple reporting channels. Our Wit.AI model can be trained such that it identifies which work channel a particular message should go.