> ## 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.

# Conversation context

> Improve multi-turn transcription accuracy by passing prior dialogue with each request.

The `conversation_context` field lets you supply dialogue that preceded the audio provided in the current request. It gives the model continuity across a multi-turn conversation (for example, a human speaking with a voice agent) to boost transcription accuracy, while still transcribing only the current turn.

Include turns from either side of the conversation as separate list items in chronological order (oldest first, most recent last), where a single string is treated as one turn.

* Value: an array of strings (one per turn) or a single string (treated as one turn)
* Maximum: **100 turns / 4096 characters total** — context over either cap is trimmed, not rejected
* If the context exceeds a cap or the model's context window, the oldest turns (those at the start of the list) are dropped first
* Entries carry no speaker labels — include the agent's replies and the caller's utterances as separate entries

The example below passes the three previous turns of the conversation, where the current audio being transcribed is the caller responding with their order number.

<Tabs>
  <Tab title="Python" language="python">
    ```python theme={null}
    import json
    import requests

    with open("sample.wav", "rb") as f:
        audio = f.read()

    config = {
        "conversation_context": [
            "Hi, thank you for calling. How can I help?",
            "I'd like to check on the status of my order.",
            "Got it. Do you know your order ID number?",
        ],
    }

    response = requests.post(
        "https://sync.assemblyai.com/transcribe",
        headers={
            "Authorization": "<YOUR_API_KEY>",
            "X-AAI-Model": "universal-3-5-pro",
        },
        files={
            "audio": ("sample.wav", audio, "audio/wav"),
            "config": (None, json.dumps(config), "application/json"),
        },
        timeout=60,
    )
    response.raise_for_status()
    print(response.json()["text"])
    ```
  </Tab>

  <Tab title="Python SDK" language="python-sdk">
    ```python theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"

    config = aai.SyncTranscriptionConfig(
        conversation_context=[
            "Hi, thank you for calling. How can I help?",
            "I'd like to check on the status of my order.",
            "Got it. Do you know your order ID number?",
        ],
    )

    result = aai.SyncTranscriber().transcribe("sample.wav", config=config)
    print(result.text)
    ```
  </Tab>

  <Tab title="JavaScript" language="javascript">
    ```javascript theme={null}
    import { readFileSync } from "fs";

    const audio = readFileSync("sample.wav");
    const config = {
      conversation_context: [
        "Hi, thank you for calling. How can I help?",
        "I'd like to check on the status of my order.",
        "Got it. Do you know your order ID number?",
      ],
    };

    const form = new FormData();
    form.append("audio", new Blob([audio], { type: "audio/wav" }), "sample.wav");
    form.append(
      "config",
      new Blob([JSON.stringify(config)], { type: "application/json" })
    );

    const response = await fetch("https://sync.assemblyai.com/transcribe", {
      method: "POST",
      headers: {
        Authorization: "<YOUR_API_KEY>",
        "X-AAI-Model": "universal-3-5-pro",
      },
      body: form,
    });

    const result = await response.json();
    console.log(result.text);
    ```
  </Tab>

  <Tab title="cURL" language="bash">
    ```bash theme={null}
    curl -X POST https://sync.assemblyai.com/transcribe \
      -H 'Authorization: <YOUR_API_KEY>' \
      -H 'X-AAI-Model: universal-3-5-pro' \
      -F 'audio=@sample.wav;type=audio/wav' \
      -F 'config={"conversation_context":["Hi, thank you for calling. How can I help?","I'"'"'d like to check on the status of my order.","Got it. Do you know your order ID number?"]};type=application/json'
    ```
  </Tab>
</Tabs>

## Combining with other features

`conversation_context` composes with [prompting and keyterms](/sync-stt/prompting-and-keyterms) in the same `config` part — describe the call with `prompt`, list explicit vocabulary with `keyterms_prompt`, and pass the preceding dialogue with `conversation_context`.

## Looking for streaming context?

For live audio, Real-time STT carries context across turns automatically within a session, and voice agents can interleave their replies with the `agent_context` parameter. See [Context carryover (Real-time)](/streaming/universal-3-pro/context-carryover).
