Inspiration

Mental health challenges have become a significant challenge, with rising rates of depression and anxiety often linked to elevated stress levels and a lack of mindfulness. Alleaf was developed to address this by leveraging technology and physiological data to help users maintain a grounded state.

What the Project Does

Alleaf provides real-time stress detection based on biological and lifestyle indicators, including:

  • Age
  • Current Heart Rate
  • Heart Rate Variability (HRV)

This data is processed to deliver automated interventions:

  • Haptic-based bilateral stimulation therapy
  • RAG-based meditation support
  • Personalized mindfulness exercises

Technical Implementation

  • Backend: A Flask API manages the integration between LangChain workflows, Actian Vector DB, and Next.js frontend endpoints.
  • Frontend: Developed with Next.js and JavaScript, focusing on a minimalist user interface.
  • Hardware: An ESP32 Bluetooth-enabled device utilizes a red LED sensor to detect RR intervals. These signals trigger the haptic bilateral stimulation hardware.

  • Machine Learning: A linear regression model, trained on the WESAD dataset using Pandas, is deployed as a Flask endpoint for real-time stress classification.

Development Challenges

  • Sensor Accuracy: Achieving precise RR interval measurements required iterative testing of sensor placement and LED luminosity.
  • Modeling: Ensuring the stress-detection model remained both accurate and interpretable was critical, requiring careful data selection and feature engineering.
  • Agent Development: Designing robust RAG pipelines for meditation and therapy agents was necessary to ensure the AI provided relevant, context-aware support.

Key Learnings

  • Accuracy and transparency are fundamental when developing tools for health applications.
  • A clean, simplified user interface is essential for reducing user friction in high-stress scenarios.
  • The role of technology in mental healthcare is to empower individuals rather than replace human support.

Future Development

  • Enhancing the predictive accuracy and transparency of the stress-detection model.
  • Refining the hardware integration for improved signal reliability.
  • Implementing a data visualization dashboard to allow users to track their progress over time.

Built With

Share this project:

Updates