Inspiration.

In today's world, mental health is a pervasive and widespread problem facing millions. Anxiety, which 30% of adults will encounter, is often characterized as societal withdrawal and panic attacks; individuals may experience physical symptoms such as rapid heartbeat, sweating, and trembling. It is essential to address these situations immediately, especially in severe cases. If prolonged, anxiety can lead to long-term effects with potentially more disastrous consequences. Addressing anxiety attacks directly, in the moment, is critical to prevent the situation from worsening and ensure the person's safety and well-being. It can also help the person feel more in control of the problem and prevent them from feeling helpless and alone.

Yet, following the pandemic, we have seen a severe shortage of healthcare professionals. The lack of access to mental health services can exacerbate the severity and duration of mental health conditions, making it more challenging for individuals to manage their symptoms and improve their quality of life. It can also lead to appointments taking months, preventing those who need it most from seeking the treatment they need. Furthermore, this gap between incidents and treatment can severely alter and limit the analysis of rapid and disorganized thoughts during a panic attack and, thus, limit the support a professional can provide. Countless individuals also don’t have immediate access to a trusted individual to help rationalize their thoughts.

What it does

At MetHacks, we strove to work on a problem we have seen affect those around us—a problem with no practical, modern solution. MentAi is a web application built on various Cohere models, allowing for more effective and efficient communication between users and licensed professionals. In the earliest moments of a panic attack, an individual can go through their train of thought before dangerous escalation, essentially venting to the AI through speech-to-text. Analyzing a person's cognitive process throughout an anxiety attack might give crucial insights into the underlying beliefs and thought patterns that fuel their fear. Understanding these patterns enables people to identify and confront unfavorable ideas, reducing anxiety symptoms and enhancing quality of life. It can also provide people who wouldn't traditionally have a person to talk to, a place to go through their thoughts and rationalize; otherwise, they would go through these panic attacks alone.

MentAi uses a large set of training examples we created based on real hotline calls to provide reassurance and a response to the person. It helps the individual rationalize their thoughts, all while summarizing all the data and preparing a report.

MentAi then uses Cohere's classifier based on a large set of example data we prepared from real-world cases to quickly and accurately assess the urgency of a case. An individual can link the app to their psychologist, allowing them to receive the summarized reports instantaneously, along with a severity report: not-a-concern, mild concern, moderate concern and urgent. In urgent cases, the app will send the psychologist a text, allowing immediate access to emergency services, and various individuals of the user’s choice can be informed of the potentially life-threatening crisis.

How we built it

Our front end was built with HTML. CSS and JS, with our back end built with Flask and Python. The backend works with the Cohere and Twilio APIs and the Conversant library.

The speech tool was built with native methods inside the JS libraries to record user audio and play the file.

Challenges we ran into

One of our most significant challenges was limits with chat-based conversations on Cohere. To work around this, we used Conversant, a library built on top of Cohere, paired with large sets of our data we compiled from real-world cases, giving MetAi a similar conversation-like feel.

Another challenge was the usage of audio in the program. Due to the limited capabilities of the native library, saving audio was very difficult. This was solved using a multitude of flags and listeners to ensure that the program followed a very specific path from recording to playing the audio.

Accomplishments that we're proud of

Based on our training data and optimizations to the bot, we successfully achieved an unconventional yet very accurate use of the Cohere generated endpoint, which could potentially save lives. **MentAi's responses are reassuring, have depth, and provide precise guidance to the user, ensuring they know they are not alone. **This is all while accurately identifying urgency using the classifier endpoint, and taking immediate steps to ensure the user gets the needed help.

What we learned

Throughout this project, we learned about the workings of Large-Language Models (LLMs), the value of training data, and the severity of today's mental health crisis. We learned about the importance of early action and various methods to address these panic attacks, which we implemented into MentAI.

What's next for MentAi

Increasing our datasets can be a significant step in improving the accuracy of MentAI. We have also began compiling data to allow MentAi to support various other conditions, including depression and PTSD. We also plan to connect MentAI directly to hotline services, allowing for more data. Combined with context-based models, we can strive for better human-like conversation through back-and-forth conversations, while utilizing speech recognition to expand the accessibility in the program.

Built With

Share this project:

Updates