Workplace Conduct TrainingReal-time voice · STT → LLM → TTSworkplace.carecollaborative.cloud

Workplace Conduct Training Architecture

End to end

User Lifecycle — Workplace Conduct Training

Every internal route, protocol, and service boundary for this use case. Phases 1–3 and 7 are shared platform infrastructure; the middle phases are specific to this use case.

Phase 1
All Use Cases

Discovery & Frontend Delivery

User BrowserCloudflare DNSDNS over HTTPS

Domain resolves via Cloudflare DNS with DDoS protection and geo-routing to nearest edge PoP

Cloudflare CDNCloudflare PagesHTTPS · TLS 1.3

Static Next.js/React frontend served from Cloudflare Pages at the edge — zero origin round-trip for assets

Cloudflare PagesUser BrowserHTTP/3 · Brotli

Compressed SPA bundle delivered to browser with service worker caching for offline resilience

Phase 2
All Use Cases

Authentication & SSO

BrowserRuntime APIHTTPS · TLS 1.3

Frontend initiates auth flow → Cloudflare LB routes to Runtime API Server on Operator-managed VM

Runtime APIIdentity ProviderOAuth2 / OIDC / SAML

Runtime redirects to configured IdP (Auth0, Azure AD, Okta) for SSO authentication

Identity ProviderRuntime APIOAuth2 Callback

IdP returns authorization code → Runtime exchanges for tokens, creates session, assigns RBAC roles via OPA/Rego

Runtime APIPostgreSQLTLS · Private Link

Session token and user profile persisted to main PostgreSQL database on Azure Flexible Server

Phase 3
All Use Cases

Workspace & Agent Provisioning

BrowserRuntime APIREST · WebSocket

User creates or joins a workspace → API Server validates RBAC permissions and initiates provisioning

Runtime APITemporal ServergRPC · Internal

API starts a Temporal workflow in the org-specific namespace for durable execution with per-org isolation

Temporal ServerWorker PoolActivity Dispatch

Temporal schedules activities on available workers — agent environment provisioned with SSH, process management, health checks

WorkerTemporal DBHeartbeat · TLS

Worker sends heartbeat signals to Temporal. On failure, Temporal retries on next available worker — zero data loss

Phase 4B
Workplace Conduct

Real-Time Workplace Conduct Training

BrowserRuntime APIREST

Trainee selects a workplace scenario (e.g., conduct review, performance feedback, conflict resolution) → API generates WebRTC room token

BrowserWebRTC ServerWebSocket · ICE

WebRTC connection established. AI persona agent joins room via Temporal with scenario-specific character and emotional dynamics

Trainee VoiceSTT ProviderWebRTC → HTTPS

Audio stream sent to configured STT provider for real-time transcription (provider agnostic)

STT OutputAI Governance → LLMHTTPS · MITM

Transcription routed through AI Governance proxy, then to configured LLM for persona response with scenario context

LLM ResponseTTS → WebRTC RoomHTTPS · Streaming

LLM response streamed to TTS provider for voice synthesis. AI persona voice returned to trainee via WebRTC room

Phase 5B
Workplace Conduct

Workplace Conduct Assessment

Session EndTranscript CaptureInternal

Full conversation transcript collected from WebRTC room transcription segments with speaker attribution

TranscriptAI Governance → LLMHTTPS · TLS 1.3

Transcript + scenario context sent to LLM via governance proxy. Assessment uses the grading framework selected by the organization (configurable template)

LLMGrading EngineJSON Response

LLM evaluates competencies defined in the chosen grading template — framework, competency areas, and scoring criteria are all template-driven

Grading EngineResults DisplayInternal

Each competency scored per template criteria with evidence quotes. Overall score and actionable feedback presented to the participant

Phase 7
All Use Cases

Data Persistence & Audit

Runtime APIPostgreSQL (Main)TLS · SQLC

User data, workspace state, agent config, AI budgets, and RBAC roles stored in the main database

Temporal ServerPostgreSQL (Temporal)TLS · Internal

Workflow execution history, activity state, and timer schedules persisted for durable replay

Temporal ServerPostgreSQL (Visibility)TLS · Internal

Search indices for workflow discovery — enables querying by status, type, org, and custom attributes

Runtime APIAudit LogsAppend-Only

Every user action logged to immutable cryptographic audit chain — tamper-evident, full retention

All ServicesPrometheus + OTelMetrics · Traces

Prometheus scrapes metrics from all Runtime instances. OpenTelemetry traces span across API, Temporal, and worker boundaries

Workplace Conduct Training — Capability Summary

Internal Services
API Server (REST / DRPC / WS)
Temporal (durable orchestration)
Embedded WebRTC media server
AI Governance (MITM proxy)
Grading Engine (template-driven)
External Services (Agnostic)
Cloudflare (CDN / LB / Pages)
Identity Providers (SSO)
STT Providers (pluggable)
LLM Providers (pluggable)
TTS Providers (pluggable)