> ## Documentation Index
> Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Medical Mode

Medical Mode is an add-on that enhances streaming transcription accuracy for medication names, including both generic and brand-name medications. It corrects medication names that other models frequently get wrong.

Medical Mode can be used with all of our Real-time STT models.

Enable Medical Mode by setting the `domain` connection parameter to `"medical-v1"`. No other changes to your existing pipeline are required.

## Quickstart

Set `domain` to `"medical-v1"` as a connection parameter when you open the WebSocket.

> [tab] Python
>
> ```python theme={null}
> CONNECTION_PARAMS = {
>     "sample_rate": 16000,
>     "speech_model": "assemblyai-stt-3-7-realtime-agent",
>     "domain": "medical-v1",
> }
> ```

> [tab] Python SDK
>
> ```python theme={null}
> client.connect(
>     RealTimeParameters(
>         sample_rate=16000,
>         speech_model="assemblyai-stt-3-7-realtime-agent",
>         domain="medical-v1",
>     )
> )
> ```

> [tab] Javascript
>
> ```javascript theme={null}
> const CONNECTION_PARAMS = {
>   sample_rate: 16000,
>   speech_model: "assemblyai-stt-3-7-realtime-agent",
>   domain: "medical-v1",
> };
> ```

> [tab] JavaScript SDK
>
> ```javascript theme={null}
> const transcriber = client.streaming.transcriber({
>   sampleRate: 16_000,
>   speechModel: "assemblyai-stt-3-7-realtime-agent",
>   domain: "medical-v1",
> });
> ```

<audio controls>
  <source src="https://assemblyaiassets.com/56e2be1c-lispro.mp3" type="audio/mpeg" />

  Your browser does not support the audio element. [Download the audio](https://assemblyaiassets.com/56e2be1c-lispro.mp3).
</audio>

### Example output

Without Medical Mode:

```plain theme={null}
I have here insulin to be used for both prandial mealtime and sliding scale is
insulin lisprohumalog subcutaneously.
```

With Medical Mode, lisprohumalog is updated to Lispro (Humalog) - following the standard medical convention of writing the generic name first, with the brand name in parentheses.

```plain theme={null}
I have here insulin to be used for both prandial mealtime and sliding scale is
insulin Lispro (Humalog) subcutaneously.
```

## Use cases

Medical Mode is designed for healthcare AI applications where accurate medication names are critical:

* **Ambient clinical documentation** — Capture generic and brand-name medication names correctly during live patient encounters.
* **Real-time medical scribes** — Deliver accurate transcripts to clinicians during or immediately after a consult.
* **Front-office voice agents** — Capture medication names correctly in scheduling calls and insurance verification.
* **Medical contact centers** — Transcribe calls with correct medication names for downstream processing and quality assurance.

## Combine with other features

Medical Mode works alongside other streaming features. You can combine it with:

* [Streaming Diarization](https://assemblyai.com/docs/streaming/label-speakers-and-separate-channels.md) to identify who said what in clinical conversations
* [Keyterms Prompting](https://assemblyai.com/docs/streaming/prompting-and-keyterms.md) to further boost accuracy for specific medical terms unique to your use case

> [tab] Python
>
> ```python theme={null}
> CONNECTION_PARAMS = {
>     "sample_rate": 16000,
>     "speech_model": "assemblyai-stt-3-7-realtime-agent",
>     "domain": "medical-v1",
>     "speaker_labels": "true",
>     "keyterms_prompt": json.dumps(["Lisinopril", "Metformin", "Humalog"])
> }
> ```

> [tab] Python SDK
>
> ```python theme={null}
> client.connect(
>     RealTimeParameters(
>         sample_rate=16000,
>         speech_model="assemblyai-stt-3-7-realtime-agent",
>         domain="medical-v1",
>         speaker_labels=True,
>         keyterms_prompt=["Lisinopril", "Metformin", "Humalog"],
>     )
> )
> ```

> [tab] Javascript
>
> ```javascript theme={null}
> const CONNECTION_PARAMS = {
>   sample_rate: 16000,
>   speech_model: "assemblyai-stt-3-7-realtime-agent",
>   domain: "medical-v1",
>   speaker_labels: true,
>   keyterms_prompt: JSON.stringify(["Lisinopril", "Metformin", "Humalog"]),
> };
> ```

> [tab] JavaScript SDK
>
> ```javascript theme={null}
> const transcriber = client.streaming.transcriber({
>   sampleRate: 16_000,
>   speechModel: "assemblyai-stt-3-7-realtime-agent",
>   domain: "medical-v1",
>   speakerLabels: true,
>   keytermsPrompt: ["Lisinopril", "Metformin", "Humalog"],
> });
> ```

## Configuration for medical audio

Medical conversations — such as clinical dictation, patient encounters, and ambient scribes — have different speech patterns than typical voice agent interactions. Clinicians often pause mid-sentence to think, review a chart, or formulate a diagnosis. The default turn detection settings are optimized for fast-paced voice agent dialogues and can incorrectly fragment these natural pauses into separate turns.

To prevent premature turn boundaries in medical audio, increase the silence thresholds:

```javascript theme={null}
const streamingConfig = {
  min_turn_silence: 800,
  max_turn_silence: 3600,
};
```

| Parameter | Default | Recommended for Medical | Why |
| - | - | - | - |
| `min_turn_silence` | Set by `mode`: `128` ms (`min_latency`, `balanced`), `512` ms (`max_accuracy`) | `800` ms | Gives clinicians time to pause mid-sentence without triggering a speculative end-of-turn check. |
| `max_turn_silence` | Set by `mode`: `640` / `1280` / `2560` ms (`min_latency` / `balanced` / `max_accuracy`) | `3600` ms | Allows extended pauses for chart review or thinking without forcing a turn boundary. |

> [!NOTE]
>
> These values are a conservative starting point. See [Turn detection](https://assemblyai.com/docs/streaming/turn-detection.md) for how these parameters work. You can further adjust them based on your specific workflow — for example, a real-time medical scribe may benefit from a lower `max_turn_silence` (around `2000` ms) than a dictation application.

> [tab] Python
>
> ```python theme={null}
> CONNECTION_PARAMS = {
>     "sample_rate": 16000,
>     "speech_model": "assemblyai-stt-3-7-realtime-agent",
>     "domain": "medical-v1",
>     "min_turn_silence": 800,
>     "max_turn_silence": 3600,
> }
> ```

> [tab] Python SDK
>
> ```python theme={null}
> client.connect(
>     RealTimeParameters(
>         sample_rate=16000,
>         speech_model="assemblyai-stt-3-7-realtime-agent",
>         domain="medical-v1",
>         min_turn_silence=800,
>         max_turn_silence=3600,
>     )
> )
> ```

> [tab] Javascript
>
> ```javascript theme={null}
> const CONNECTION_PARAMS = {
>   sample_rate: 16000,
>   speech_model: "assemblyai-stt-3-7-realtime-agent",
>   domain: "medical-v1",
>   min_turn_silence: 800,
>   max_turn_silence: 3600,
> };
> ```

> [tab] JavaScript SDK
>
> ```javascript theme={null}
> const transcriber = client.streaming.transcriber({
>   sampleRate: 16_000,
>   speechModel: "assemblyai-stt-3-7-realtime-agent",
>   domain: "medical-v1",
>   minTurnSilence: 800,
>   maxTurnSilence: 3600,
> });
> ```

## HIPAA compliance

AssemblyAI offers a Business Associate Agreement (BAA) for customers who need to process Protected Health Information (PHI). AssemblyAI is SOC 2 Type 2, ISO 27001:2022, and PCI DSS v4.0 certified. Medical Mode does not change existing data handling or retention policies.

Paid customers can review and sign our standard online BAA self-serve, at no additional cost, from the [**Data Controls** page](https://www.assemblyai.com/dashboard/settings/data-controls) in the dashboard. You must have an upgraded (paid) account to see the BAA option. See [Data Controls](https://assemblyai.com/docs/data-controls.md#business-associate-agreement-baa) for details, or [contact sales](https://www.assemblyai.com/contact/sales) for enterprise pricing.
