Inspiration

Emergency departments across Canada are facing severe overcrowding, forcing patients to wait hours before receiving care. In some cases, these delays can have devastating consequences. Based on some surveys, at least around 50% of Canadians express discontent with the Canadian public healthcare system, due to its inefficiency, lack of staff, and therefore a lack of immediate action, even though it may be required.

While healthcare workers are doing everything they can under extreme pressure, emergency departments are often filled with patients whose conditions could be assessed or treated outside of urgent care very quickly and efficiently, or could save countless hours of their time by realizing that they did not need to go to the doctor or emergency clinic anyways.

Two members of our group are from Alberta, where a 44-year-old man recently died despite describing severe chest pain in his chest to the ER department. Due to the pressure on the department and a lack of robust pre-screening, his case was just put into a waitlist of cases. Our group saw this case happen at a hospital very close to our homes, and therefore, this seemed like a major Canadian problem whose negative effects could be drastically reduced using technology and advanced scientific pre-screening tools such as Presage.

To help address this problem, we built Medicus. an AI-powered triage and guidance system designed to help people understand the severity of their symptoms and direct them to the appropriate level of care before they ever enter the emergency department.

What it does

Medicus is an AI-powered, robust pre-screening tool that patients can use to monitor symptoms when they are distressed or unsure about their well-being.

How we built it

The app itself was built using Kotlin and XML based android UI. We used Kotlin for the main Android logic, activity lifestyle management, networking, and the AI interaction flow. XML was used to design the user interface components.

We also integrated the Firebase SDK and the Auth0 Android SDK to handle authentication and user data management. Auth0 manages our secure user login and identity using token-based identification, while Firebase stores the user profiles, medical history, and past medical history.

To scan a user's face and see their heartbeat and blood pressure, we used PreSage Technologies. Presage provides computer vision-based health monitoring tools that can analyze subtle changes in facial skin coloration and micro-movements captured through the smartphone camera.

For AI reasoning and diagnosis, we used Google Gemini, which processes the patient's symptoms along with historical context to generate paitent symptoms along with historical context to generate future recommendations and plans of action. To give the AI long-term conversational memory, we integrated Backboard, which allows the system to maintain context across multiple sessions. When a user begins a new consultation, the app retrieves previous system sessions from Firebase and sends them to Backboard's memory system so the AI can understand the paitent's past symptoms, conditions, and conversations before generating a response.

To create a natural conversational experience, we integrated ElevenLabs for voice synthesis. Once the AI generates a response, the text is sent to ElevenLabs, which converts it into a calm, soothing voice and streams the audio back while displaying a waveform-like animation (which visually responds when either the user is speaking or when the AI is responding).

The system also differentiates between emergency and non-emergency consultations. In emergencies, the AI limits conversation to around 1 minute before producing a response in order to prioritize urgent medical action if necessary. In non-medical emergency consultations, the AI can take longer to analyze context and medical history, and responds to provide more detailed guidence.

Challenges we ran into

Integrating PreSage API: One of our biggest challenges was trying to integrate PreSage in a Kotlin-based android app. We solved this issue by using Kotlin coroutines, and we handled the processing in the background and stored results in Firebase for AI consultations. Build time and run time errors: Our team faced several build time errors, like missing dependencies in the Android Gradle Setup, mismatched SDK versions, and conflicts between Firebase and Auth0 libraries. These were also resolved using Kotlin coroutines, proper error handling, and backgrounding threading to ensure smooth, responsive app behaviour. Tying in API's and SDK's in a Kotlin Based environemnt: Integrating multiple services like Backboard, Gemini, ElevenLabs, PreSage, Firebase, and Auth0 in Kotlin was challenging due to differences in authentication, request formats, and asynchronous behaviour. We handled this by creating modular service classes for each API and SDK, using coroutines for asynchronous calls, and standardizing data flow so AI reasoning, voice synthesis, biometric scanning, and user authentication all worked seamlessly together.

Accomplishments that we're proud of

The thing we were most proud of was learning and applying a completely new technology stack that none of us had much experience with, and successfully creating a fully functioning, working app that integrated AI reasoning, voice interaction, and real-time biometric analysis.

We're also proud of tying multiple API's and SDKs in Kotlin, including PreSage, without blocking the UI, demonstrating strong software architecture skills.

What we learned

We all gained hands-on experience with tools that none of us had used before, including PreSage, Gemini, Backboard, and ElevenLabs. Not only that, but successfully integrated them into a working Android app.

What's next for Medicus

Medicus will continue evolving by fine-tuning Gemini with medical datasets to improve diagnostic accuracy, expanding PreSage biometric capabilities for richer real-time health insights, and optimizing the AI pipeline for faster emergency responses.

Built With

Share this project:

Updates