Inspiration

In 2020-2021, Canada had 2.18 million students (Statista) enrolled in post-secondary institutions. As schools open to in-person classes, students will once again spend long hours studying on campus and hosting social events as well. In-person activities come with lots of benefits, and we are very eager to get life back to how it was before the pandemic. But there are legitimate concerns we didn't realize we had until we were getting prepared for our own in-person evening classes and gatherings. Our schedules with our friends often don't match up, and walking alone late at night will be the norm for us for the next few months - we'd rather walk alone silently than wake up our friends by calling them just to feel safer. We hope that SafeLine.ai is a means for any student, regardless of the time or location, to feel safe and protected while enjoying campus life!

What it does

Students can call our SafeLine.ai hotline 24/7 at +1 226-212-SAFE (7233) when they feel unsafe walking alone, usually after a late night study session at the library or an in-person gathering (read: party).

When users first go on the sign-up webpage, they fill in their basic information such as their name, date of birth, address, phone number and certain code words in case of an emergency. E.g. 'Salvador Dalí' == 'I'm being followed; call 911.’ During a call with SafeLine.ai, users can discreetly say their code words to execute a call transfer function to first responders and an SMS message to be sent to first responders with the user's name, phone number, date of birth, address. This is much quicker AND safer than telling a first respondent your personal details out loud - all of which a potential offender can overhear. SafeLine.ai also has the option to just say ‘call 911’ to transfer the call to first responders in case of an imminent threat. SafeLine.ai connects to our natural language conversational bot powered by OpenAI's GPT-3. GPT-3 is the most advanced general-purpose natural language AI to date, and can come up with some fun conversations that mimic a real person, making it seem like you're on a call with a friend - potential offenders will think twice before making an advance. Since GPT-3 read a good chunk of the internet, you can even ask GPT-3 for help with your homework or on how JavaScript works (we wish we asked sooner) as you walk home from school.

How we built it

The creation of SafeLine.ai involved a combination of Twilio, Firebase and node.js, javascript, GPT-3 Davinci Engine, HTML, CSS and lots of last-minute white-boarding and planning. We used Twilio's Functions, Autopilot, TwiML features for call routing, voice recognition and synthesis, and Firestore database's API for retrieving user data for emergency calls, node.js and JavaScript for installing GPT-3, Twilio dependencies and making webhook calls, and HTML/CSS/JS for the signup page.

Challenges we ran into

Some of the challenges we faced was programming the script with OpenAI and connecting it to Twilio to make the bot interactable with the human voice. This was achieved with webhooks. The biggest challenge we faced was being able to simultaneously transfer a live call from SafeLine.ai to a first-responder and send a text message with the user's relevant data. Twilio Tasks can only send one request at a time, and we had to find a workaround for that. We eventually figured out a way with a JS function and TwiML.

Accomplishments that we're proud of

Our team is very proud of integrating all the sub-systems such as the AI-powered bot and the database to a well-designed user interface. Additionally, we are proud to fully execute all the points we wanted to cover and produce a product that can have positive social implications. Getting call routing to work at the same time as texting was a big one. Also, being a serverless system and not needing wifi once you're signed up is an accomplishment we're proud of!

What we learned

Coming into this hackathon, only one of us had touched JavaScript, and barely at that. We took turns guessing what certain JS syntax meant, but came out of this experience feeling a lot more confident building with it. We gained valuable experience developing with GPT-3, let alone integrating systems via APIs. Thirdly, we learned more about different platforms such as Firebase, Twilio and how they can be programmed and integrated to our needs. Lastly, we all learned more about OpenAI and AI-powered engines and other relevant knowledge in AI. This was our first time working with webhooks, and some of us didn't know what an async function was before this weekend.

What's next for SafeLine.ai

Future planned features for SafeLine.ai include an improved voice synthesis engine (we're looking at ResembleAI or Google Cloud Voice), GPS tracking as soon as the user calls the hotline (similar to 911), call transcriptions for operators (available in Twilio) to gain more context. Other features like texting and interacting with the bot via messaging would be introduced as well.

"when that hotline bling, that can only mean one thing" - some guy from Toronto


"Number of students enrolled in postsecondary institutions in Canada from 2000 to 2020" https://www.statista.com/statistics/447739/enrollment-of-postsecondary-students-in-canada/#:~:text=This%20statistic%20shows%20the%20total,in%20postsecondary%20institutions%20in%20Canada.

Built With

Share this project:

Updates