| .. | ||
| README.md | ||
| worker.ts | ||
LiveKit Voice Assistant
This worker runs the Rocky Mountain Vending site voice assistant with LiveKit Agents and xAI realtime voice.
Local development
- Start the Next.js app:
pnpm dev - Start the LiveKit agent worker in a second terminal:
pnpm voice-agent:dev - Open the site and launch the voice bubble.
- Run the automated regressions:
pnpm voice-assistant:test:local - Run the fake-microphone voice regression:
pnpm voice-assistant:test:local:voice
Environment
The worker loads environment variables from:
.env.local.env.voice-agent.local(optional override file)
Required variables:
LIVEKIT_URLLIVEKIT_API_KEYLIVEKIT_API_SECRETXAI_API_KEYXAI_REALTIME_MODEL=grok-4-1-fast-non-reasoning
Recommended variable:
VOICE_ASSISTANT_SITE_URL
Production
Run the worker as a separate long-lived Node process:
pnpm voice-agent:start
Point VOICE_ASSISTANT_SITE_URL at the deployed Next.js app so the worker can reuse /api/contact and /api/request-machine.
Verification
Automated checks:
pnpm voice-assistant:test:localpnpm voice-assistant:test:local:voicepnpm voice-assistant:test:live
Manual spoken smoke checklist:
- Open the homepage and launch the assistant bubble.
- Press
Start assistantand confirm the panel reachesText ReadyorListening. - Confirm the text box is enabled before microphone access is granted.
- Press
Enable microphoneand verify the browser permission prompt appears. - After granting permission, say a short question such as "What cities in Utah do you serve?"
- Confirm you see a user transcript, then an assistant reply transcript.
- Confirm spoken audio playback is audible after
Enable spoken replieswhen the browser requires it. - Refresh the page and verify reconnect still works.
- Open
/sign-inand confirm the assistant stays hidden there.