Skip to main content

What is Synheart Behavior?

Synheart Behavior is a multi-platform SDK for inferring behavioral signals from digital interactions (scroll, tap, swipe, typing, notifications, calls) directly on device, ensuring privacy and real-time performance. Supported Motion States:
  • 🛌 LAYING:
  • 🚶 MOVING:
  • 🪑 SITTING:
  • 🧍 STANDING:

Key Features

On-Device Processing

  • All inference happens locally on your device
  • No network calls required
  • No raw interaction data leaves the device
  • Privacy-first by design

On-Demand Metrics Calculation

  • Calculate behavioral metrics for custom time ranges within sessions
  • Query metrics for specific time periods without ending the session
  • Supports both active and ended sessions
  • Automatic validation ensures time ranges are within session bounds

Privacy-First Design

  • No PII: No names, contacts, or user-identifying data
  • No content capture: No text, images, or semantic data
  • No keystroke logging: Text input captured only as abstract tap events
  • Event-level metadata only: Timing and physical metrics only

Multi-Platform

PlatformSDKInstallationVersionStatus
Dart/Fluttersynheart_behaviorflutter pub add synheart_behavior0.1.4✅ Ready

Architecture

All SDKs implement the same architecture with synheart-flux (Rust library) for HSI-compliant metric computation:
User Interactions
   └─(scroll, tap, swipe, typing, notifications, calls)──► Synheart Behavior SDK
            [Event Collector] → [Event Conversion] → [synheart-flux]
                                     │                      │
                                  [ML Model]          [HSI Metrics]
                                     │                      │
                              MotionState          BehaviorMetrics
                                     │                      │
                                     └──────────────────────┘


                                      Your App
Components:
  • Event Collectors: Capture scroll, tap, swipe, typing, notification, and call events
  • Event Conversion: Converts events to Flux-compatible JSON format
  • synheart-flux: Rust library for HSI-compliant behavioral and typing metric computation (required)
  • Session Aggregator: Aggregates events into session-level summaries
  • Motion State Inference: ML model for activity recognition (LAYING, MOVING, SITTING, STANDING)
  • Behavioral Metrics: Focus hint, distraction score, interaction intensity (computed by Flux)
Note: synheart-flux is required for all metric calculations. See installation instructions in platform-specific guides.

Quick Start Examples

import 'package:synheart_behavior/synheart_behavior.dart';

final behavior = await SynheartBehavior.initialize(
  config: const BehaviorConfig(
    enableInputSignals: true,
    enableAttentionSignals: true,
    enableMotionLite: true,
  ),
);

// Wrap app to enable gesture tracking
return behavior.wrapWithGestureDetector(
  MaterialApp(...),
);

// Listen to real-time events
behavior.onEvent.listen((event) {
  print('Event: ${event.eventType} at ${event.timestamp}');
});

// Start a session
final session = await behavior.startSession();
Full Dart SDK Guide →

Use Cases

Focus and Distraction Apps

Monitor user focus in real-time:
final behavior = await SynheartBehavior.initialize(
  config: const BehaviorConfig(
    enableInputSignals: true,
    enableAttentionSignals: true,
  ),
);

behavior.onEvent.listen((event) {
  // Track interaction patterns
});

final session = await behavior.startSession();
// ... user interacts with app ...
final summary = await session.end();

if (summary.behavioralMetrics.focusHint > 0.7) {
  print('User is highly focused');
} else if (summary.behavioralMetrics.distractionScore > 0.6) {
  print('User appears distracted');
}

Digital Wellness Analytics

Track behavioral patterns throughout the day:
// Start session when user opens app
final session = await behavior.startSession();

// End session when user closes app
final summary = await session.end();

// Analyze session metrics
print('Interaction Intensity: ${summary.behavioralMetrics.interactionIntensity}');
print('Deep Focus Blocks: ${summary.behavioralMetrics.deepFocusBlocks.length}');
print('Task Switch Rate: ${summary.behavioralMetrics.taskSwitchRate}');

On-Demand Metrics for Time Ranges

Calculate metrics for specific time periods within a session:
// Calculate metrics for a custom time range
final metrics = await behavior.calculateMetricsForTimeRange(
  startTimestampSeconds: 1767688063,  // Unix timestamp in seconds
  endTimestampSeconds: 1767688130,     // Unix timestamp in seconds
  sessionId: 'SESS-1767688063415',     // Optional: session ID
);

// Access calculated metrics
print('Events in range: ${metrics['activity_summary']['total_events']}');
print('Interaction intensity: ${metrics['behavioral_metrics']['interaction_intensity']}');
print('Distraction score: ${metrics['behavioral_metrics']['behavioral_distraction_score']}');

// Motion state (if available)
if (metrics['motion_state'] != null) {
  print('Motion state: ${metrics['motion_state']['major_state']}');
}

Cognitive Load Estimation

Estimate cognitive load from interaction patterns:
final summary = await session.end();

// High interaction intensity + low fragmentation = high cognitive load
final cognitiveLoad = summary.behavioralMetrics.interactionIntensity *
                     (1 - summary.behavioralMetrics.fragmentedIdleRatio);

if (cognitiveLoad > 0.8) {
  // Suggest taking a break
}

Behavioral Metrics

Session-level outputs include:
  • interactionIntensity: Overall interaction rate and engagement (0-1)
  • distractionScore: Behavioral proxy for distraction (0-1)
  • focusHint: Behavioral proxy for focus quality (0-1)
  • deepFocusBlocks: Periods of sustained, uninterrupted engagement
  • taskSwitchRate: Frequency of app switching
  • idleRatio: Proportion of idle time vs active interaction
  • fragmentedIdleRatio: Ratio of fragmented vs continuous idle periods
  • burstiness: Temporal clustering of interaction events
  • notificationLoad: Notification pressure and response patterns
  • scrollJitterRate: Scroll pattern irregularity
  • typingSpeed: Average typing speed (taps per second)
  • typingCadenceStability: Consistency of typing rhythm (0-1)
  • typingCadenceVariability: Variability in timing between taps
  • typingActivityRatio: Fraction of session with active typing (0-1)
  • typingGapRatio: Proportion of intervals that are gaps (0-1)
  • typingBurstiness: Temporal clustering of typing events
  • typingInteractionIntensity: Overall typing engagement (0-1)
All metrics are bounded, normalized, and numerically stable.

Motion State Inference

When enableMotionLite is enabled, the SDK uses an on-device ML model to predict motion states:
final summary = await session.end();

if (summary.motionState != null) {
  print('Motion State: ${summary.motionState!.majorState}');
  print('Confidence: ${summary.motionState!.confidence}');
  // States: LAYING, MOVING, SITTING, STANDING
}
Model Details:
  • Model Type: Linear SVM (One-vs-Rest)
  • Input Features: Device motion signals (accelerometer, gyroscope)
  • Output: Motion state probabilities with confidence scores
  • Latency: < 5ms on modern mid-range devices

API Features

The SDK provides the following functionality:
FeatureDart/Flutter
BehaviorConfig
SynheartBehavior
BehaviorEvent
BehaviorSession
Motion State Inference
Real-Time Event Streaming
Session Management
On-Demand Metrics Calculation
Thread-Safe
Automatic Session Ending

Available SDKs

Privacy & Security

  • On-Device Processing: All behavioral inference happens locally
  • No Data Retention: Raw interaction events are not retained after processing
  • No Network Calls: No data is sent to external servers
  • Privacy-First Design: No built-in storage - you control what gets persisted
  • No Content Capture: No text, images, or semantic data collected
  • Event-Level Metadata Only: Only timing and physical metrics

Resources

Citation

If you use this SDK in your research:
@software{synheart_behavior,
  title = {Synheart Behavior: Multi-platform SDK for on-device behavioral signal inference from digital interactions},
  author = {Synheart AI Team},
  year = {2025},
  version = {0.1.4},
  url = {https://github.com/synheart-ai/synheart-behavior-dart}
}

Author: Yoseph Gebeyehu Made with ❤️ by the Synheart AI Team