Voice Capabilities & Interfacing
Relevant source files
The following files were used as context for generating this wiki page:
- artifacts/api-server/src/routes/anthropic/index.ts
- artifacts/api-server/src/routes/anthropic/systemPrompt.ts
- attached_assets/Pasted-The-goal-of-the-application-is-to-give-caregivers-patie_1773692362618.txt
- attached_assets/Pasted-The-goal-of-the-application-is-to-give-caregivers-patie_1773648532398.txt
- replit.md
- artifacts/api-server/src/intelligence/hospice/planner.ts
Voice capabilities within the Hospice Roadmap project are centered around providing an emotionally intelligent, multi-format guidance system for caregivers and patients. The system is designed to support users who may be overwhelmed or in crisis, offering an AI companion named Ragna that mimics the cadence and warmth of a real hospice nurse. This interface includes support for natural language processing, voice transcripts, and audio narration to ensure accessibility and ease of use during high-stress caregiving scenarios.
The architecture emphasizes a "human-first" approach, where the AI's persona is characterized by a gentle, Norwegian-rhythm voice that prioritizes emotional acknowledgment before clinical information. This enables a naturalistic back-and-forth exchange, supporting various literacy levels and learning styles through audio and visual formats.
System Identity & Vocal Persona
The voice of the system is embodied by "Ragna," a 58-year-old Norwegian hospice nurse. Her persona is designed to be calm, soft, and unhurried, intentionally avoiding robotic or overly clinical tones. The system prompt specifically dictates a "Norwegian rhythm" to her speech to enhance the feeling of warmth and steady confidence.
Core Communication Rules
- Emotion First: Acknowledge user feelings before providing clinical solutions.
- Plain Language: Define any medical jargon immediately in everyday words.
- Crisis Pacing: Use short paragraphs and numbered steps during urgent situations.
- Naturalistic Dialogue: Never use phrases like "As an AI" to maintain the persona of a trusted friend.
Sources: artifacts/api-server/src/routes/anthropic/systemPrompt.ts:1-25, attached_assets/Pasted-The-goal-of-the-application-is-to-give-caregivers-patie_1773692362618.txt
Voice Exchange Data Flow
The backend handles voice-specific interactions through a dedicated voice-exchange endpoint. This allows the mobile client to sync transcripts of spoken dialogue between the user and the assistant directly into the conversation history.
The diagram above illustrates the synchronous recording of voice-based interactions to maintain session continuity and cross-session memory.
Sources: artifacts/api-server/src/routes/anthropic/index.ts:182-228
Multimodal Interfacing Requirements
To support diverse user needs, the system is required to provide guidance in multiple communication formats beyond text.
| Format | Description | Implementation Goal |
|---|---|---|
| Audio Narration | Spoken versions of guidance content | Support for visually impaired or overwhelmed users |
| Natural Language | Support for "panic language" searches | Handles terms like "gasping" or "I think they died" |
| SBAR Scripts | Structured verbal reporting scripts | Helps caregivers communicate with clinical staff |
| Visual Step Cards | Diagrams and images | Complements audio/voice instructions |
Sources: attached_assets/Pasted-The-goal-of-the-application-is-to-give-caregivers-patie_1773648532398.txt, replit.md
Intelligence Integration & Voice Reporting
The "Intelligence Engine" processes incoming text (often derived from voice transcripts) to generate a ResponsePlan. This plan dictates the tone and structure of the assistant's voice response based on detected urgency.
SBAR Call Scripts
One unique voice-related feature is the generation of SBAR (Situation, Background, Assessment, Recommendation) scripts. These are designed for the caregiver to read aloud over the phone to a hospice nurse, ensuring critical information is communicated in a professional clinical format.
The flowchart shows how disparate data points are aggregated into a single verbal report for the caregiver.
Sources: artifacts/api-server/src/routes/anthropic/systemPrompt.ts:650-685, artifacts/api-server/src/intelligence/hospice/planner.ts:1-50
Accessibility & Safety
The voice interface is governed by strict safety rules. While the AI provides comprehensive education on medications and symptoms, it is prohibited from generating specific dosing instructions or overriding verified clinical orders. In critical scenarios (e.g., active choking), the system is instructed to lead immediately with a verbal command to call 911.
Sources: attached_assets/Pasted-The-goal-of-the-application-is-to-give-caregivers-patie_1773692362618.txt, artifacts/api-server/src/routes/anthropic/systemPrompt.ts:700-720
The integration of voice capabilities ensures that Hospice Roadmap remains a high-touch, emotionally resonant platform, providing a "vocal anchor" for families navigating end-of-life care.