Skip to main content

Thymia Sentinel

Voice AI safety monitoring through multimodal biomarker analysis.

Sentinel streams voice conversations to Thymia's Lyra server for real-time extraction of clinical speech biomarkers, combined with policy-based safety reasoning to detect mental health concerns that text-only systems miss.

Why Multimodal?

Text-only safety moderation has two fundamental failure modes:

  1. False negatives (minimization): Users experiencing mental health crises frequently downplay their distress verbally. "I'm fine, just tired" may be spoken with voice biomarkers indicating severe depression.

  2. False positives (alarm fatigue): Phrases like "I'm dying of embarrassment" trigger crisis pathways despite no clinical concern, leading to desensitization and wasted resources.

Both failures stem from the same limitation: reliance on semantic content without physiological ground truth. Sentinel addresses this by combining speech biomarkers with conversation analysis through explicit concordance checking.

Installation

pip install thymia-sentinel

Quick Start

from thymia_sentinel import SentinelClient

async def handle_result(result):
    policy = result["policy"]
    policy_name = result.get("policy_name", policy)
    if policy_name == "demo_wellbeing_awareness":
        classification = result["result"]["classification"]
        level = classification["level"]  # 0-3
        alert = classification["alert"]  # none, aware, supportive, mindful

        if level >= 2:
            print(f"Risk level {level}: {alert}")
            print(f"Recommended: {result['result']['recommended_actions']['for_agent']}")

sentinel = SentinelClient(
    user_label="user-123",
    policies=["demo_wellbeing_awareness"],
    biomarkers=["helios", "apollo"],
    on_policy_result=handle_result,
)

await sentinel.connect()

# In your voice AI audio loop:
await sentinel.send_user_audio(user_audio_bytes)      # PCM16 @ 16kHz
await sentinel.send_agent_audio(agent_audio_bytes)
await sentinel.send_user_transcript("I've been feeling okay lately")
await sentinel.send_agent_transcript("That's good to hear. How has your sleep been?")

# When done:
await sentinel.close()

Configuration

Parameter Type Default Description
user_label str None Unique user identifier
date_of_birth str None YYYY-MM-DD format (improves accuracy, imputed from voice if omitted)
birth_sex str None "MALE" or "FEMALE" (improves accuracy, imputed from voice if omitted)
language str "en-GB" Language code
policies list[str] required Policies to execute
biomarkers list[str] ["helios"] Biomarkers to extract
sample_rate int 16000 Audio sample rate in Hz
on_policy_result callable None Callback for policy results
on_progress_result callable None Callback for progress updates
api_key str env THYMIA_API_KEY Your Thymia API key

Demo Policies

  • demo_wellbeing_awareness: Wellbeing awareness analysis with risk classification and recommended actions
  • demo_field_extraction: Extracts basic user fields (name, age) from conversation

Biomarkers

  • helios: Wellness indicators (distress, stress, burnout, fatigue, low self-esteem)
  • apollo: Clinical disorder probabilities (depression, anxiety) and symptom-level severities
  • psyche: Real-time affect detection (happy, sad, angry, fearful, etc.)

Awareness Levels

The wellbeing awareness policy returns a 4-level classification:

Level Alert Description
0 none All clear, no concerns
1 aware Be attentive, mild indicators
2 supportive Be supportive and mindful, moderate indicators
3 mindful Be very mindful, notably elevated signals

Framework Integrations

For framework-specific examples, see the examples directory:

  • LiveKit Agents - Automatic audio capture from LiveKit rooms
  • Pipecat - Integration with Pipecat pipelines
  • VAPI - WebSocket integration for VAPI
  • Gemini Live - Google Gemini Live API integration

License

MIT License - see LICENSE for details.

Metadata

Release files for thymia-sentinel 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thymia-sentinel 1.2.1
File Size Uploaded
thymia_sentinel-1.2.1.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thymia-sentinel 1.2.1
File Interpreter ABI Platform
thymia_sentinel-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / thymia_sentinel-1.2.1.tar.gz

Download URL thymia_sentinel-1.2.1.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f8a1222694fda09759c184b05b6dab41a1f27941dfc3a4c5e6263f4b1121c7e5
BLAKE2b-256 checksum
How to use checksums
b72e4ea7c9c7446950487e7c7bbea8ebdc8eb12e627b5d8214066ab76c1ccfb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 11, 2026.

Transparency log

Release files / thymia_sentinel-1.2.1-py3-none-any.whl

Download URL thymia_sentinel-1.2.1-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b33a0a2b72fe97dc79de3944b1deb180b80deb32eeacfe15ad576e454e672d9
BLAKE2b-256 checksum
How to use checksums
9e396c87fc248d3be456e4d53a6b7011361b6ab7e41838fc61ee10ef15eeebf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page