AI ultrasound report case study. Problem: an ultrasound clinic's doctor spent longer typing reports than scanning, and generic AI tools invented measurements and used the wrong terms. What we did: built Sono AI, a web app that transcribes a short dictation with Whisper, retrieves the doctor's own past reports with pgvector (RAG for style), writes the report with Gemini or GPT, and formats it with deterministic code. Result: a print-ready report in about 20 seconds that reads like the doctor's own, with consistent formatting and very low running cost. Stack: JavaScript, OpenAI Whisper and embeddings, Google Gemini, GPT-4.1 mini, Supabase (Postgres + pgvector), Netlify.
- Client
- THE Ultrasound Clinic
- Industry
- Healthcare (diagnostic imaging)
- Location
- Pakistan
- Services
- AI automation, web app development
- Role
- Product design, full-stack development, AI integration
- Stack
- HTML, CSS, JavaScript, Google Gemini, OpenAI (Whisper, GPT-4.1 mini, embeddings), Supabase (Postgres + pgvector), Netlify
- Delivered by
- PlusTechnology
The challenge
A busy ultrasound clinic in a small town sees patient after patient all day. After every scan, the doctor had to type a full report: each organ, its measurements, its findings and a final impression. Typing took longer than the scan.
Off-the-shelf AI tools didn't help. Their reports were generic and textbook-like, sometimes invented measurements, and used words the doctor never uses (for example "stone" instead of his preferred "calculus"). He ended up rewriting the output, which saved no time.
The goal: the doctor speaks for a few seconds after a scan and gets a finished, print-ready report on the clinic letterhead that reads as if he wrote it himself.
What we built
Sono AI is a single-page web app that turns a short voice dictation into a complete, formatted ultrasound report in about 20 seconds.
- Dictate. The doctor records a short note in the browser, and OpenAI Whisper turns it into text.
- Remember. The app searches the doctor's own past reports in a Supabase vector database and retrieves the most similar ones.
- Write. Those reports go to the AI as style examples, so the new report uses the doctor's exact phrasing, organ order and terminology.
- Format. Code, not the AI, decides what is abnormal. Abnormal findings move to the top in bold, normal organs follow in the doctor's standard wording, and the Impression is a short list of bold bullet points.
- Print. One click produces a branded letterhead with patient details, findings, impression and signature.
Key engineering decisions
Retrieval (RAG) for style, not just facts
Most RAG systems retrieve facts. Sono retrieves voice. Each dictation is embedded and matched against the doctor's archive with an exact pgvector search, so the AI copies how this doctor describes each finding. Moving the similarity search from the browser into Postgres made it faster and correct as the archive grew.
Never trust the AI with formatting
Early versions asked the AI to bold abnormal lines and order findings, and it got this wrong often enough to matter. Now the AI writes plain text and deterministic code does the rest. A negation-aware classifier knows that "No hydronephrosis or calculus" is normal, even though it names two conditions. Formatting is recalculated live, so a typed edit gets exactly the same treatment as AI output.
Strict "don't invent" rules
The prompt forbids measurements, locations or findings that weren't dictated. Organs the doctor doesn't mention are reported as normal in his standard wording. In a medical report, a confident wrong number is worse than a missing one.
A fallback chain that never leaves the doctor waiting
The clinic runs mostly on free AI tiers, which hit daily limits and "high demand" errors. Report generation tries Gemini 2.5 Flash → Gemini Flash-Lite → GPT-4.1 mini in order, with a 45-second timeout each. When a backup model writes the report, a small notice tells the doctor which one, so he can review it accordingly.
Built for the real environment
- One HTML file with no build step: easy to deploy on Netlify and maintain without a dev team.
- Works on a clinic desktop with unreliable internet, with clear progress messages instead of a frozen screen.
- Report history with search, filters and one-click reprints.
Results
- Reporting time: from several minutes of typing to a few seconds of speech plus a quick review.
- Reports read like the doctor's own, using his terms, organ order and phrasing.
- Consistent formatting every time: abnormal findings always on top and bold, with a clean bulleted Impression.
- Very low running cost: most reports are written on free AI tiers, and paid backups cost a fraction of a cent per report.
- No more stuck screens: if one AI provider is down or rate-limited, the next one takes over automatically.
What we learned
- Let AI write, let code decide. Anything that must be correct every time belongs in deterministic code, not a prompt.
- Medical language is mostly negation. "No X, Y or Z" is how radiology says normal, and any logic has to understand that first.
- Personal style beats general quality. A doctor trusts a report that sounds like him far more than one that is merely correct.
- Design for failure. With free tiers, errors happen daily, so the fallback path needs as much care as the main path.
What's next
- Importing the clinic's older Word-document reports to enrich style matching.
- More ultrasound types (obstetric, pelvic, thyroid) with templates in the doctor's style.
- Per-report cost tracking inside the app.


AI ultrasound report FAQ
How does an AI ultrasound report generator work?
Sono AI turns a short voice dictation into text with Whisper, retrieves the doctor's most similar past reports as style examples, has Gemini or GPT write the AI ultrasound report, then formats it with deterministic code.
Can AI write medical reports in a specific doctor's style?
Yes. Sono AI retrieves the doctor's most similar past reports from a vector database and gives them to the model as style examples, so new reports use his exact phrasing, organ order and terminology.
How do you stop an AI from inventing medical findings?
The prompt forbids any measurement, location or finding that wasn't dictated, and deterministic code, not the AI, decides which findings are abnormal and how the report is ordered and formatted.
What happens if the AI service is down or rate-limited?
Report generation falls back automatically from Gemini 2.5 Flash to Gemini Flash-Lite to GPT-4.1 mini, each with a 45-second timeout, and tells the doctor which model wrote the report.
How much does an AI report generator cost to run?
Very little. Most reports are written on free AI tiers, and paid backup models cost a small fraction of a cent per report.
Related reading
- Our AI Automation services
- 7 AI automation workflows for small businesses
- How much does a web app cost?
Want something similar for your business? Hire PlusTechnology on Upwork or get in touch.
