Project 03
Scribe
An AI medical scribe that turns a spoken consultation into a structured clinical note — then checks its own work.
Scribe captures a consultation from the browser microphone, transcribes it with OpenAI Whisper, and turns the transcript into a structured clinical note using templates parsed from a clinician's own export. Pick a template, record, stop, review the transcript, and generate the note.
Because a clinical note that invents facts is worse than none, a second verification pass checks every claim in the generated note against the transcript — an anti-hallucination guard built into the workflow, not bolted on after.
01 · How it works
Transcribe, generate, verify.
mic (browser) ──▶ /api/transcribe ──▶ Whisper ──▶ transcript
transcript + template ──▶ /api/note ──▶ chat model ──▶ clinical note
│
/api/verify ──▶ fact-check each claim vs transcript
Templates are structured on the fly: scripts/parseTemplates.js parses a
garbled EMIS-style export into clean templates.json. The note prompt is built
to resist hallucination, and /api/scribe runs transcribe → generate → verify
in a single call.
02 · Features
What it does.
-
Mic-to-note in the browser
In-browser
MediaRecordercapture, a 25 MB Whisper upload cap, and a review step before anything is generated. -
Template-driven structure
Notes follow real clinical templates — history, examination, assessment and plan — parsed from the clinician's own export into clean JSON.
-
Verification pass
Every claim in the note is checked against the transcript in a second pass, so the output is grounded in what was actually said.
-
One-call pipeline
/api/scribetakes audio plus a template ID and returns transcript, note, and verification together.
03 · Stack
Built with.
| Backend | Node.js · Express API + static UI (server.js) |
|---|---|
| Transcription | OpenAI Whisper (lib/transcribe.js) |
| Note gen | Chat model, anti-hallucination prompt (lib/generateNote.js) |
| Verify | Claim-by-claim fact-check (lib/verifyNote.js) |
| Templates | Parsed from export → templates.json |
| Frontend | Browser UI with MediaRecorder mic capture |