Twitter EMergency COMmunications (EMCOM) was inspired by the need to bridge the gap left by the traditional emergency system that relies on telephones or cellphones. What if there is no cell reception in the area but internet access is easily available? A call to 911 is great in case of emergency but what if i still need to contact 911 in a subtle manner without giving of my position of hiding to intruders? A text based 911 service would be helpful in such cases. This is where the twitter extended EMCom Platform comes in to assist and complement the 911 Emergency System. EMCOM offers calling from the Web, a twitter chatbot that responds to your queries the same way a human dispatcher would and provides status tracking between the dispatcher and the responders which could be Medical Services/ Law Enforcement/ Fire and Rescue or All.

What it does

Twitter EMCOM is a feature rich chatbot that offers a text based solution to reaching out for help through Twitter. It offers assistance in three types of areas which are:

1. Help

A person can request for help and send all their details using twitter messaging and have emergency services notified. Typical scenarios are robberies, veld fires, medical situations, missing persons etc.

2. SOS

An SOS alert can be sent out via Twitter to Emergency Response Services in the event of situations that require rescue. Typical scenarios may be when a group of sailors is lost at sea and their radio equipment is down. All they have is satellite-based internet access from a Starlink satelite and a computer or mobile phone with the twitter app installed.

3. First Aid Reference Library

Some times a life may be lost because no one could administer first aid. During an emergency panic often gets hold of people and they cant seem to get the necesary information to help a person in danger. Twitter EMCOM will offer a user the right instructional video that applies to the emergency taking place. It provides a youtube link to applicable first aid video.

Web Console

Login is disabled for this demonstration navigate to the following links:

How to Interact with Twitter EMCOM on Twitter

  • Visit
  • Click on the envelope icon to send a direct message to the bot.
  • To see all the chatbot feature menus type "Hi" and hit send.
  • To access the help menu type "Help" and hit send ( the bot also understands "h" or "he" as shortcuts since during an emergency time factor is important)
  • To access the sos menu type "Sos" and hit send.
  • To access the first aid how-to reference library menu type "aid".

How we built it

Initially the project started as a web-based calling platform(Web Server) and now has extended into Twitter. The Chatbot agent is built on Google Dialogflow that has twitter integration and uses cloud functions. Two APIS where built to ensure the Chatbot, Webserver and Twitter are linked. The LAMP webserver thats hosting the web console uses an api written in python and setup with nginx as a reverse proxy to a fastAPI ec2 instance running the api on localhost. FastAPI was chosen for its speed and lower learning curve. Furthermore, this API was developed in Python because of tweepy easy way to interact with the twitter v2 api . So this API is the bridge that enables the web console to send direct messages to twitter users, update emcom twitter page profile information and issues out awareness alerts/ broadcasts to twitter from the web console. A codeigniter rest api controller had to be incorporated into the web application console to enable emergency requests to flow from twitter via the google dialogflow chatbot agent and be captured by the web application database.

Challenges we ran into

Finding a way to integrate chatbot, web application and Twitter was at first a challenge. However, after research i realised building API Interfaces was the only way to link the three systems( chatbot, web console, Twitter) .

Accomplishments that we're proud of

EMCOM Platform has now extended to Twitter, a very popular social media platform. Emergency Services and Assistance should be within the reach of everyone irrespective of availabilty of the medium(call/ text/Internet). Scenarios where one cannot take a call but it is impossible to reach to 911 on another medium have been mitigated.

What we learned

  • Twitter API has a rich set of features that can be utilised for Public Safety
  • APIs are a must for communication between platforms and distributed architectures
  • Dialogflow can create engaging AI conversations.

Potential Value

We can now reduce the number of casualities occuring every year due to untimely help or limited number of options to contact 911 emergency services hence saving lives and families.

What's next for Twitter EMCOM

Adding AI powered functionality to promote wellness and awareness of emergency issues on the twitter platform

Built With

Share this project: