# Voice agent

The coach, spoken. A real-time voice connection rather than record-then-transcribe, so you can interrupt it and it responds like a conversation rather than a walkie-talkie.

## How it works

The browser opens a WebSocket directly to the realtime speech model. Before that connection is made, the server mints a short-lived ephemeral credential and builds the system prompt — the same coaching context the text coach uses: your profile, goals, recent data, learnings, streaks and Mission Statement.

Two properties follow from that design. Audio never passes through nLight.fit servers, which keeps latency low. And the credential your browser holds is short-lived and scoped to one session, so the long-lived API key stays server-side.

## Modes

**Unified** — the default. Talk about anything; the agent moves between coaching and logging as the conversation goes.

**Chat** — conversation only. Coaching, questions, working through a problem. Nothing is written to the ledger.

**Data entry** — hands-free logging. Say what you did and it fills in the ledger. Useful straight after a workout, or while cooking, when typing into a grid is the wrong interface.

**Onboarding** — a guided pass through the profile, roughly fifty fields, conversationally. Considerably faster than the form, and it tends to surface context a form does not, because you explain things rather than selecting them.

## Voice selection

The voice is chosen to match the coaching style you set in your profile. An analytical coach and a tough one should not sound the same.

## Learning from speech

Voice conversations feed the same [learnings](/docs/concepts#learnings) pipeline as text. Insights are extracted asynchronously after the session, tagged with `voice` as their source, and become available to the text coach immediately. The two are the same coach with the same memory, not two assistants that each know half of it.

## Practical notes

- Needs microphone permission and a live connection.
- Best in a quiet space — it is a real-time model, and background conversation will be picked up as input.
- Data entry confirms what it heard before writing. Check it; speech recognition on numbers is good, not perfect.

## Related

- [AI coach](/docs/ai-coach) — the context pipeline behind both surfaces
- [Quickstart](/docs/quickstart) — using voice onboarding to fill your profile
