Skip to main content
Start building emotion-aware applications with Synheart in minutes. This guide shows you how to use Synheart CLI to generate mock HSI data, Synheart Core to process it, and Synheart Emotion to detect emotions.

Get started in three steps

Get your Synheart integration running and detect emotions from HSI data in real-time.

Step 1: Set up tooling and SDKs

Installation details are centralized under Tools and SDK pages: Quick verification:
synheart version
synheart mock start --flux
Use synheart-cli to download SDK artifacts and test your app locally with mock streams and local services.

Step 2: Initialize SDKs

Initialize Synheart Core (optional) and Synheart Emotion (works standalone).
import 'package:synheart_emotion/synheart_emotion.dart';

void main() async {
  // Initialize Synheart Emotion (standalone)
  final emotionEngine = EmotionEngine.fromPretrained(
    const EmotionConfig(
      window: Duration(seconds: 60),
      step: Duration(seconds: 5),
    ),
  );
}
import com.synheart.emotion.EmotionConfig
import com.synheart.emotion.EmotionEngine
import java.util.Date

// Initialize Synheart Emotion (standalone)
val emotionEngine = EmotionEngine.fromPretrained(EmotionConfig())
import SynheartEmotion

let emotionEngine = try EmotionEngine.fromPretrained(config: EmotionConfig())

Step 3: Stream biosignals and detect emotions

Feed heart-rate + RR-intervals into Synheart Emotion to detect emotions in real time.
// Push biosignal samples into the engine (example values)
emotionEngine.push(
  hr: 72.0,
  rrIntervalsMs: [823, 810, 798, 815, 820].map((v) => v.toDouble()).toList(),
  timestamp: DateTime.now().toUtc(),
);

final results = emotionEngine.consumeReady();
if (results.isNotEmpty) {
  final result = results.first;
  print('Emotion: ${result.emotion} (${(result.confidence * 100).toStringAsFixed(1)}%)');
}
emotionEngine.push(
    hr = 72.0,
    rrIntervalsMs = listOf(850.0, 820.0, 830.0, 815.0, 828.0),
    timestamp = Date()
)

val results = emotionEngine.consumeReady()
if (results.isNotEmpty()) {
    val result = results.first()
    println("Emotion: ${result.emotion} (${(result.confidence * 100).toInt()}%)")
}
emotionEngine.push(
    hr: 72.0,
    rrIntervalsMs: [850.0, 820.0, 830.0, 815.0, 828.0],
    timestamp: Date()
)

let results = emotionEngine.consumeReady()
if let result = results.first {
    print("Emotion: \(result.emotion) (\(Int(result.confidence * 100))%)")
}

How It Works

  1. Synheart CLI generates realistic mock HSI data and streams it via WebSocket
  2. Your app/test harness consumes those events to validate ingestion and local flows
  3. Synheart Emotion processes heart-rate and RR intervals for on-device emotion inference

Integration Benefits

Privacy-First

All processing happens on-device. No biosignal data is sent to servers.

Real-Time

Sub-5ms inference latency for instant emotional state updates.

Research-Grade

Tested and validated on real-world datasets with proven accuracy.

Next steps

Synheart Core

Learn about the unified SDK and HSI processing

Install Synheart CLI

Install CLI and set up SDK artifact downloads

Synheart Emotion

Deep dive into emotion detection models

Troubleshooting

Common issues and solutions

Author: Israel Goytom