Home / Companies / Deepgram / Blog / Post Details
Content Deep Dive

How to Build a Virtual Medical Scribe in Python Using Deepgram and OpenAI

Blog post from Deepgram

Post Details
Company
Date Published
Author
Eteimorde Youdiowei
Word Count
3,546
Company Posts That Month
9
Language
English
Hacker News Points
-
Post removed?
No
Summary

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.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Real-time 29 5,293 1,296 267 +26%
LLM 10 4,627 710 226 -2%
Use This Data

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.