# runVoiceAgent
Source: https://docs.maelstrom-ai.co/0.2/reference/realtime-livekit-agent/functions/runvoiceagent/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **runVoiceAgent**(): `void`

Defined in: packages/realtime-livekit-agent/src/agent.ts:568

Boots the agent as a standalone worker process, separate from the application server that mints browser room tokens.

Reads LiveKit connection config from the environment, so call it from a thin entry that has already loaded `.env`. An invalid drain timeout or derived pending-audio budget rejects before `cli.runApp`, so a worker can never start with an unsafe cap and discover it mid-turn.

`ServerOptions.agent` is set to this module’s own resolved path, because the LiveKit CLI re-spawns the agent per job and needs a file it can import. That makes the path an invariant rather than a detail: this module must remain importable from disk at the location it was loaded from, which is why it is derived from `import.meta.url` and not from the caller’s entry file.

## Returns

`void`

## Example

voice-worker.mjs

```js
import { runVoiceAgent } from '@maelstrom-co/realtime-livekit-agent';

runVoiceAgent();
```

Then start it with the LiveKit worker CLI verb:

Terminal window

```bash
node --env-file=.env voice-worker.mjs start
```
