Inspiration

Sleep is essential, yet 30-40% of adults struggle with insomnia, affecting their focus, mood, and overall health. Through our research, we found that 80% of users want a private, trustworthy sleep companion that truly understands them. Traditional solutions—Google searches and generic AI chatbots—often fail due to privacy concerns, inaccurate information, and AI hallucinations. This inspired us to create SomniBot, an AI-powered sleep assistant that delivers personalized, clinically informed recommendations using FHIR and RAG.

What it does

SomniBot is an intelligent sleep chatbot that listens, learns, and adapts to users. It leverages FHIR data to generate customized sleep insights, integrating expert recommendations from the American Academy of Sleep Medicine (AASM). Users can interact with SomniBot through: 1️⃣ Quick Self-Assessment Quiz – Provides instant, tailored feedback based on user responses. 2️⃣ Intelligent Health Analysis – Uses Electronic Health Records (EHR) (with permission) to generate personalized sleep reports.

How we built it

  • FHIR (Fast Healthcare Interoperability Resources) to securely handle medical data.
  • Retrieval-Augmented Generation (RAG) to improve answer accuracy by retrieving verified sleep medicine knowledge before generating responses.
  • Llama for model performance, ensuring context-aware, medically relevant sleep advice.
  • MeldRx for seamless EHR integration, allowing users to launch SomniBot through EHR Launch.

Challenges we ran into

  • Balancing personalization and privacy – We had to ensure customized recommendations while protecting sensitive health data.
  • Enhancing AI reliability – Preventing AI hallucinations required RAG-based retrieval of expert-verified data.
  • FHIR integration – Structuring and querying EHR data effectively to generate insightful sleep reports.

Accomplishments that we're proud of

  • Successfully implemented RAG to improve response accuracy and relevance.
  • Seamlessly integrated FHIR data into a user-friendly chatbot.
  • Designed an intuitive self-assessment + EHR-driven analysis system for better insomnia support.

What we learned

  • The power of RAG in enhancing AI trustworthiness by grounding responses in real medical data.
  • FHIR’s potential in building privacy-first, clinically accurate healthcare applications.
  • The importance of UX/UI in guiding users toward better sleep habits effectively.

What's next for SomniBot

  • Dark Mode UI for a relaxing nighttime experience, featuring a yawning emoji to leverage the mirror neuron effect and encourage drowsiness.
  • FAQ Section where SomniBot compiles common sleep concerns and suggests relevant follow-up questions.
  • Expanded EHR capabilities, allowing deeper sleep tracking and intervention recommendations.

Built With

  • aasm-guidelines
  • faiss
  • fhir-(r4)
  • hipaa-compliant
  • javascript-(react.js)
  • llama
  • meldrx-api
  • node.js
  • oauth-2.0-(smart-on-fhir)
  • python
  • rag
  • tailwind-css
Share this project:

Updates