How to Build a Virtual Medical Scribe in Python Using Deepgram and OpenAI
Blog post from Deepgram
An AI medical scribe can reduce clinicians’ documentation burden by combining Deepgram’s Nova-3 Medical speech-to-text model with OpenAI’s GPT-4.1 to convert doctor-patient conversations into structured SOAP notes for electronic health records. The tutorial explains why medical-specialized transcription and speaker diarization are important for accurately capturing clinical terminology and distinguishing participants, then demonstrates two implementation approaches in Python: processing prerecorded audio files through Deepgram’s API and streaming microphone audio live through Deepgram’s WebSocket endpoint. In both workflows, the transcript is sent to an LLM using a strict prompt that organizes available information into Subjective, Objective, Assessment, and Plan sections while avoiding unsupported assumptions. The prerecorded system reads an audio file, transcribes it, and writes a generated note to disk, while the real-time version uses PyAudio, asynchronous queues, and WebSockets to collect live speech, display finalized transcript segments, and create a SOAP note when recording ends. The article presents these tools as a way to let physicians concentrate more fully on patient interaction, while noting implementation details, required API keys, dependencies, sample testing methods, and a linked code repository.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.