📝 Exploring Personalized Health Support through Data-Driven, Theory-Guided LLMs: A Case Study in Sleep Health (CHI' 25)
Contact: 📧 Xingbo Wang (wangxbzb@gmail.com)
This code base demonstrates a LLM-powered sleep health chatbot augmented by a multiagent framework to provide personalized, data-driven, and theory-guided sleep health support. The chatbot integrates wearable device data, contextual information, and established behavior change theories to deliver adaptive recommendations and motivational support.
ThSleepHealthBot.py- The main file for the chatbot interface and user interactionagent_coordinator.py- Coordinates multiple specialized agents (e.g., Recommendation, Health Data Analysis)activityRec.py- Contextual multi-armed bandit model for activity recommendationgenerate_activity- Generate synthetic data for activity recommendations research demonstration
utils.py- Utility functions for data retrieval and processingglobalVariable.py- Global variables for the projectrequirements.txt- The dependencies for the projectREADME.md- The readme file for the project.streamlit- The streamlit secret configuration file:.streamlit/secrets.toml
- Python 3.10.13
- Create a virtual environment:
python -m venv venv- Activate the virtual environment:
source venv/bin/activate- Install the dependencies:
pip install -r requirements.txtCreate a .streamlit/secrets.toml file in the .streamlit directory with the following configuration:
- We have provided an example of recommendation model in the parent directory:
user_model.pkl
[oura]
oura_token = "input_your_oura_token"
[weatherapi]
weatherapi_key = "input_your_weatherapi_key"
[user]
pid = 1
user_name = "johndoe"
user_model_path = "user_model.pkl"Required environment variables:
OPENAI_API_KEY- The API key for the OpenAI APIoura_token- The token for the Oura APIweatherapi_key- The API key for the WeatherAPI- User information:
pid- Participant IDuser_name- User nameuser_model_path- Path to the user model file (An example user model is provided)
Run the chatbot using:
streamlit run ThSleepHealthBot.py@inproceedings{sleepllm_chi25,
author = {Wang, Xingbo and Griffith, Janessa and Adler, Daniel A. and Castillo, Joey and Choudhury, Tanzeem and Wang, Fei},
title = {Exploring Personalized Health Support through Data-Driven, Theory-Guided LLMs: A Case Study in Sleep Health},
year = {2025},
isbn = {9798400713941},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3706598.3713852},
doi = {10.1145/3706598.3713852},
articleno = {507},
numpages = {15},
series = {CHI '25}
}