What is Synheart Flux?
Synheart Flux is a Rust-based on-device compute engine that transforms raw wearable vendor payloads (e.g., WHOOP, Garmin) and smartphone behavioral data into HSI-compliant human state signals. Flux centralizes two parallel pipelines:- Wearable Pipeline: vendor adaptation → normalization → feature derivation → baseline computation → HSI encoding
- Behavioral Pipeline: session parsing → normalization → metric computation → baseline tracking → HSI encoding
Key Features
Wearable Processing
- Parse vendor JSON into canonical, vendor-agnostic structures
- Normalize units and scales (and surface data quality flags)
- Derive features (sleep efficiency/fragmentation, normalized load, etc.)
- Maintain rolling baselines for relative interpretation (HRV, RHR, sleep)
- Encode daily windows into HSI JSON with provenance + quality/confidence
Behavioral Metrics
- Parse behavioral session JSON (taps, scrolls, notifications, app switches, typing)
- Compute engagement metrics (distraction score, focus hint, burstiness, interaction intensity)
- Detect patterns (idle segments, engagement blocks, scroll jitter, deep focus periods)
- Maintain rolling baselines across sessions (20-session default window)
- Encode behavioral windows into HSI JSON with deviation tracking
Context Snapshots
- Capture bio context from wearable processing (sleep quality, recovery, HRV/RHR deviations)
- Apply staleness decay with configurable half-life (default 12 hours)
- Combine with realtime behavior for context-aware adaptive systems
- Read-only snapshots that don’t mutate baselines
Typing Correction and Clipboard Metrics
- Correction tracking:
number_of_backspace,number_of_delete,correction_rate - Clipboard activity:
number_of_cut,number_of_paste,number_of_copy,clipboard_activity_rate - Rates included in HSI payload meta section:
correction_rate= (backspace + delete) / (typing_tap_count + backspace + delete)clipboard_activity_rate= (copy + paste + cut) / (typing_tap_count + copy + paste + cut)
Non-goals
- Emotion inference or labeling
- Medical/diagnostic claims
- UI, visualization, or cloud-side compute
- Replacing wearable ingestion/auth SDKs
Installation
Rust (crate)
Add to yourCargo.toml:
Platform Installs (Android / iOS / Flutter / Desktop)
Flux is typically bundled into a host SDK (e.g., Synheart Wear, Synheart Behavior) as native artifacts.- Recommended (prebuilt): Download artifacts from GitHub Releases and vendor them into your SDK repo
- Fallback (from source): Build artifacts in CI using the scripts in
scripts/
Android (JNI .so inside an AAR)
- Get: release asset
synheart-flux-android-jniLibs.tar.gz - Place in your Android library/module:
- Build from source:
iOS (XCFramework)
- Get: release asset
synheart-flux-ios-xcframework.zip - Place:
- Build from source (macOS):
Flutter
Bundle the same artifacts in your Flutter plugin:Desktop (macOS / Linux / Windows)
- Get (examples):
synheart-flux-desktop-linux-x86_64.tar.gzsynheart-flux-desktop-macos-<arch>.tar.gzsynheart-flux-desktop-windows-x86_64.zip
- Use them in your app/tooling distribution (or load dynamically via FFI).
WebAssembly (WASI)
Flux can be compiled to WASM for cross-language integration:alloc and dealloc for host-managed memory, alongside the standard Flux FFI API.
Usage
One-shot Conversion (Stateless)
Persistent Baselines Across Calls
For baselines that accumulate across multiple payloads (e.g., across app launches), useFluxProcessor:
Behavioral Metrics (One-shot)
Behavioral Metrics with Persistent Baselines
Context-Aware Snapshots
Thesnapshot_now() API provides staleness-aware bio context combined with optional realtime behavior. This is useful for adaptive systems that need honest background context from wearables while relying on behavior for realtime state.
With Realtime Behavior
Behavioral Axes
| Axis | Direction | Description |
|---|---|---|
distraction | higher_is_more | Composite distraction score (0-1) |
focus | higher_is_more | Inverse of distraction (0-1) |
task_switch_rate | higher_is_more | App switch frequency (normalized) |
notification_load | higher_is_more | Notification frequency (normalized) |
burstiness | bidirectional | Temporal clustering (Barabasi index) |
scroll_jitter_rate | higher_is_more | Direction reversals ratio |
interaction_intensity | higher_is_more | Events per second (normalized) |
idle_ratio | higher_is_more | Idle time ratio |
Context Axes (Snapshot API)
| Axis | Direction | Description |
|---|---|---|
bio_freshness | higher_is_more | How fresh the wearable data is (1.0 = just observed, decays over time) |
recovery_context | higher_is_more | Recovery score with staleness-decayed confidence |
sleep_context | higher_is_more | Sleep quality with staleness-decayed confidence |
hrv_delta_context | bidirectional | HRV deviation from baseline (0.5 = at baseline) |
rhr_delta_context | higher_is_more | RHR deviation from baseline (>0.5 = below baseline, better) |
Staleness Decay
Bio context confidence decays exponentially with a 12-hour half-life:- 0 hours: 100% confidence
- 12 hours: 50% confidence
- 24 hours: 25% confidence
- ~40 hours: ~10% confidence (considered stale)
Adapt-Engine Integration
TheSnapshotAdapter converts snapshot_now() output to the HsiSnapshot format expected by synheart-adapt-engine:
Score Mapping
| Adapt-Engine Field | snapshot_now() Source | Mapping |
|---|---|---|
readiness_score | recovery_context, focus, sleep_context | Weighted average (40%, 40%, 20%) |
stress_load_proxy | recovery_context | 1.0 - recovery |
attention_capacity_proxy | distraction | 1.0 - distraction |
freshness_ms | bio_context_age_hours | age_hours * 3600000 |
sources | Presence of axes | Wearable and/or Behavior |
Custom Mapping Configuration
HSI Output Format
Flux emits HSI 1.0 JSON payloads that conform to the Human State Interface specification.Required Fields
hsi_version— Schema version (e.g.,"1.0")observed_at_utc— When the data was observedcomputed_at_utc— When HSI was computedproducer— Name, version, and instance_id of the producing softwarewindow_ids/windows— Time windows with start/end timestampssource_ids/sources— Data sources with type and qualityaxes— Behavioral readings organized by domainprivacy— Data handling declarations
Feature Flags
ffi: Enables the C FFI bindings for mobile and cross-language integration. Provides:- Wearable functions:
flux_whoop_to_hsi_daily,flux_garmin_to_hsi_daily, and statefulFluxProcessorAPI - Behavioral functions:
flux_behavior_to_hsi, and statefulBehaviorProcessorAPI - Snapshot functions:
flux_processor_snapshot_now(stateful),flux_snapshot_now(stateless)
- Wearable functions:
cli: Enables thefluxcommand-line binary for processing wearable data
Resources
- GitHub: synheart-ai/synheart-flux
- crates.io: synheart-flux
- docs.rs: synheart-flux