TL;DR — Architecture & Impact Summary
- Client: Multi-Clinic Healthcare SaaS Provider (US Health Systems & Clinic Networks)
- Core Stack: Self-Hosted Asterisk (SIP URI), Custom LiveKit Multi-Agent Framework, Node.js Workflow Engine, React, AWS RDS (PostgreSQL) & AWS S3
- Compliance & Security: 100% Self-Hosted VPC, Zero Third-Party Wrapper Data Retention, HIPAA and SOC 2 Type II Ready
- Throughput & Scale: 5,000+ daily automated voice interactions and asynchronous chat workflows
- Latency Benchmark: Reduced outbound pickup-to-speech latency from greater than 2,000ms down to less than 150ms using split-leg SIP pre-warming
Executive Summary
A premier healthcare SaaS provider required an enterprise-grade conversational AI and workflow automation solution to expand its product portfolio for medical clinics and primary care networks. Moving beyond expensive per-minute wrapper APIs and black-box third-party AI clouds, the objective was to deploy a 100% self-hosted, scalable Voice AI, AI Chat Agent, and clinical workflow automation infrastructure.
To support both US clinics and multi-state SaaS expansion, the system was engineered to satisfy dual regulatory requirements—adhering to strict HIPAA and SOC 2 Type II compliance standards alongside state health-privacy law and US health system data governance. The platform needed to interface natively with legacy Electronic Health Record (EHR) and clinic management systems, handle high-volume daily call loads, trigger automated post-call SMS/chat workflows, and verify patient identities in real time.
In collaboration with Team Hexta, the client deployed a custom telephony, conversational AI, and workflow orchestration stack powered by Asterisk SIP URI routing and a tailored LiveKit multi-agent room architecture. Today, the production system processes over 5,000 calls daily, driving automated patient triage, omnichannel appointment management, real-time EHR updates, and seamless AI-to-human call transfers.
Key Objectives & System Requirements
- Multi-Tenant Telephony Scaling: Dynamic allocation of shared or isolated Asterisk instances based on individual clinic call volumes, tenant tiers, and capacity demands.
- Centralized SaaS Governance (HIPAA & SOC 2): Secure authentication, role-based access control (RBAC), and subscription management unified within the platform’s existing HIPAA and SOC 2 compliant identity framework—with zero Protected Health Information (PHI) leaked to external AI wrapper providers.
- Bi-Directional Legacy EHR Integration: Automated read/write data exchange with diverse legacy Electronic Health Record (EHR) and practice management systems via custom API and webhook workflow pipelines.
- EHR Database & Patient Validation: Real-time patient lookup and medical profile pre-fetching triggered dynamically by inbound and outbound caller IDs.
- Zero-Latency Telephony Orchestration: Elimination of the 2-second audio connection lag and ringing artifacts common in automated outbound SIP calling campaigns.
- Omnichannel AI Chat & Post-Call Workflow Automation: Seamless handoff from voice interactions to automated AI chat agents (SMS, WhatsApp, and Web Chat) for intake forms, booking confirmations, and follow-up care instructions.
Technical Architecture & Implementation
Team Hexta architected a modular, self-hosted Voice and Chat AI ecosystem that isolates telephony control, real-time WebRTC/SIP audio streaming, workflow automation logic, and encrypted database storage across dedicated AWS Virtual Private Clouds (VPCs).
Technical Stack Breakdown
| Component | Technology | Operational Function |
|---|---|---|
| Telephony Engine | Asterisk (Custom SIP URI) | Ground-up SIP URI routing, split-leg call control, dynamic AI-to-human warm/cold transfers |
| Voice & Multi-Agent Core | LiveKit (Self-Hosted Deployment) | Multi-agent room architecture allowing specialized child AI agents under a single phone line |
| Workflow & Chat Engine | Node.js & Custom Webhooks | Event-driven clinical workflow automation, omnichannel AI chat agent state, and EHR sync |
| Frontend SaaS Portal | React | Multi-tenant admin dashboard, clinic subscription controls, live call/chat monitoring |
| Database & PHI Storage | AWS RDS PostgreSQL & AWS S3 | Encrypted relational storage; isolated, HIPAA-compliant S3 buckets for call logs and transcripts |
How Does Multi-Agent Orchestration Work in LiveKit?
To manage complex, multi-step clinical workflows without robotic transitions, Team Hexta implemented a customized, self-hosted LiveKit deployment. The platform utilizes a multi-agent room architecture, enabling multiple specialized AI child agents (e.g., Triage Agent, Scheduling Agent, Billing/Insurance Agent) to co-exist within the same LiveKit session under a single clinic phone number.
Rather than relying on a single monolithic prompt that increases latency and hallucination risk, child agents trigger dynamically based on real-time conversation context, patient intent, and clinical triage rules—while maintaining shared session memory across voice and chat channels.
How Team Hexta Solved SIP Telephony Artifacts & Outbound Audio Latency
Standard SIP and Asterisk integrations frequently exhibit a 2-second ringing artifact or dead-air delay after a patient answers the phone before the AI voice engine begins speaking. This delay causes high call drop-off rates. Team Hexta solved this through a split-leg audio control and pre-warming mechanism:
- Independent Call Leg Initialization: Separate call legs are initialized simultaneously for the patient destination line and the LiveKit Voice AI engine.
- AI Model Pre-Warming: The voice AI session, LLM context, and pre-fetched EHR patient profile are loaded and pre-warmed while the outgoing SIP call is still ringing.
- Sub-150ms Instant Greeting: The exact millisecond the patient picks up, a real-time SIP event flag prompts the pre-warmed voice agent to speak immediately, delivering a natural, zero-delay human-like greeting.
Dynamic Call Routing, AI-to-Human Transfers & Workflow Triggers
Custom dynamic dial plans within Asterisk enable bi-directional live call transfers. When an AI triage agent detects an acute medical emergency or complex patient request, the system executes a warm transfer—passing the live audio stream along with a real-time AI-generated call summary directly to a clinic receptionist or triage nurse.
Simultaneously, the Node.js workflow engine triggers asynchronous post-call automations: updating the clinic’s EHR, tagging call dispositions, and dispatching an AI Chat Agent via SMS or WhatsApp to collect additional intake documentation or confirm appointment details.
Key Clinical & Operational Use Cases
The unified Voice AI, Chat Agent, and workflow stack powers both inbound and outbound healthcare operations across clinic networks:
- Automated Emergency Patient Triage: Intelligent symptom screening, clinical red-flag detection, and rapid prioritization of urgent inquiries with instant human escalation.
- Real-Time EHR Patient Verification: Instant identity verification and medical history pre-fetching during call initialization before the conversation begins.
- Omnichannel Smart Scheduling (Voice + AI Chat): Automated voice booking, rescheduling, and cancellation handling, paired with instant SMS/chat calendar links and automated reminders to slash clinic no-show rates.
- Post-Treatment Care & Medication Follow-Ups: Automated outbound voice and chat check-ins aligned with individualized treatment plans, logging patient recovery responses directly back into the EHR.
- Targeted Preventive Care Outreach: High-throughput outbound calling and messaging campaigns promoting covered wellness services (e.g., Medicare, Medicaid or insurance-covered dental and health screenings).
- Multilingual Conversational AI & Automated Disposition Tagging: Fluent patient interactions across multiple languages with automated clinical summarization, sentiment scoring, and structured EHR write-backs.
Project Outcomes & Business Impact
| Metric / Outcome | Production Benchmark |
|---|---|
| Daily Production Volume | 5,000+ calls and automated workflows per day processed reliably across multi-tenant clinic instances |
| Pickup-to-Speech Latency | Reduced from greater than 2,000ms to less than 150ms via split-leg Asterisk SIP pre-warming |
| Data Privacy & Compliance | 100% self-hosted data residency within HIPAA and SOC 2 compliant AWS infrastructure |
| Cost Efficiency vs. Wrappers | Eliminated per-minute third-party voice wrapper markups, improving SaaS gross margins at scale |
| Account Expansion | Deployment ROI led the client to contract Team Hexta for 2 additional Healthcare SaaS engineering initiatives |
Frequently Asked Questions
How can Healthcare SaaS providers deploy Voice AI and Chat Agents with full HIPAA and SOC 2 compliance?
Rather than relying on third-party AI wrapper APIs that retain Protected Health Information (PHI) on shared clouds, healthcare SaaS providers can deploy a 100% self-hosted stack inside isolated AWS Virtual Private Clouds (VPCs). By isolating Asterisk SIP control, LiveKit audio streaming, Node.js workflow engines, and encrypted AWS RDS/S3 storage within the client's existing HIPAA and SOC 2 Type II compliant authentication boundaries, organizations achieve zero third-party data retention and full data residency control.
How do Voice AI agents integrate with legacy EHR systems and post-call chat workflows?
During call initialization, the system performs real-time patient lookup and profile pre-fetching from legacy Electronic Health Record (EHR) databases using inbound or outbound caller IDs. During or after the call, an event-driven Node.js workflow engine executes bi-directional EHR write-backs, logs structured call dispositions, and dispatches omnichannel AI Chat Agents via SMS, WhatsApp, or Web Chat to handle appointment confirmations, intake forms, and post-treatment follow-ups.
Ready to Deploy Your Own Self-Hosted Healthcare Voice & Chat AI Stack?
Stop paying steep per-minute wrapper premiums or risking sensitive patient data (PHI) on third-party clouds. Whether you are a Healthcare SaaS founder looking to embed multi-tenant Voice & Chat AI into your product, or a Healthcare IT leader automating EHR workflows, Team Hexta builds production-grade infrastructure you fully own and control.
- 100% Self-Hosted in Your VPC (AWS, GCP, Azure, or On-Prem)
- HIPAA and SOC 2 Compliant Architecture
- Custom Asterisk SIP, LiveKit, Omnichannel Chat & EHR Workflow Integration
👉 Book a 30-Minute Technical Architecture Review with Team Hexta
