AI SystemsStatus: Hackathon Prototype (Proof of Concept)Timeline: 2024

Klinik — AI Healthcare Voice Assistant

Voice-driven patient intake & triage agent prototype built for medical hackathons

Source Code Repository✓ Demonstrated functional real-time speech triage in hackathon live evaluations.
TECHNOLOGY STACK
FastAPILangGraphPythonOpenAI Whisper / LLM APIsWebSocketsPydantic
SYSTEM DESIGN & RUNTIME SIMULATION

Interactive Architecture & Pipeline Inspector

INTERACTIVE SYSTEM ARCHITECTURE STUDIO

Klinik Voice Intake & Triage Pipeline

Real-time stateful voice agent architecture with deterministic clinical triage routing

PATTERN: Async WebSockets + LangGraph State Machine
Sub-850ms audio-to-triage turnaround with zero hallucinated diagnoses
SYSTEM EXECUTION PIPELINE (TAP ANY NODE TO INSPECT)
STEP 0118ms

Audio Ingest Stream

Client Microphone Feed
WebSocket / 16kHz PCM
STEP 02240ms

Speech-to-Text Pipeline

Whisper Transcription Core
gRPC Streaming
STEP 03320ms

LangGraph State Machine

Clinical Decision Graph
Python / Async Graph Loop
STEP 048ms

Pydantic Schema Guard

Deterministic Validation
Zod / Pydantic V2
STEP 0565ms

EMR & Dispatch Gateway

Clinical Record Persistence
HTTPS / REST FHIR
STEP 01 OF 05WebSocket / 16kHz PCM

Audio Ingest Stream

Role: Client Microphone Feed
ARCHITECTURAL ROLE & BEHAVIOR

Captures spoken patient audio chunks in real-time over bi-directional duplex WebSockets with voice activity detection (VAD).

ESTIMATED LATENCY: 18msTRANSPORT: WebSocket / 16kHz PCM
THE CORE PROBLEM

Patient intake during high-pressure emergency or clinic admissions is often bottlenecked by manual paperwork and fragmented transcription, delaying critical triage information.

WHAT I BUILT & DELIVERED

Engineered an interactive conversational voice assistant agent that captures spoken symptom descriptions, extracts structured clinical observations, and routes them through a stateful LangGraph workflow.

MY SPECIFIC ROLE & CONTRIBUTION

Designed the backend architecture in FastAPI, implemented the LangGraph state machine for multi-step clinical dialogue verification, and established structured Pydantic schema validation for patient data extraction.

Architectural Breakdown

  • 1FastAPI WebSockets layer handling real-time audio chunk ingestion and client streaming
  • 2LangGraph state machine coordinating intent classification, triage inquiry branching, and fallback safety guards
  • 3Strict Pydantic response modeling ensuring output conforms to medical intake record formatting
  • 4Safety guardrail node rejecting medical diagnoses and enforcing referral to licensed professionals

Key Engineering Decisions & Rationale

LangGraph over linear chains

Intake conversations are inherently non-linear; patients re-clarify symptoms, backtrack, or mention multiple ailments simultaneously. Graph-based state transitions allowed conditional routing without brittle prompt chains.

FastAPI with async WebSockets

Minimizing audio latency is paramount for conversational voice. Async event-driven handling delivered sub-second turn-taking responsiveness.

Challenges & Trade-offs

  • •Prioritized transcription fidelity and low latency over running edge models locally, using hosted speech-to-text APIs with strict data sanitization filters.
  • •Framed explicitly as an administrative intake assistant prototype rather than a diagnostic tool to avoid clinical liability and hallucination risks.

What I Learned

  • ✓Stateful agent loops need deterministic interrupt handlers when users correct previously stated information.
  • ✓Latency budgets must be budgeted strictly across speech-to-text, LLM inference, and text-to-speech synthesis.

Interested in similar architecture for your team?

Let's evaluate your current requirements and engineering constraints.

Discuss This System on WhatsApp