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

# How to design low-latency voice flows

[Back to how-to guides](https://koreai.mintlify.site/agent-platform/abl/how-to/overview.md#voice-and-realtime-conversations)

Use this pattern when callers wait too long between their last word and the agent's first word on a voice call. Cut the wait stage by stage: end-of-speech detection, the model call, tool calls, speech start, and the silence between them.

## Concept

A pipeline voice call (KoreVG) runs three steps for every turn: speech-to-text (STT), the agent, and text-to-speech (TTS). The caller hears nothing until TTS starts. Each step adds wait. You cannot remove all of it. Decide which waits to cut and which to cover with a filler.

| Stage | What happens | What you control |
| - | - | - |
| End of speech | The platform waits for a pause, then decides the caller finished. | Channel settings **Voice gateway turn detection** and STT endpointing. ABL: `turn_detection`, `END_OF_SPEECH_TURN_TYPE`, `END_OF_SPEECH_TIMEOUT_MS`. |
| Model call | The model reads the prompt and writes the reply. | `FLOW` steps with `REASONING: false`, `reasoning_effort`, `max_tokens`, `inline_gather`, prompt caching, short instructions, and the project **Voice low-latency profile**. |
| Tool call | The agent waits for a backend. | `cacheable`, `PARALLEL`, `tool_timeout`, and the tool `VOICE` reply policy. |
| Speech start | TTS turns the reply into audio. | Channel switch **Stream speech** and `STREAMING` for one output. |
| Silence cover | A short phrase plays while work runs. | `MESSAGES` `filler_*` keys and the project **Filler settings**. |

A scripted `FLOW` step (`REASONING: false`) with a fixed `RESPOND` needs no model call. It is the fastest path. Use a reasoning agent only where the caller's words need interpretation. See [How to choose between a reasoning agent and a FLOW-based agent](https://koreai.mintlify.site/agent-platform/abl/how-to/choose-reasoning-agent-or-flow).

### Pipeline voice and realtime voice

Realtime (speech-to-speech) calls have no separate STT or TTS stage. The provider owns turn detection and audio delivery. Most settings in this article apply to pipeline voice only.

| Setting | Pipeline voice | Realtime voice |
| - | - | - |
| Turn detection and end-of-speech hints | Apply. | Ignored. Use the provider's turn detection settings on the realtime channel, such as OpenAI **Server VAD** or **Semantic VAD**. |
| `STREAMING` and **Stream speech** | Apply. | Not used. |
| `REASONING: false` steps and `PARALLEL` | Apply. | Apply to agent execution. The provider adds its own speech time. Measure on a call. |
| `cacheable` | Applies. | Applies. |
| Fillers | Project **Filler settings** and `MESSAGES`. | Native hold phrases. Set them on the realtime channel. They need **Fillers** and **Voice fillers** on in the project. |
| Per-turn timings in Studio | STT, LLM, TTS, first audio, end to end. | End to end and interruptions only. |

Other articles cover turn-taking in depth ([How to handle barge-in, pauses, and unclear audio](https://koreai.mintlify.site/agent-platform/abl/how-to/handle-voice-turn-taking)) and writing short replies ([How to write voice-friendly agent responses](https://koreai.mintlify.site/agent-platform/abl/how-to/write-voice-friendly-responses)).

## Minimal working example

An agent looks up an order. It gathers the order number, reads the status, and covers the lookup with a filler.

`agents/order-status-voice.agent.abl`

```yaml theme={null}
AGENT: Order_Status_Voice

GOAL: "Ask for the order number, look it up with get_order_status, and tell the caller the status and delivery estimate."

PERSONA: "Calm phone agent. Short, direct answers."

EXECUTION:
  inline_gather: true
  llm_timeout: 8000
  tool_timeout: 5000
  voice:
    turn_detection:
      enabled: true
      eou_threshold: 0.5

GATHER:
  order_id:
    prompt: "What is your order number?"
    type: string
    required: true

TOOLS:
  get_order_status(order_id: string) -> {status: string, eta: string}
    description: "Look up the status and delivery estimate of an order"
    parameters:
      order_id:
        description: "The order number the caller gave"
    hints:
      cacheable: true
      side_effects: false
    cache_ttl_ms: 30000

MESSAGES:
  filler_tool_call: "One moment while I check that order."
  filler_general: "One moment, please."
```

Companion resources and variable sources:

* `get_order_status` is a project tool. Define a tool with this name and parameter in **Tools** and bind it to your order API.
* `order_id` is a `GATHER` field. The caller supplies it. The tool reads it as the `order_id` argument.
* The filler text is static. `MESSAGES` fillers do not support `{{ }}` placeholders.

What each setting does:

| Setting | Effect |
| - | - |
| `inline_gather: true` | Collects `GATHER` fields during the reasoning turn. It removes a separate model call for extraction. |
| `llm_timeout: 8000` | Stops waiting for the model after 8,000 ms. Unset, the wait is 120,000 ms. |
| `tool_timeout: 5000` | Stops waiting for a tool after 5,000 ms. Unset, the wait is 30,000 ms. A timeout set on the tool wins. |
| `turn_detection` | Lets the KoreVG gateway decide when the caller finished. `eou_threshold` runs from `0.3` (answers fastest) to `0.9` (waits longest). The default is `0.5`. |
| `cacheable: true` | Reuses the result of an identical call in the same conversation for `cache_ttl_ms`. Use it for read-only tools only. |
| `filler_tool_call` | Sets the phrase spoken while a tool call runs. `filler_general` covers any other wait. |

A short `llm_timeout` or `tool_timeout` ends a slow wait sooner but turns a slow answer into an error. Pair every short timeout with a spoken fallback. See [How to define fallback behavior for voice failures](https://koreai.mintlify.site/agent-platform/abl/how-to/define-voice-fallbacks).

## How it works

### Where the time goes in one turn

1. The caller stops speaking. The platform waits for the end-of-speech signal.
2. The agent runs. A scripted step answers at once. A reasoning step calls the model, then maybe a tool, then the model again.
3. If the work runs longer than the filler delay, a filler plays.
4. The reply goes to TTS. With streaming on, audio starts before the full reply exists.

Studio measures steps 1 to 4 per turn. See [Verification](#verification).

### Fillers

A filler covers silence. It does not shorten the wait.

| Property | Without the profile | With the Voice low-latency profile |
| - | - | - |
| Wait before the first filler | 500 ms | 300 ms |
| Fillers per turn | 5 | 8 |
| Generated fillers (an extra model call) | Off | On. The opener must be ready within the generation budget (2,000 ms). If not, a static filler plays. |

Your own **Filler settings** override the profile defaults. A profile override beats **Filler settings**. Static filler text comes from `MESSAGES`, then from the project's localized phrase pools, then from built-in phrases such as "One moment."

### Voice low-latency profile

The profile is a project setting that tunes voice sessions only. Chat sessions in the same project keep their behavior.

| Area | What the profile sets |
| - | - |
| Model routing | The `fast` model tier for extraction, validation, tool selection, replies, summaries, reasoning, and coordination. Realtime stays on the voice tier. |
| Inline gather | On, unless the agent sets `inline_gather`. |
| Context size | Bounds for prompt context and tool results. The profile uses structured previews, not an extra summary call, so voice turns avoid a serial model call. |
| Fillers | The values in the table above. |

Your explicit settings win over the profile: an agent that sets `inline_gather`, a project model routing override, and your **Filler settings**.

A project gets the profile when its first voice channel is added. An older project can show **Recommended voice defaults are not active**. In **Settings > Runtime Config**, open **Voice low-latency profile** and click **Apply recommended defaults**.

## Project and channel settings

These settings have no ABL syntax. Set them in Studio.

| Where | Setting | Use |
| - | - | - |
| **Settings > Runtime Config** | **Voice low-latency profile** | Fast model tier, inline gather, bounded context, and filler defaults for voice. |
| **Settings > Runtime Config** | **Filler Settings** | Filler delay, count per turn, follow-up gap, generated or static fillers, and phrase pools. |
| Voice channel | **Stream speech** | On: each reply is spoken as it is generated, for a faster first word. Off: every reply plays after it is fully generated. Some provider and voice combinations cannot stream. Studio then says so. |
| Voice channel | **Voice gateway turn detection** and **Patience** | Off by default. Faster patience levels reply sooner but can cut off a caller who pauses. Needs a gateway that supports turn detection. |
| Pipeline voice channel, **Speech** tab | **Experimental Speculative Inference** | Modes `Off`, `Observe`, `Warm`, and `Speculate`. `Warm` prepares provider context before the final request. `Speculate` runs reply generation early on interim speech. Runtime caps the settings and can reduce or disable them. Studio shows the outcome per turn on the **Voice Metrics** tab. |
| **Settings > Runtime Config**, **Channel recovery and graceful failure** | **Enable safe request hedging** | Off by default, and only for channels you opt in. Races the same model on two providers for reply generation or intent classification. Hedge pure generation only. |

Turn detection and end-of-speech hints trade speed for accuracy. A faster setting answers sooner and risks cutting off a caller who is still speaking. Keep the default for free speech. Raise patience for card numbers and spelled names.

## Common variations

### Scripted steps for known questions

Use `REASONING: false` where the question and the answer shape are fixed. The step gathers the value, calls the tool, and replies with fixed text. No model call runs between steps.

`agents/order-status-scripted.agent.abl`

```yaml theme={null}
AGENT: Order_Status_Scripted

GOAL: "Tell a caller the status of an order with no model call between steps."

PERSONA: "Calm phone agent. Short, direct answers."

TOOLS:
  get_order_status(order_id: string) -> {status: string, eta: string}
    description: "Look up the status and delivery estimate of an order"
    parameters:
      order_id:
        description: "The order number the caller gave"
    hints:
      cacheable: true
      side_effects: false

MESSAGES:
  filler_tool_call: "One moment while I check that order."

FLOW:
  entry_point: ask_order

  steps:
    - ask_order
    - look_up
    - done

  ask_order:
    REASONING: false
    VOICE:
      END_OF_SPEECH_TURN_TYPE: structured_value
    GATHER:
      - order_id: required
        type: string
        prompt: "What is your order number?"
    THEN: look_up

  look_up:
    REASONING: false
    CALL: get_order_status
      WITH:
        order_id: order_id
      AS: order
    ON_SUCCESS:
      RESPOND: "Order {{order_id}} is {{order.status}}. Expected delivery: {{order.eta}}."
      THEN: done
    ON_FAIL:
      RESPOND: "I could not look up that order. Let me ask again."
      THEN: ask_order

  done:
    REASONING: false
    RESPOND: "Is there anything else I can help with?"
```

* `END_OF_SPEECH_TURN_TYPE: structured_value` tells the recognizer to expect a value such as an order number. The runtime picks the pause length. Use `END_OF_SPEECH_TIMEOUT_MS` for an explicit value. These hints apply to pipeline voice. They have no effect while turn detection is on for the same block.
* `get_order_status` is a project tool, as in the first example. `order_id` comes from the `GATHER` field. `order` holds the tool result.
* A failed lookup loops back to `ask_order`. Add a retry limit and an escalation before production. See [How to define fallback behavior for voice failures](https://koreai.mintlify.site/agent-platform/abl/how-to/define-voice-fallbacks).

### Run independent lookups at the same time

A `PARALLEL` block runs read-only tool calls together. Three sequential calls take the sum of their times. A parallel block takes the slowest one.

`agents/account-summary-voice.agent.abl`

```yaml theme={null}
AGENT: Account_Summary_Voice

GOAL: "Read a caller their balance and card limit."

PERSONA: "Calm phone agent. Short, direct answers."

TOOLS:
  get_account_info(account_id: string) -> {balance: number}
    description: "Read the balance of an account"
    parameters:
      account_id:
        description: "The account number the caller gave"
    hints:
      side_effects: false
  get_limit_info(account_id: string) -> {limit: number}
    description: "Read the card limit of an account"
    parameters:
      account_id:
        description: "The account number the caller gave"
    hints:
      side_effects: false

FLOW:
  entry_point: ask_account

  steps:
    - ask_account
    - fetch_account_data
    - answer
    - done

  ask_account:
    REASONING: false
    GATHER:
      - account_id: required
        type: string
        prompt: "What is your account number?"
    THEN: fetch_account_data

  fetch_account_data:
    REASONING: false
    PARALLEL:
      - CALL: get_account_info
        WITH:
          account_id: account_id
        AS: account
      - CALL: get_limit_info
        WITH:
          account_id: account_id
        AS: limits
    ON_SUCCESS:
      THEN: answer
    ON_PARTIAL:
      THEN: answer
    ON_FAILURE:
      RESPOND: "I cannot get your account details right now."
      THEN: done

  answer:
    REASONING: false
    RESPOND: "Your balance is {{account.balance}}. Your card limit is {{limits.limit}}."
    THEN: done

  done:
    REASONING: false
    RESPOND: "Is there anything else I can help with?"
```

* `PARALLEL` calls do not use the read-only result cache. Barge-in cancels the running calls.
* `ON_PARTIAL` runs when some calls fail. In this example `answer` would read an empty value for the failed call. Branch on the missing value before production.

### Model, token, and prompt settings

Use a small `max_tokens`, no extra reasoning, and prompt caching for reasoning agents that answer short questions.

```yaml theme={null}
AGENT: Fast_Voice_Agent

GOAL: "Answer short questions about store hours."

PERSONA: "Calm phone agent. Short, direct answers."

EXECUTION:
  reasoning_effort: none
  max_tokens: 200
  llm_timeout: 8000
  tool_timeout: 5000
  inline_gather: true
  prompt_version: v2
  prompt_cache_key: true
```

* `reasoning_effort: none` applies to models that accept the setting.
* `prompt_cache_key` applies to OpenAI and Azure OpenAI models only. `prompt_version: v2` lets the provider reuse the fixed part of the prompt on supported OpenAI and Claude models. New projects start on `v2`. Older projects stay on `v1` until you change it.
* Choose the model in **Settings** or in `EXECUTION` with a model that exists in your project. The profile routes voice operations to the `fast` tier. A project with no model on that tier reports `VOICE_LATENCY_MODEL_UNAVAILABLE` in the model resolution preview.
* `voice_latency_target` and the tool hint `latency` compile, but the runtime does not read them in this release. Do not use them to tune a call.

### Localized fillers

Add a language suffix to a filler key. The runtime checks the region tag, then the language, then the operation, then the general key.

```yaml theme={null}
AGENT: Fast_Voice_Agent_Localized

GOAL: "Answer short questions about store hours."

PERSONA: "Calm phone agent. Short, direct answers."

MESSAGES:
  filler_general: "One moment, please."
  filler_tool_call: "Let me look that up."
  filler_tool_call_fr-CA: "Un instant, je regarde ça pour vous."
  filler_general_fr-CA: "Un instant, s'il vous plaît."
```

Filler operations are `general`, `tool_call`, `reasoning`, `handoff`, `delegation`, `extraction`, and `constraint_check`.

## Verification

Test on a real call. A compile check proves syntax only.

1. Open the voice channel. Click **Open voice preview**, or call the phone number.
2. Say a short question, a long answer, and a value with a pause, such as an order number. Pause mid-number once.
3. Ask the same lookup twice in one call.
4. Open the session in **Sessions** and select the **Voice Metrics** tab.

End-to-end time starts when the runtime receives the finished utterance. It leaves out speech finalization and network time before that.

Check these results:

| Check | Where | Expected |
| - | - | - |
| Turn latency | **Voice Metrics**: **E2E Response Latency**. Investigation view: **Voice quality**, **Turn latency** table | Columns for STT, LLM, TTS, First audio, TTS connect, and End-to-end. Studio colors end-to-end time: under 800 ms is fast, under 1,500 ms is slow, above is very slow. These are Studio display bands, not platform limits. |
| Filler played | Trace event `voice_filler_playback` | One event per spoken filler. It links to its `status_update` by `fillerId`. |
| Silence not covered | **Call Activity**: **Dead Air/Silence**. Trace event `voice_dead_air` | `uncoveredSilenceMs` near 0 for each wait. `waitReason` names the cause: `model`, `tool`, `handoff`, `transfer`, and others. |
| Tool cache | `tool_call` trace event | `cache.status` is `hit` on the repeat lookup. The backend is not called again. |
| Pause handling | The transcript for the value with a pause | The full value, not a cut-off one. If it is cut off, raise `eou_threshold` or lengthen `END_OF_SPEECH_TIMEOUT_MS` for that step. |
| Effective settings | **Voice quality**, **Voice configuration** and **Voice changes during the call** | The configured and effective voice settings, with the reason for any change. |

A realtime call shows end-to-end latency and interruptions only. For the full list of voice trace events, see [How to observe and troubleshoot realtime voice behavior](https://koreai.mintlify.site/agent-platform/abl/how-to/troubleshoot-realtime-voice).

## Production readiness checklist

* Define every tool the agent calls in the project. Confirm the tool timeout is shorter than the time a caller will wait in silence.
* Set `llm_timeout` and `tool_timeout`. The defaults are 120,000 ms and 30,000 ms.
* Mark only read-only tools `cacheable`. Never cache a tool that changes data.
* Confirm the `fast` model tier has a model. Test a reasoning turn, a tool turn, and a handoff turn.
* Write a filler for each long wait, in each language you serve.
* Test a pause inside a number, a short "yes", and a long explanation with the turn detection setting you chose.
* Add a spoken fallback for a slow or failed tool or model. See [How to define fallback behavior for voice failures](https://koreai.mintlify.site/agent-platform/abl/how-to/define-voice-fallbacks).
* Review `voice_dead_air` events from a test run of at least one call that uses each tool.

## Common mistakes

| Mistake | Why it happens | How to avoid it |
| - | - | - |
| Expecting a filler to speed up the answer | A filler covers silence only. | Cut the wait with scripted steps, caching, `PARALLEL`, and timeouts. Use fillers for what remains. |
| Lowering `eou_threshold` to `0.3` for every step | Faster replies feel better in a quick test. | Keep `0.5` for free speech. Raise it for numbers and spelled names. |
| Setting `END_OF_SPEECH_TURN_TYPE` and turn detection together | Both look like pause controls. | Use one. While turn detection is on, the gateway ignores the end-of-speech hint, and compile warns `VOICE_TURN_DETECTION_WITH_END_OF_SPEECH`. |
| Leaving default timeouts | The defaults suit chat. | Set `llm_timeout` and `tool_timeout` for voice. |
| Putting `STREAMING` or `BARGE_IN` in `EXECUTION.voice` | They look like call-wide settings. | Set them on the output, step, field, tool, or lifecycle reply. `EXECUTION.voice` ignores them with `VOICE_DELIVERY_KEY_IGNORED_PLACEMENT`. |
| Using `{{ }}` in a filler | Other `MESSAGES` keys accept it. | Write static text. Fillers never use caller input. |
| Caching a tool that writes | `cacheable` looks like a speed switch. | Use it on read-only tools. An agent-level tool counts as writing unless it states `side_effects: false`. |
| Turning off **Stream speech** to fix choppy audio | Streaming can sound uneven on some voices. | Test the voice first. With the switch off, every reply waits for full generation. |

## Troubleshooting

| Symptom | Likely cause | What to check |
| - | - | - |
| Long silence before every reply | Model or end-of-speech wait. | **Turn latency**: a high STT column means end of speech. A high LLM column means the model. Check the profile, model tier, `reasoning_effort`, and prompt size. |
| Long silence only on tool turns | Slow backend. | `voice_dead_air` with `waitReason: tool`. Add `cacheable`, `PARALLEL`, or a shorter `tool_timeout`. |
| No filler plays | Fillers or **Voice fillers** off, or the wait is shorter than the delay. | **Settings > Runtime Config > Filler Settings**. Turning **Fillers enabled** or **Voice fillers** off silences every filler, including realtime ones. |
| The same filler repeats, or only one plays | A `MESSAGES` filler is one phrase. Phrase pools are small. | A phrase plays once per turn. Add pool phrases per language, at least as many as **Max per turn**. |
| Filler plays, then a long gap before the answer | The answer is slow after the filler. | **Filler to answer pause (ms)** and `voice_pipeline_answer_gap` events. Default is 0. |
| First word starts late on long replies | **Stream speech** is off, or the provider cannot stream. | Voice channel **Stream speech**. Trace event `voice_tts_stream_unavailable` shows that streaming did not open. |
| Caller is cut off mid-number | Turn detection too fast. | Raise `eou_threshold`, set `END_OF_SPEECH_TURN_TYPE: structured_value` on that step, or lengthen `END_OF_SPEECH_TIMEOUT_MS`. |
| Setting has no effect on a realtime call | The provider owns that behavior. | See the pipeline and realtime table above. |
| Turn detection does nothing | The gateway lacks support, or the value is invalid. | A value outside `0.3` to `0.9` in steps of `0.1` is a compile error `VOICE_INVALID_TURN_DETECTION`. |

## Related HowTos

* [How to write voice-friendly agent responses](https://koreai.mintlify.site/agent-platform/abl/how-to/write-voice-friendly-responses)
* [How to handle barge-in, pauses, and unclear audio](https://koreai.mintlify.site/agent-platform/abl/how-to/handle-voice-turn-taking)
* [How to define fallback behavior for voice failures](https://koreai.mintlify.site/agent-platform/abl/how-to/define-voice-fallbacks)
* [How to observe and troubleshoot realtime voice behavior](https://koreai.mintlify.site/agent-platform/abl/how-to/troubleshoot-realtime-voice)
* [How to choose between a reasoning agent and a FLOW-based agent](https://koreai.mintlify.site/agent-platform/abl/how-to/choose-reasoning-agent-or-flow)
* [How to configure model, timeout, and execution settings for an agent](https://koreai.mintlify.site/agent-platform/abl/how-to/configure-agent-execution-settings)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.