Twofold
AI clinical documentation platform
Built the speech recognition and diarization pipeline, LLM fact extraction and note generation, GPU model serving and evaluation harness behind Twofold, which turns clinical conversations into structured, reviewable notes.
Twofold: AI clinical documentation for clinicians
30–90 s
Draft note after a 50-minute session
95–99%
Medication details exactly right
80–92%
Drafts approved with small or no edits
6–10%
Word error rate on clinical role-play sessions
Stack
Overview
Twofold is an AI-assisted clinical documentation platform for physicians, therapists and behavioral-health teams. A clinician records a consultation, dictates a summary or types rough notes, and Twofold turns it into an editable clinical note, which the clinician reviews and approves before copying it into the EHR.
The central idea: automate documentation work, not clinical responsibility.
The problem
After each encounter, the clinician must turn the conversation into a structured, accurate record, often after working hours, and speech-to-text tools produce a transcript, not a clinical note.
- Reconstruction from memory: rebuilding the conversation and separating patient-reported information from clinician observations.
- Clinical detail: identifying symptoms, relevant negatives, medications, interventions and follow-up actions.
- Format and re-entry: organizing information into the clinic's note format and repeating it across EHR fields.
My role
I worked on Twofold as an AI engineer, across the speech and LLM pipeline, model serving and evaluation. I built the Python AI service with its speech recognition, diarization, fact extraction and note generation stages, the GPU serving for the self-hosted models, and the AI engineering lifecycle that gates every model and prompt change.
What I built
Speech and AI pipeline
- A FastAPI AI service with in-memory audio intake, Whisper large-v3 on faster-whisper with encounter-level vocabulary prompting, pyannote.audio diarization and post-ASR medical-term checking.
- Clinical fact extraction and note generation on Azure OpenAI with a template-derived JSON schema, using context from previous notes and the treatment plan retrieved with BGE-M3 embeddings.
- Claim-level grounding validation that flags unsupported statements in the editor, plus Azure AI Content Safety Prompt Shields on Ask AI input.
Model serving and AI lifecycle
- AKS with KServe for the self-hosted models: an A10 GPU node pool for speech and diarization, and CPU nodes for embeddings.
- An evaluation harness on synthetic and clinician role-play sessions (word error rate, clinical-term WER, diarization error rate, note quality, grounding) that gates every model or prompt change.
Results
Speech, speaker, medication, risk-statement and grounding figures come from evaluation sets of synthetic and clinician role-play sessions (no patient data); speed and approval figures come from production metrics.
- Speech recognition: 6–10% word error rate on clinical role-play sessions recorded in the office, over telehealth and by phone (Whisper large-v3 with encounter-level vocabulary prompting).
- Medical terms: encounter-level vocabulary prompting and post-ASR term checking cut clinical-term errors by 25–40%.
- Speaker attribution: 8–12% diarization error rate on two-speaker sessions.
- Medications: 95–99% of medication details (drug, dose, route, frequency, unit) exactly right.
- Risk statements: 98–100% of statements about self-harm, harm to others or substance use reached the note accurately and with the right speaker.
- Grounding: 0.5–2% of note statements had no supporting source, and every one was flagged in the editor.
- Draft speed: the draft note was ready 30–90 seconds after a 50-minute session ended.
- Clinician approval: 80–92% of drafts were approved with small edits or none.
Tech stack
| Layer | Technologies |
|---|---|
| Frontend | React, Vite, TypeScript, Tailwind CSS, shadcn/ui, TanStack Query, Zustand, Tiptap |
| Mobile | SwiftUI, AVFoundation, Jetpack Compose, Kotlin coroutines, WorkManager |
| Backend | .NET / C#, ASP.NET Core, Entity Framework Core, OpenAPI, Azure Service Bus |
| AI | Python, FastAPI, faster-whisper (Whisper large-v3), pyannote.audio, Silero VAD, Azure OpenAI, Semantic Kernel, BGE-M3, Azure AI Content Safety, MLflow |
| Data | Azure Database for PostgreSQL, pgvector, Azure Cache for Redis, Azure Blob Storage, Azure Key Vault |
| Infrastructure | Azure Container Apps, AKS, KServe, KEDA, Azure Front Door, Bicep, Azure DevOps Pipelines, Application Insights |
Related case studies


