diff --git a/README.md b/README.md
index a676858..7047212 100644
--- a/README.md
+++ b/README.md
@@ -135,22 +135,33 @@ configure({ apiKey: 'YOUR_DEEPGRAM_API_KEY' });
| `useDeepgramTextIntelligence` | Text analysis (summaries, topics, intents, sentiment) |
| `useDeepgramManagement` | Typed wrapper around the Management REST API |
+> 💡 **Pro tip**: All hooks now export a `state` object (and other reactive values) so you can easily track connection status, errors, and transcripts without maintaining your own state.
+
---
## Voice Agent (`useDeepgramVoiceAgent`)
`useDeepgramVoiceAgent` connects to `wss://agent.deepgram.com/v1/agent/converse`, captures microphone audio, and optionally auto-plays the agent's streamed responses. It wraps the full Voice Agent messaging surface so you can react to conversation updates, function calls, warnings, and raw PCM audio.
+> 🔊 **Audio Handling**: This hook uses `AVAudioEngine` on iOS for hardware-accelerated echo cancellation, ensuring the agent doesn't hear itself speak. It also manages the audio session automatically.
+
### Quick start
```tsx
const {
connect,
disconnect,
+ state, // { connectionState, error, warning }
+ agentStatus, // { thinking, latency }
+ conversation, // Array<{ role, content }>
injectUserMessage,
sendFunctionCallResponse,
updatePrompt,
} = useDeepgramVoiceAgent({
+ trackState: true, // Enable reactive state tracking
+ trackConversation: true, // Enable conversation history tracking
+ trackAgentStatus: true, // Enable agent status tracking
+ autoPlayAudio: true, // Automatically play agent audio
defaultSettings: {
audio: {
input: { encoding: 'linear16', sample_rate: 24_000 },
@@ -207,6 +218,7 @@ const rePrompt = () => {
return (
<>
+ Status: {state.connectionState}
@@ -227,6 +239,10 @@ return (
| `endpoint` | `string` | WebSocket endpoint used for the agent conversation (defaults to `wss://agent.deepgram.com/v1/agent/converse`). |
| `defaultSettings` | `DeepgramVoiceAgentSettings` | Base `Settings` payload sent on connect; merge per-call overrides via `connect(override)`. |
| `autoStartMicrophone` | `boolean` | Automatically requests mic access and starts streaming PCM when `true` (default). |
+| `autoPlayAudio` | `boolean` | Automatically plays received audio using the native player (default: `true`). |
+| `trackState` | `boolean` | Enable reactive state tracking (connection, errors, warnings) via the `state` return value (default: `false`). |
+| `trackConversation` | `boolean` | Enable conversation history tracking via the `conversation` return value (default: `false`). |
+| `trackAgentStatus` | `boolean` | Enable agent status tracking (thinking, latency) via the `agentStatus` return value (default: `false`). |
| `downsampleFactor` | `number` | Manually override the downsample ratio applied to captured audio (defaults to a heuristic based on the requested sample rate). |
#### Callbacks
@@ -268,6 +284,10 @@ return (
| `updatePrompt` | `(prompt: string) => boolean` | Replaces the active system prompt. |
| `sendMedia` | `(chunk: ArrayBuffer \| Uint8Array \| number[]) => boolean` | Streams additional PCM audio to the agent (e.g., pre-recorded buffers). |
| `isConnected` | `() => boolean` | Returns `true` when the socket is open. |
+| `clearConversation` | `() => void` | Clears the internal conversation history. |
+| `state` | `DeepgramVoiceAgentState` | Reactive state object (requires `trackState: true`). |
+| `conversation` | `DeepgramVoiceAgentConversationMessage[]` | Reactive conversation history (requires `trackConversation: true`). |
+| `agentStatus` | `DeepgramVoiceAgentStatus` | Reactive agent status (requires `trackAgentStatus: true`). |
#### Settings payload (`DeepgramVoiceAgentSettings`)
@@ -301,7 +321,14 @@ The speech hook streams microphone audio using WebSockets and can also transcrib
### Live streaming quick start
```tsx
-const { startListening, stopListening } = useDeepgramSpeechToText({
+const {
+ startListening,
+ stopListening,
+ state, // { status, error }
+ transcript, // "Hello world..."
+} = useDeepgramSpeechToText({
+ trackState: true,
+ trackTranscript: true,
onTranscript: console.log,
live: {
apiVersion: 'v2',
@@ -311,6 +338,7 @@ const { startListening, stopListening } = useDeepgramSpeechToText({
},
});
+Transcript: {transcript}