DEV Community

Cover image for Lifeline Support

Lifeline Support

This is a submission for the Twilio Challenge

What I Built

In a world where mental health issues are becoming increasingly prevalent, our mission is to offer a safe, supportive, and non-judgmental space for individuals to share their struggles and receive immediate, compassionate guidance.

I would have liked to have had something like this on hand; some years ago. Also, the inspiration comes from the lyrics of this song: Logic - 1-800-273-8255

Harnessing the capabilities of Flask for our web framework, Twilio for seamless voice and SMS communication, and the advanced language models from OpenAI, I have created a tool that listens, understands, and responds with empathy and care.

Features:

  1. Real-time voice Emotional Support: Users can reach out at any time by calling a dedicated number, where they are greeted by a responsive and empathetic voice ready to listen and help.
  2. Supportive and Non-judgmental: Every interaction is crafted to be positive and supportive, creating a safe space for users to open up about their feelings.
  3. Summarizing Advice: If a user decides to end the conversation, the chatbot provides a summarized advice via SMS, ensuring the user has a tangible reminder of the support received.

The system looks like this, I developed a microservice to handle the real time interaction and logic:

System Architecture

Inside de service, there is a graph of LLMs collaborating to produce a helpful system:

Service flow

Demo

Code: https://github.com/Magody/TwilioLifeLineSupport/tree/main

If you want to try it, you probably want to call to: +16183270085. SMSs only are enabled geographically on: Canada, US, Mexico, Ecuador, Colombia, Chile. In https://console.twilio.com/us1/develop/sms/settings/geo-permissions

Twilio and AI

Twilio
A. Voice Communication:

  • Voice Calls
  • Twilio Voice Response (TwiML): I utilized Twilio’s Voice Response capabilities to handle incoming calls.

B. SMS Communication:

  • Sending Summaries: The system uses Twilio to send a summarized SMS containing the key points of the advice provided.
  • Follow-Up Messages: Twilio’s SMS service is also used to send follow-up messages, providing additional resources or encouragement as needed.

AI Integration

A. Natural Language Processing (NLP):

  • Understanding User Input: OpenAI’s language models enable the chatbot to accurately understand and process the user’s spoken words.
  • Generating Compassionate Responses: The AI generates responses that are compassionate and empathetic.

B. Context-Aware Conversations:

  • Maintaining Continuity: The AI keeps track of the conversation’s context by storing previous interactions in text files.
  • Handling Crisis Situations: The AI can recognize when a user might be in crisis and responds with appropriate, comforting messages, encouraging the user to seek professional help if necessary.

Additional Prize Categories

I think the projects is in the following categories

  • Twilio Times Two: The project uses 2+ Twilio APIs (Call, SMS).
  • Impactful Innovators: The project drives positive social impact.

Top comments (2)

Collapse
 
william_astudillo_7602 profile image
3C.William Astudillo

wow !

Collapse
 
diego_mrquez_16f9f18bfc6 profile image
Diego Márquez

Amazing!