Skip to main content

System Overview

Synheart Core SDK is a modular, on-device human state intelligence system that collects multi-modal signals, fuses them into a unified state representation (HSV - Human State Vector), and provides optional interpretation modules for focus and emotion.
┌────────────────────────────────────────────────────────┐
│                 Synheart Core SDK                      │
├────────────────────────────────────────────────────────┤
│                                                        │
│  ┌──────────┐  ┌──────────┐  ┌────────────────┐     │
│  │   Wear   │  │  Phone   │  │    Behavior    │     │
│  │  Module  │  │  Module  │  │     Module     │     │
│  └─────┬────┘  └─────┬────┘  └────────┬───────┘     │
│        │             │                 │              │
│        └─────────────┼─────────────────┘              │
│                      ▼                                │
│              ┌───────────────┐                        │
│              │  HSI Runtime  │                        │
│              │  (On-device)  │                        │
│              └───────┬───────┘                        │
│                      │                                │
│        ┌─────────────┼─────────────┐                 │
│        │             │              │                 │
│   ┌────▼────┐  ┌────▼────┐  ┌──────▼──────┐         │
│   │  Focus  │  │ Emotion │  │   Cloud     │         │
│   │ Module  │  │ Module  │  │ Connector   │         │
│   └─────────┘  └─────────┘  └─────────────┘         │
│                                                        │
└────────────────────────────────────────────────────────┘

Module System

Signal Collection Modules

1. Wear Module

Collects biosignals from wearable devices. Data Sources:
  • Heart rate (HR)
  • Heart rate variability (HRV)
  • Sleep stages
  • Motion/activity
  • Skin temperature (if available)
Output:
  • Derived signals only (no raw biosignals)
  • 30s, 5m, 1h, 24h aggregations
  • Quality metrics and confidence scores
Platform Support:
  • iOS: HealthKit
  • Android: Health Connect
  • Multi-device: Apple Watch, Fitbit, WHOOP, Garmin, Samsung
// Example: Wear module output
{
  "hr_mean": 72,
  "hr_std": 8,
  "hrv_rmssd": 45,
  "hrv_sdnn": 62,
  "quality_score": 0.95,
  "window": "30s"
}

2. Phone Module

Collects device-level signals. Data Sources:
  • Motion (accelerometer, gyroscope)
  • Screen state (on/off, brightness)
  • App context (coarse categories)
  • Location context (stay/move, no coordinates)
Privacy:
  • No fine-grained location
  • No app names (only categories: social, productivity, etc.)
  • No notification content
// Example: Phone module output
{
  "motion_state": "stationary",
  "screen_on": true,
  "screen_brightness": 0.8,
  "app_category": "productivity",
  "context": "work"
}

3. Behavior Module

Captures interaction patterns. Data Sources:
  • Tap frequency and pressure
  • Scroll speed and direction
  • Typing cadence
  • App switching frequency
  • Screen unlock patterns
Privacy:
  • No content (what you type/read)
  • Only patterns (how you interact)
// Example: Behavior module output
{
  "tap_frequency": 12.5,
  "scroll_velocity_mean": 0.4,
  "typing_cadence": 3.2,
  "app_switches_per_min": 2.1,
  "interaction_stability": 0.82
}

HSI Runtime

The HSI Runtime fuses signals from all modules into a unified state representation (HSV - Human State Vector). Core Functions:
  1. Multimodal Fusion: Combines biosignals, phone sensors, and behavior
  2. State Axes: Calculates affect and engagement indices
  3. Time Windows: Maintains state across 30s, 5m, 1h, 24h windows
  4. State Embedding: Generates 64D vector representation
Output:
{
  "affect": {
    "arousal_index": 0.72,      // 0.0-1.0
    "valence_index": 0.15,      // -1.0 to 1.0
    "intensity": 0.68           // 0.0-1.0
  },
  "engagement": {
    "engagement_stability": 0.81,
    "cognitive_load": 0.65,
    "attention_level": 0.73
  },
  "state_embedding": [0.12, 0.34, ...], // 64D vector
  "window": {
    "duration": "30s",
    "start": "2025-01-15T10:30:00Z",
    "end": "2025-01-15T10:30:30Z"
  },
  "timestamp": "2025-01-15T10:30:30Z"
}
Update Frequency:
  • 30s window: Updated every 30 seconds
  • 5m window: Updated every minute
  • 1h window: Updated every 5 minutes
  • 24h window: Updated every 15 minutes
Performance:
  • Latency: ≤ 100ms
  • CPU: < 2%
  • Memory: < 15MB
  • Battery: < 0.5%/hr

Interpretation Modules

1. Focus Module

Estimates cognitive focus and concentration. Inputs:
  • HSI state embedding
  • Engagement indices
  • Behavioral patterns
Outputs:
{
  "estimate": {
    "score": 0.85,           // 0.0-1.0
    "confidence": 0.92       // 0.0-1.0
  },
  "state": "focused",        // focused, distracted, neutral, deep_focus
  "trend": "increasing",     // increasing, decreasing, stable
  "timestamp": "2025-01-15T10:30:30Z"
}
States:
  • focused: Moderate to high sustained attention
  • deep_focus: Very high sustained attention
  • distracted: Low attention with high variability
  • neutral: Baseline state

2. Emotion Module

Estimates affective states from physiological and behavioral signals. Inputs:
  • HSI affect axes
  • Biosignals (HR, HRV)
  • Behavioral patterns
Outputs:
{
  "stress_index": 0.45,      // 0.0-1.0
  "energy_level": 0.72,      // 0.0-1.0
  "primary_emotion": "calm", // calm, stressed, excited, tired
  "valence": 0.2,           // -1.0 to 1.0
  "arousal": 0.65,          // 0.0-1.0
  "timestamp": "2025-01-15T10:30:30Z"
}
Emotion Categories:
  • calm: Low arousal, positive valence
  • stressed: High arousal, negative valence
  • excited: High arousal, positive valence
  • tired: Low arousal, negative valence

Cloud Connector

Securely uploads state snapshots (HSI 1.0 format) to the cloud (with user consent). Features:
  • Consent-gated uploads
  • Batch processing
  • WiFi-only option
  • Automatic retry
  • End-to-end encryption
Upload Payload:
{
  "user_id": "anon_user_123",
  "snapshots": [
    {
      "hsi": { /* HSV converted to HSI 1.0 format */ },
      "focus": { /* Focus estimate */ },
      "emotion": { /* Emotion state */ },
      "timestamp": "2025-01-15T10:30:30Z"
    }
  ],
  "metadata": {
    "sdk_version": "1.0.0",
    "platform": "ios",
    "capability_level": "core"
  }
}
Privacy:
  • No raw signals
  • No personally identifiable information
  • Only derived state snapshots (HSI 1.0 format)
  • User can revoke at any time
Manages permissions and data masking. Responsibilities:
  1. Permission requests
  2. Consent tracking
  3. Data masking based on consent
  4. Runtime enforcement
Consent Levels:
ModulePermissionData Access
WearHealth dataDerived biosignals
PhoneMotion & sensorsCoarse context only
BehaviorAccessibility (optional)Interaction patterns only
CloudNetwork uploadHSI snapshots only
Example:
// Request consent
final granted = await Synheart.requestConsent(
  modules: [ConsentModule.wear, ConsentModule.cloud],
  reason: "We need access to provide personalized insights"
);

// Check current consent
final status = await Synheart.getConsentStatus();
// { wear: true, phone: true, behavior: false, cloud: true }

// Revoke consent
await Synheart.revokeConsent(ConsentModule.cloud);

Capability System

Different apps get different levels of access based on app signature and tenant ID.

Capability Levels

LevelAccessWho Gets It
CoreBasic HSV, derived signalsExternal developers
ExtendedFull HSV embedding, higher frequencySynheart apps (Syni Life, SWIP)
ResearchRaw streams, full fusion vectorsResearch apps (with authorization)

Capability Matrix

ModuleCoreExtendedResearch
WearDerived biosignals (30s windows)Higher frequency (5s windows)Raw HR/HRV streams
PhoneMotion, screen stateAdvanced app contextFull context with app names
BehaviorBasic metrics (aggregated)Extended metricsEvent-level streams
HSV RuntimeBasic state (affect, engagement)Full 64D embeddingFull fusion vectors + intermediate states
CloudIngest endpoint (HSI 1.0)Extended endpointsResearch endpoints

Enforcement

Capability checks happen at:
  1. SDK Initialization: Validates app signature and tenant ID
  2. Module Enable: Checks capability for requested module
  3. Data Access: Masks/filters data based on capability
  4. Cloud Upload: Routes to appropriate endpoint
// Core capability (default)
Synheart.initialize(
  userId: userId,
  config: SynheartConfig(
    capabilityLevel: CapabilityLevel.core
  )
);

// Extended capability (Synheart apps only)
Synheart.initialize(
  userId: userId,
  config: SynheartConfig(
    capabilityLevel: CapabilityLevel.extended
  )
);

Data Flow

1. Signal Collection

Wearable Device → Wear Module → Derived Signals
Phone Sensors → Phone Module → Coarse Context
User Interactions → Behavior Module → Patterns

2. HSV Fusion

Derived Signals → HSI Runtime → HSV State Axes
Coarse Context → HSI Runtime → HSV State Embedding
Patterns → HSI Runtime → HSV Time Windows

3. Interpretation

HSV State → Focus Module → Focus Estimate
HSV State → Emotion Module → Emotion State

4. Output

HSV State → App Callbacks
Focus Estimate → App Callbacks
Emotion State → App Callbacks
HSV Snapshots → Cloud Connector (converts to HSI 1.0) → Synheart Platform

Thread Model

The SDK uses a multi-threaded architecture for performance:
Main Thread

├─ UI Updates (callbacks)

Worker Threads

├─ Signal Collection Thread
│  └─ Wear, Phone, Behavior modules

├─ HSI Processing Thread
│  └─ Fusion, state calculation

├─ Interpretation Thread
│  └─ Focus, Emotion modules

└─ Cloud Upload Thread
   └─ Batching, encryption, upload
Thread Safety:
  • All callbacks delivered on main thread
  • Internal state protected by locks
  • Async operations use platform-native concurrency (Coroutines, Combine, async/await)

Storage

Local Storage

HSV Cache:
  • Last 24 hours of HSV snapshots
  • Encrypted with AES-256
  • Auto-pruned to maintain size
  • Location: App-specific secure storage
Metadata:
  • Consent status
  • Capability level
  • Last sync timestamp
  • User preferences

Cloud Storage

Upload Policy:
  • Requires explicit consent
  • Only state snapshots - HSI 1.0 format (no raw data)
  • Encrypted in transit (TLS 1.3)
  • Encrypted at rest (AES-256)

Performance Characteristics

CPU Usage

ComponentTypicalPeak
Signal Collection0.5%1%
HSI Processing0.8%1.5%
Interpretation0.2%0.5%
Total1.5%2%

Memory Usage

ComponentSize
SDK Core5 MB
HSV Cache4 MB
Module State3 MB
Total12 MB

Battery Impact

ComponentImpact
Signal Collection0.1%/hr
HSI Processing0.1%/hr
Cloud Upload0.1%/hr
Total0.3%/hr

Latency

OperationLatency
HSV Update80ms
Focus Estimate50ms
Emotion State60ms
Cloud Upload60ms

Security

Data Protection

  1. Encryption
    • Local storage: AES-256
    • Network: TLS 1.3
    • Key storage: Platform keychain
  2. Access Control
    • Capability-based access
    • App signature validation
    • Tenant ID verification
  3. Privacy
    • No raw content
    • No personal identifiers
    • Consent-gated access

Threat Model

Protected Against:
  • Unauthorized data access
  • Man-in-the-middle attacks
  • Local storage compromise
  • Malicious apps accessing data
Not Protected Against:
  • Device compromise (jailbreak/root)
  • Physical device access
  • Platform-level vulnerabilities

Platform-Specific Notes

iOS

  • Uses HealthKit for biosignals
  • CoreMotion for motion sensors
  • Combine for reactive streams
  • Background delivery supported

Android

  • Uses Health Connect for biosignals
  • SensorManager for motion sensors
  • Kotlin Coroutines and Flow
  • WorkManager for background tasks

Flutter/Dart

  • Platform channels for native access
  • Streams for reactive updates
  • Async/await for operations
  • Cross-platform consistency

Author: Israel Goytom