Products & Core concepts

Introduction to Sahha's model schema

The model schema is the foundation for interpreting the results from Sahha's models. Carefully designed for comprehensiveness, the schema defines the format and organization of the output returned by the models. Understanding this schema is beneficial for effectively interpreting and applying the rich data generated by our models.


For details on the specific values each model can output, please consult the corresponding model documentation: wellbeing scores or mental health scores

Schema Overview

The Sahha schema standardizes the output of Sahha’s AI-powered health analysis models, ensuring consistency and interoperability. The schema is crafted to be user-friendly and detailed, ensuring that you can effortlessly navigate through the information and apply it with confidence.

Schema Structure

This section outlines each component of the schema, explaining the type of information and its format.

Data Output Description Data Type Possible Values
id Unique identifier for each inference String UUID
type Model type used for inference String depression, anxiety, stress, sleep, etc.
state Qualitative assessment of the inference String For mental health: none, low, medium or high. For wellbeing and resilience: minimal, low, medium or high.
score Quantitative measure of the inference Number 0.0 to 1.0
factors Key elements influencing the score and state Object Array Combinations of factors such as active_hours, daily_steps, sleep_regularity, etc.
inputData Data sources used in generating the inference String Array Various combinations of sleep, activity, screen, heart, blood, age, and gender
createdAt UTC Timestamp indicating when the inference was generated String ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

Example JSON Output

Here's a sample of how the data is structured:

"inference": {
"id": "26051AB2-867F-4F8D-B134-0031C20D3FDC",
"type": "stress",
"state": "none",
"score": 0.12,
"factors": [
{ "name": "base_score", "value": 0.3 },
{ "name": "active_hours", "value": -0.12 },
{ "name": "daily_steps", "value": 0.05 },
{ "name": "total_sleep_time", "value": -0.07 },
{ "name": "sleep_debt", "value": -0.04 }
"inputData": ["age", "activity", "sleep"],
"createdAt": "2023-11-11T11:05:41.644Z"

Understanding the Schema

Each component of the Sahha schema plays an important role:

  • id : Ensures unique identification of each inference. This is useful for maintaining accurate records and for referencing specific analyses in user histories or providing feedback on the analyses.
  • type : Indicates which type of behaviour is being analysed through the respective Sahha Model being used for analysis. It helps in contextualising the rest of the inference, whether it's related to mental health, physical activity, sleep, etc.
  • state : Provides a qualitative perspective of the user's health status as a textual description (such as low, medium, high). It serves as an immediate, understandable summary of the user's condition on that health metric. This is particularly useful for quick assessments as a more straightforward indication of health status.
  • score : Offers a numerical representation of the severity or status of the health condition being assessed. It is a precise, quantified evaluation, allowing for fine-grained analysis and tracking over time. It is particularly valuable for monitoring progress or changes in health conditions.
  • factors : Key indicators that the model analyzes to derive the score and state, showing what aspects of the user’s behavior and lifestyle most influenced the outcome. By identifying the factors that are impacting the score the most, users can understand what aspects of their lifestyle or behavior are most influential. This insight can guide targeted changes and personalised interventions.
  • inputData : Represents the diverse data sources utilized to generate the health analysis. It informs what data was actually available from the user’s device and included in the assessment. For example, if the depression score model uses sleep, activity, and age data, but the user hasn’t provided sleep data, then inputData will list only age and activity. The completeness of the inputData improves the reliability of the score and state.
  • createdAt : Indicates when the analysis was generated. This provides context for the data, showing how recent the analysis is. It's important for tracking changes over time and for ensuring that users are acting on the most current information.

Frequently Asked Questions (FAQs)

Q: How is the score calculated?
A: The score is calculated using advanced algorithms that analyze the user's inputData, quantifying the status of the condition, as assessed by the model.

Q: Can the same id be assigned to different inferences?
A: No, each id is unique and corresponds to a specific inference.

Q: What do the different states signify?
A: States offer a qualitative interpretation of the user's health status, providing context to the numerical score. They vary depending on the health metric analyzed.

Q: Are all listed factors used in each inference?
A: The factors included depend on the model and the available data for a user. Only relevant and available factors are used in the analysis.

Q: How should I interpret the createdAt timestamp?
A: The createdAt timestamp indicates the exact time and date the analysis was generated, in Coordinated Universal Time (UTC), helping you understand the recency of the information.