Wellbeing Measurement Module

The Wellbeing module provides AI-powered employee wellness surveys with sentiment analysis, crisis detection, and anonymous response pathways.

Key Features

AI Sentiment Analysis

Automatic mood and sentiment detection from responses

Crisis Prevention

Real-time keyword detection with immediate intervention

Anonymous Pathways

Encrypted responses for sensitive topics

Smart Scheduling

Intelligent timing to avoid survey fatigue

Survey Frequency

Survey Fatigue Prevention: Maximum 12 surveys per employee per year with intelligent timing to avoid over-surveying.
Survey TypeFrequencyQuestions
Pulse CheckMonthly3-5 questions
Quarterly ReviewQuarterly10-15 questions
Annual EngagementYearly25-40 questions
Ad-hoc TopicAs needed5-10 questions

Sentiment Analysis

Responses are analyzed using AI to detect:
type SentimentScore = {
  positive: number;  // 0-1
  negative: number;  // 0-1
  neutral: number;   // 0-1
  topics: string[];  // ["workload", "management", "culture"]
  riskLevel: "low" | "medium" | "high" | "critical";
};

Risk Levels

LevelTriggerAction
LowNormal responsesStandard reporting
MediumNegative trend detectedManager notification
HighConcerning languageHR alert within 24 hours
CriticalCrisis keywordsImmediate intervention

Crisis Detection

Safety-Critical Feature: Crisis keywords trigger immediate intervention regardless of user notification preferences.

Crisis Keywords (Examples)

Monitored phrases that trigger immediate action:
  • “I can’t go on”
  • “No point anymore”
  • “Ending it”
  • “Self-harm”
  • “Suicidal thoughts”

Intervention Flow

1

Detection

AI identifies crisis keywords in survey response
2

Alert

Immediate notification to designated crisis responders
3

Resources

User receives mental health resources email
4

Follow-up

Trained responder reaches out within 4 hours

Anonymous Mode

For sensitive topics, anonymous mode provides:
  • Encrypted responses: Only aggregate data visible
  • No user linking: Individual responses cannot be traced
  • Threshold reporting: Results only shown with 5+ responses
  • GDPR compliant: Right to erasure supported
const survey = await createSurvey({
  title: "Workplace Culture Assessment",
  anonymous: true,
  minResponsesForResults: 5,
  encryptResponses: true,
});

API Usage

import {
  createSurvey,
  submitResponse,
  analyzeResults
} from "@repo/wellbeing";

// Create a survey
const survey = await createSurvey({
  title: "Monthly Pulse Check",
  questions: [
    { text: "How are you feeling this week?", type: "scale", min: 1, max: 10 },
    { text: "What's on your mind?", type: "text", optional: true },
  ],
  organizationId,
  scheduledFor: new Date("2025-03-01"),
});

// Submit response
await submitResponse({
  surveyId: survey.id,
  userId: session.user.id,
  answers: [
    { questionId: "q1", value: 7 },
    { questionId: "q2", value: "Feeling good about the new project" },
  ],
});

// Get aggregated analysis (admin)
const analysis = await analyzeResults({
  surveyId: survey.id,
});
// Returns: { avgScore: 7.2, sentiment: "positive", topics: [...] }

Email Notifications

EmailTriggerAlways Sent?
Survey InvitationSurvey scheduledRespects preferences
Survey CompleteResponse submittedRespects preferences
Crisis AlertKeywords detectedAlways (safety)
Crisis ResourcesAfter crisis detectionAlways (safety)

Dashboard Insights

Aggregate wellbeing data is visualized:
  • Trend Charts: Track sentiment over time
  • Topic Clouds: Common themes from open responses
  • Department Comparison: (Anonymous, threshold-protected)
  • Intervention Tracking: Crisis response effectiveness

Compliance Mapping

FrameworkMetricHow Wellbeing Maps
B-CorpWorkersEmployee satisfaction scores
CSRD S1Own WorkforceWellbeing measurement
UN SDG 3Good HealthMental health indicators
GRI 403Occupational HealthPsychological safety
ISO 45003Psychological HealthRisk assessment data