Klinik — AI Healthcare Voice Assistant
Voice-driven patient intake & triage agent prototype built for medical hackathons
Interactive Architecture & Pipeline Inspector
Klinik Voice Intake & Triage Pipeline
Real-time stateful voice agent architecture with deterministic clinical triage routing
Audio Ingest Stream
Role: Client Microphone FeedCaptures spoken patient audio chunks in real-time over bi-directional duplex WebSockets with voice activity detection (VAD).
Patient intake during high-pressure emergency or clinic admissions is often bottlenecked by manual paperwork and fragmented transcription, delaying critical triage information.
Engineered an interactive conversational voice assistant agent that captures spoken symptom descriptions, extracts structured clinical observations, and routes them through a stateful LangGraph workflow.
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.