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

# Turn Detection

Turn Detection identifies when a speaker has finished their conversational turn and it's appropriate for an AI to respond. It solves a critical problem in voice AI: respond too early and you interrupt the speaker; wait too long and the conversation feels awkward.

## Two Paths in Vision Agents

Turn detection works differently depending on your setup:

```
Custom pipeline:  Call audio → STT or TurnDetector → turn signals → LLM
Realtime mode:      Call audio ↔ Realtime API
```

### 1. Provider-built-in (STT output stream)

Many STT plugins emit `TurnStarted` and `TurnEnded` signals on their output stream. Turn detection happens inside the provider API — no separate plugin needed.

```python theme={null}
from vision_agents.core import Agent, User
from vision_agents.plugins import deepgram, gemini, getstream, inworld

agent = Agent(
    edge=getstream.Edge(),
    agent_user=User(name="Assistant", id="agent"),
    instructions="You are a helpful voice assistant.",
    llm=gemini.LLM(),
    stt=deepgram.STT(eager_turn_detection=True),  # built-in turns; eager = lower latency
    tts=inworld.TTS(),
)
```

### 2. External plugin

When your STT plugin has no built-in turn detection, add a `TurnDetector` plugin:

```python theme={null}
from vision_agents.plugins import smart_turn

agent = Agent(
    ...,
    stt=fast_whisper.STT(),
    turn_detection=smart_turn.TurnDetection(),
)
```

External plugins use Silero VAD plus neural models to predict turn completion — see [Smart Turn](/integrations/turn-detection/smart-turn) and [Vogent](/integrations/turn-detection/vogent).

## Turn Detection vs VAD

|                  | VAD                         | Turn Detection                           |
| ---------------- | --------------------------- | ---------------------------------------- |
| **Question**     | "Is someone speaking?"      | "Has the speaker finished?"              |
| **Output**       | Speech start/end timestamps | `TurnStarted` / `TurnEnded` turn signals |
| **Intelligence** | Simple audio analysis       | Provider API or neural turn models       |
| **Best for**     | Detecting presence          | Knowing when to respond                  |

## STT Plugins with Built-in Turn Detection

| STT Plugin                                 | Turn Detection                                                         |
| ------------------------------------------ | ---------------------------------------------------------------------- |
| [Deepgram](/integrations/stt/deepgram)     | Always on; set `eager_turn_detection=True` for speculative early turns |
| [ElevenLabs](/integrations/stt/elevenlabs) | Built-in via VAD commit strategy                                       |
| [Cartesia](/integrations/stt/cartesia)     | Built-in; eager by default                                             |
| [AssemblyAI](/integrations/stt/assemblyai) | Built-in                                                               |
| [Sarvam](/integrations/stt/sarvam)         | Built-in via VAD events                                                |

STT plugins without turn detection (Fast-Whisper, Wizper, Fish, Mistral, AWS) need an external plugin or fall back to using the final transcript as the end-of-turn signal.

## External Turn Detection Plugins

| Plugin                                                | Description                                                              |
| ----------------------------------------------------- | ------------------------------------------------------------------------ |
| [Smart Turn](/integrations/turn-detection/smart-turn) | Combines Silero VAD, Whisper features, and neural turn completion models |
| [Vogent](/integrations/turn-detection/vogent)         | Neural turn detection with high accuracy prediction                      |

<Tip>
  For Realtime APIs (OpenAI, Gemini, AWS Bedrock, Qwen, xAI, Inworld), turn detection is built-in at the model level — no separate plugin needed. See [Voice Agents — Realtime Mode](/introduction/voice-agents#realtime-mode).
</Tip>

<Note>
  When an STT plugin provides built-in turn detection (`stt.turn_detection` is `True`), the `Agent` automatically ignores any external `TurnDetector` plugin to prevent conflicts.
</Note>

## SDK Behavior

* **`TurnStarted`** — triggers barge-in interrupt in the transcribing flow
* **`TurnEnded(eager=True)`** — starts speculative LLM work for lower latency
* **`TurnEnded(eager=False)`** — confirms the turn is complete
* Pipeline signals (`TurnStarted`/`TurnEnded` on the STT output stream) are distinct from agent events (`UserTurnStartedEvent`, `UserTurnEndedEvent`)

## Next Steps

<CardGroup cols={2}>
  <Card title="Interruption Handling" icon="hand" href="/guides/interruption-handling">
    Setup, tuning, and troubleshooting
  </Card>

  <Card title="Voice Agents" icon="microphone" href="/introduction/voice-agents#custom-pipeline-mode">
    Wire turn detection into a pipeline
  </Card>

  <Card title="Smart Turn" icon="brain" href="/integrations/turn-detection/smart-turn">
    Configure the Smart Turn plugin
  </Card>

  <Card title="Vogent" icon="wave-pulse" href="/integrations/turn-detection/vogent">
    Alternative turn detection option
  </Card>
</CardGroup>
