Inspiration
Mental health crises often occur suddenly and unpredictably. In those moments, people may experience panic, fear, or overwhelming emotions that make it difficult to think clearly or search through long lists of resources. While many mental health services and hotlines exist, the process of finding the right help can still be confusing and slow when someone needs support immediately.
We were inspired by the idea that in moments of crisis, speed and clarity can save lives. If someone is struggling with suicidal thoughts, addiction, relationship issues, or emotional distress, they shouldn’t have to navigate complicated systems to find the right person to talk to.
H.U.G. was created to simplify that process. Instead of forcing users to figure out where to go for help, our platform listens, understands, and routes them directly to the right professional as quickly as possible. The goal is to remove barriers between someone in distress and the support they need.
What it does
H.U.G. is an intelligent support hotline that allows users to talk about what they’re going through and instantly connects them with the most appropriate professional. When a user speaks or types about their situation, our system analyzes their message using multiple AI models that evaluate the urgency, context, and emotional tone of the conversation.
The system evaluates three key factors:
- Risk Detection Model: Determines the urgency and identifies potential crises such as suicidal ideation or immediate danger.
- Mental Health Classification Model: Categorizes the situation into areas like addiction, relationships, finances, or general mental health.
- Emotion Semantics Model: Detects the emotional state of the user such as sadness, anger, anxiety, or distress.
Based on these combined signals, the platform makes a real-time decision about how to respond. The system can:
- Route the user to a specialized professional (such as a relationship counselor or addiction specialist)
- Escalate high-risk cases to crisis professionals
- Contact emergency services if immediate danger is detected
Once a match is made, the professional is instantly notified and can contact the user directly, allowing them to receive support within moments instead of navigating complicated resource directories.
How we built it
We built H.U.G. as a modular AI-driven system that prioritizes speed, accuracy, and reliability. The user interface allows individuals to describe their situation through text or voice. The message is then sent through a pipeline of machine learning models that analyze the input simultaneously. The system architecture includes:
- Natural Language Understanding (NLU) to interpret the meaning behind the user’s message
- Natural Language Processing (NLP) for tokenization, sentiment detection, and semantic analysis
- Machine Learning classifiers to categorize risk level, emotional state, and issue type
The request is processed through three independent models:
- A risk detection model trained to identify crisis-level language and urgency
- A mental health classification model that identifies the topic of the issue
- An emotion semantics model that interprets emotional tone
These outputs are then passed into a decision engine that determines the best response and routes the user to the appropriate professional. The system prioritizes low latency, ensuring responses occur quickly enough for high-stress situations. The platform also includes a notification system that alerts professionals in real time when a user needs support.
Challenges we ran into
One of the biggest challenges we faced was designing a system that could make accurate decisions quickly. In mental health situations, the system needs to interpret emotional language correctly and respond immediately, which required careful coordination between multiple models analyzing the same input.
Another major challenge was connecting and coordinating our servers so that the different components of the system could communicate reliably. Our platform relies on several models running in parallel, risk detection, mental health classification, and emotion analysis, and initially we struggled with how to route data between services efficiently. Ensuring that user input could be processed by multiple models and returned quickly without delays was more complicated than expected.
To solve this, we implemented Firebase as our backend infrastructure. Firebase allowed us to manage real-time data flow between the user interface, the model pipeline, and the professional notification system. Using Firebase’s real-time database and cloud services helped us synchronize communication between different parts of the platform and significantly reduced latency issues. Once this infrastructure was in place, we were able to reliably send user messages to our models and trigger the appropriate actions in real time.
We also had to consider the broader challenge of interpreting complex human language. People in distress often express themselves indirectly or emotionally, and building models that can understand these nuances while still making fast decisions required thoughtful design and experimentation.
Accomplishments that we're proud of
One of the accomplishments we are most proud of is achieving extremely low latency across the entire decision pipeline. Because mental health crises often involve panic or urgent distress, even small delays can make a difference. Our system was designed to process user input and run it through multiple models simultaneously, allowing the platform to analyze risk, classify the situation, and interpret emotional tone in near real time.
By structuring the models to operate in parallel and optimizing how data flows between them, we were able to reach a point where decisions can be made almost instantly after the user speaks or types their message. This allows the system to quickly determine the best course of action, whether that is connecting the user with a specialized professional or escalating the situation when necessary.
We are also proud of successfully integrating multiple AI components into a unified pipeline. Bringing together risk detection, topic classification, and emotion analysis into a single system that produces a clear actionable decision required careful coordination between models, backend services, and the user interface.
Ultimately, we are proud that H.U.G. demonstrates how AI can be used not just for analysis, but for rapid, real-world intervention, helping people access support faster when they need it most.
What we learned
One of the biggest lessons we learned during this project is that implementing real-time calling functionality is far more complex than it initially appears. While the idea of notifying a professional and triggering a call seems straightforward in theory, building a reliable system that can handle notifications, routing, and communication between users and professionals introduces many technical challenges.
We discovered that coordinating communication between the backend, the notification system, and the professionals receiving alerts requires careful infrastructure design. Managing real-time updates, handling edge cases, and ensuring the system remains reliable under different scenarios pushed us to think more deeply about backend architecture and event-driven systems.
Through this process, we gained a much better understanding of how communication systems and real-time services work behind the scenes, and how important it is to design scalable and reliable infrastructure when building applications that involve immediate human interaction.
This experience gave us valuable insight into the complexity of building production-level systems and highlighted the importance of planning both the AI components and the communication infrastructure together.
What's next for H.U.G.
Currently, H.U.G. focuses on three main categories when classifying a user’s situation, but we recognize that mental health challenges can arise from many different areas of life. In the future, we want to expand the system to cover a broader range of categories, including issues related to academic stress, workplace burnout, social anxiety, and other common mental health struggles. By expanding the classification system, the platform will be able to better understand a wider variety of situations and provide more tailored support.
Another important goal is to expand the network of professionals available on the platform. Right now, our system routes users to a limited set of specialized professionals, but as the platform grows we want to include a wider variety of therapists and counselors with expertise in different areas. This will allow H.U.G. to make more precise matches between users and professionals who are best equipped to help with their specific situation.
Ultimately, the vision for H.U.G. is to create a system where any person experiencing a mental health crisis or emotional distress can immediately connect with the right professional, without having to search through resources or wait long periods for support. By expanding both the categories our system understands and the professionals available to respond, we hope to make the platform faster, smarter, and more accessible to those who need help.
Built With
- antigravity
- elevenlabs
- firebase
- gemini
- html
- javascript
- llm
- mentalbert
- ml
- natural-language-processing
- nebulaapi
- nlu
- python
- react
- typescript
Log in or sign up for Devpost to join the conversation.