Query-Conditioned Graph Retrieval for Contextualized LLM Reasoning in Personalized Wearable Data
Organizations: Carnegie Mellon University · University of California, Irvine
Abstract
Large language models (LLMs) are increasingly applied to analyzing wearable sensing data, which are long-term, multimodal, and highly personalized. A key challenge is context selection: providing insufficient context limits reasoning, while including all available data leads to inefficiency and degraded generation quality. We propose Wearable As Graph (WAG), a graph-based context retrieval framework that enables query-adaptive reasoning over wearable data with LLMs. WAG organizes wearable metrics and user-specific signals into a personalized knowledge graph, and retrieves a query-conditioned subgraph to support downstream generation. The retrieval process integrates global relationships, capturing prior knowledge and population- and individual-level patterns via hierarchical Bayesian modeling, with local relationships that reflect short-term signal deviations. A query openness signal further controls retrieval breadth. We evaluate WAG on over 10,000 data-grounded queries from real-world wearable datasets. Across LLM-based and human evaluations, WAG achieves an approximately 70% win rate over baseline and standard RAG methods, demonstrating the effectiveness of structured, query-adaptive context retrieval for LLM-driven analysis of wearable data.
Figures & tables
| Dataset | ||||
| Globem | 2.14 | 2.62 | 2.50 | 2.22 |
| IFH Affect | 2.08 | 2.42 | 2.40 | 2.39 |
| Lifesnap | 2.14 | 2.41 | 2.32 | 2.34 |
| Pmdata | 2.28 | 2.42 | 2.40 | 2.32 |
| Average | 2.16 | 2.47 | 2.40 | 2.32 |
| Dataset | |||
| Globem | 1.90 | 1.98 | 2.01 |
| IFH Affect | 1.88 | 1.98 | 2.02 |
| Lifesnap | 1.85 | 1.94 | 2.10 |
| Pmdata | 1.89 | 2.01 | 1.99 |
| Average | 1.88 | 1.98 | 2.03 |
Appendix figures & tables22 assets
Supplementary material from the paper’s appendix.
Appendix
| General Knowledge | Data Retrieval | Trend Analysis | Comparative Insight | Anomaly Detection | Actionable Advice | Exploratory Analysis | Metric Relationships | Contextual Queries | |
| Main experiment | |||||||||
| Globem | 104 | 531 | 219 | 196 | 199 | 125 | 387 | 147 | 53 |
| IFH Affect | 164 | 749 | 348 | 330 | 305 | 256 | 569 | 141 | 59 |
| Lifesnap | 188 | 800 | 335 | 315 | 307 | 254 | 573 | 143 | 57 |
| Pmdata | 126 | 654 | 287 | 265 | 263 | 188 | 504 | 128 | 70 |
| Total | 582 | 2734 | 1189 | 1106 | 1074 | 823 | 2033 | 559 | 239 |
| Dimension | Description |
| Insightfulness | Similar to Interestingness in SSI ( Thoppilan et al., 2022 ) . Captures whether incorporating high-quality, context-aware information leads to more insightful responses. |
| Relevance | Derived from Specificity and Sensibility in SSI . Assesses whether the system retrieves highly relevant content tailored to the user’s context. |
| Groundedness | Evaluates whether responses are supported by factual or retrievable content. |
| Personalization | Measures how accurately responses reflect the user’s specific data and context. |
| Clarity | Related to Conciseness . Judges whether responses are clear, and accessible, even for complex queries. |
| Safety & Security | Ensures responses avoid unsafe, harmful, or misleading content. |
| Dataset | ||||||||
| Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | |
| Globem | 2.14 | 0.30 | 2.62 | 0.17 | 2.50 | 0.22 | 2.22 | 0.36 |
| IFH Affect | 2.08 | 0.34 | 2.42 | 0.23 | 2.40 | 0.25 | 2.39 | 0.27 |
| Lifesnap | 2.14 | 0.28 | 2.41 | 0.24 | 2.32 | 0.30 | 2.34 | 0.28 |
| Pmdata | 2.28 | 0.30 | 2.42 | 0.23 | 2.40 | 0.23 | 2.32 | 0.32 |
| Average | 2.16 | 0.31 | 2.47 | 0.22 | 2.40 | 0.25 | 2.32 | 0.31 |
| Dataset | ||||||||
| Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | |
| 1 | 2.15 | 0.31 | 2.49 | 0.21 | 2.35 | 0.28 | 2.29 | 0.31 |
| 7 | 2.20 | 0.29 | 2.40 | 0.24 | 2.25 | 0.28 | 2.42 | 0.28 |
| 14 | 2.08 | 0.29 | 2.52 | 0.21 | 2.44 | 0.24 | 2.29 | 0.31 |
| 30 | 2.18 | 0.32 | 2.45 | 0.22 | 2.50 | 0.21 | 2.31 | 0.32 |
| Average | 2.16 | 0.30 | 2.47 | 0.22 | 2.39 | 0.26 | 2.33 | 0.30 |
| Dataset | ||||||||
| Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | |
| low | 2.03 | 0.38 | 2.57 | 0.21 | 2.54 | 0.16 | 2.31 | 0.31 |
| medium | 2.19 | 0.31 | 2.47 | 0.20 | 2.43 | 0.25 | 2.35 | 0.31 |
| high | 2.16 | 0.30 | 2.45 | 0.24 | 2.36 | 0.26 | 2.29 | 0.31 |
| Average | 2.12 | 0.33 | 2.50 | 0.22 | 2.45 | 0.23 | 2.32 | 0.31 |
| Dataset | ||||||
| Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | |
| Globem | 1.90 | 0.36 | 1.98 | 0.33 | 2.01 | 0.35 |
| IFH Affect | 1.88 | 0.38 | 1.98 | 0.33 | 2.02 | 0.34 |
| Lifesnap | 1.85 | 0.38 | 1.94 | 0.37 | 2.10 | 0.29 |
| Pmdata | 1.89 | 0.36 | 2.01 | 0.36 | 1.99 | 0.33 |
| Average | 1.88 | 0.37 | 1.98 | 0.35 | 2.03 | 0.33 |
| Query Type | ||||||
| Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | |
| General Knowledge | 1.48 | 0.63 | 2.04 | 0.33 | 2.30 | 0.11 |
| Data Retrieval | 1.90 | 0.31 | 1.75 | 0.44 | 2.23 | 0.25 |
| Trend Analysis | 1.94 | 0.40 | 1.88 | 0.34 | 2.06 | 0.32 |
| Comparative Insight | 1.95 | 0.34 | 1.91 | 0.40 | 2.09 | 0.28 |
| Anomaly Detection | 1.91 | 0.34 | 2.02 | 0.32 | 1.93 | 0.40 |
| Time Period | ||||||
| Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | |
| 1 | 1.89 | 0.36 | 1.99 | 0.33 | 1.99 | 0.36 |
| 7 | 1.91 | 0.35 | 1.89 | 0.40 | 2.08 | 0.30 |
| 14 | 1.85 | 0.36 | 1.96 | 0.37 | 2.11 | 0.30 |
| 30 | 1.87 | 0.40 | 2.02 | 0.33 | 2.01 | 0.32 |
| Average | 1.88 | 0.37 | 1.96 | 0.36 | 2.05 | 0.32 |
| Abnormal Level | ||||||
| Mean | Win Rate | Mean | Win Rate | Mean | Win Rate | |
| low | 1.74 | 0.45 | 1.92 | 0.36 | 2.20 | 0.22 |
| medium | 1.90 | 0.36 | 1.95 | 0.36 | 2.04 | 0.32 |
| high | 1.89 | 0.36 | 2.01 | 0.33 | 1.99 | 0.35 |
| Average | 1.84 | 0.39 | 1.96 | 0.35 | 2.08 | 0.30 |
| Category | Openness | Description | Example Questions |
| Single-Entity | |||
| General Knowledge | 0.2-0.4 | Definition and basic understanding of metrics, optimal ranges, and benchmarks | What is HRV and its optimal range? What is resting heart rate? |
| Data Retrieval | 0.1-0.3 | Specific time-bound numerical queries | What was my step count this week? Average deep sleep minutes past 14 days? |
| Trend Analysis | 0.4-0.6 | Trend identification and behavioral patterns | Identify trends in my daily movement last 30 days. When do I typically have my most active days? |
| Comparative Insight | 0.5-0.7 | Time-based comparisons between periods | How does this week’s activity compare to last week? Has my sleep duration improved this month? |
| Anomaly Detection | 0.6-0.8 | Outlier identification and unusual deviations | Any unusual sleep metrics this month? Was there an abnormal recovery time this week? |
| Notation | Description |
| a dataset | |
| participants selected | |
| a concept of health metric, eg. heart rate, mood | |
| all timestamps (day) of data | |
| data value at timestamp(day) | |
| missing data percentage for a subject ’s data |
| Field | Description |
| ID | Id of the node |
| Name | Name of the node |
| Description | Description of the node |
| Range | Range of values with units |
| Recommendation | Recommendation for improvement |
| DataSource | Data source specification including dataset name, feature name, description, range, unit, and type, path to data |
| Field | Description |
| ID | Unique relationship identifier |
| Node_1_name | Name of first node in relationship |
| Node_1_description | Description of first node |
| Node_1_id | Unique identifier of first node |
| Node_2_name | Name of second node in relationship |
| Node_2_description | Description of second node |
| Category | Metrics |
| Physiological | Heart rate, Heart rate variability, Blood pressure, Blood oxygen saturation, Pulse wave velocity, Cardiac output, Peripheral blood flow, Respiratory rate, Oxygen uptake, Carbon dioxide exhalation rate, Lung volume, Breathing rhythm, Muscle activity, Blood glucose levels, Lactate levels, Basal metabolic rate, Core body temperature, Brain activity, Skin temperature, Sweat rate, Electrolyte concentration, Skin hydration levels, Skin conductance, pH of sweat |
| Sleep | Sleep stages (light, deep, REM), Sleep apnea events, Total sleep duration, Sleep onset latency, Wake after sleep onset, Sleep efficiency, Arousals per night, Breathing irregularities, Snoring patterns, Circadian rhythm patterns |
| Activity | Steps taken, Distance traveled, Active minutes, Energy expenditure, Activity level, Running dynamics, Balance and stability, Joint movement and flexibility |
| Mental | Mental stress, Mental fatigue, Mental workload, Engagement, Cognitive load, Memory performance, Decision-making speed, Mood |
| Environmental | Ambient temperature, Humidity, Barometric pressure, UV radiation exposure, Air quality, Noise levels, Electromagnetic field exposure, Altitude |
| Lifestyle | GPS location, Travel patterns, Proximity to other devices or people, Interaction frequency with social contacts, Time spent on specific activities, Screen interaction patterns, Daily routine adherence |
| Type | Metric | Globem | Ifh_affect | Lifesnap | Pmdata |
| Physiological | Blood oxygen saturation | ✗ | ✗ | ✓ | ✗ |
| Skin conductance | ✗ | ✗ | ✓ | ✗ | |
| HRV RMSSD | ✗ | ✓ | ✓ | ✗ | |
| Resting heart rate | ✗ | ✓ | ✓ | ✗ | |
| Nightly skin temperature | ✗ | ✗ | ✓ | ✗ | |
| Sleep breathing rate | ✗ | ✓ | ✓ | ✗ |
Graph Retrieval-Augmented Generation
Graph Retrieval-Augmented Generation connects language models to knowledge graphs to retrieve relational evidence for grounded, multi-hop answers.
See all 232 papers