# 00 First words

> Deepgram workshops › Build a voice agent › Mission 00
> Web version: https://workshops.deepgram.com/voice-agent/first-words
> About 20 min (estimate). Check it: `make check 00` (offline, no key).

Get an agent talking back in a voice you picked.

- [Four layers](https://workshops.deepgram.com/voice-agent/first-words/four-layers.md)
- [Say hello](https://workshops.deepgram.com/voice-agent/first-words/say-hello.md)
- [Make it yours](https://workshops.deepgram.com/voice-agent/first-words/make-it-yours.md)
- [Take it with you](https://workshops.deepgram.com/voice-agent/first-words/take-it-with-you.md)

## Four layers

### The four layers

This mission tunes the voice, with a little thinking. You change settings and listen.

**How it works**

**One agent, three parts.** The agent is a pipeline: it listens (speech-to-text), thinks (an LLM), and speaks (a voice). One Settings message configures all three: Hearing is `agent.listen`, on Deepgram Flux STT (`flux-general-en`); Thinking is `agent.think`; Voice is `agent.speak`. Timing decides when it takes the turn, and gets its own block in Mission 1.

When you tap **Start the agent**, your browser sends that Settings message with everything in the settings panel: the prompt (who the agent is), the greeting (its first line) and the voice.

```text
Settings                  One Settings message           Conversation
prompt, greeting, voice → sent when you tap Start    → what you hear back
```

**Settings in, conversation out.**

The agent reads that message once, at the start. Change a setting and the button reads **Reconnect and apply**: it sends the message again with your new settings and keeps the conversation on screen so you can compare. **Apply voice only** swaps the voice and its speed, mid-call. Every other change goes out on **Reconnect and apply**, which always works.

Everything in this mission works on any Deepgram key.

## Say hello

### Talk to it

**Do:** Put on headphones if you have them. Tap **Start the agent** and say hi, or type if it's loud.

**Listen for:** its greeting, then its answer.

**Why headphones**

Headphones keep the agent's voice clear and let it hear only you.

_On the web page, this step has the agent console: talk or type to the agent there, or run the same mission in your own code._

**Check:** The agent talked back.

### Change the voice

**Do:** Pick a different **Voice**, tap **Apply voice only**, and say something.

**Listen for:** a new person on the same prompt.

_On the web page, this step has the Settings panel; in your own code the same settings are in the start file._

_On the web page, this step shows the code panel with the matching code._

**Check:** It spoke in a voice you picked.

**How it works**

The prompt is two sentences: who the agent is, and how long its answers are. Leave it for the first run.

A typed line reaches the agent as text and gets the same answer a spoken one would. The event log under the conversation lists every message as it arrives, for the curious.

Changing the voice changes one line of the Settings message: the voice in the `speak` block. The code panel shows it, with the voice you picked on the **Settings JSON** tab. Lower down, the `ConversationText` handler prints both sides of the conversation; that event is what the checkpoints read.

## Make it yours

### Rewrite the prompt

**Do:** Rewrite the **Prompt** in three lines: who it is, how it talks, one rule it keeps. Or start from this one:

```
You are Sam, the barista at a tiny cafe. Answer in one short sentence, then ask one question back. Never recommend decaf.
```

_On the web page, this step has the Settings panel; in your own code the same settings are in the start file._

### Ask it something new

**Do:** Tap **Reconnect and apply**, and ask it something the old agent couldn't answer.

_On the web page, this step has the agent console: talk or type to the agent there, or run the same mission in your own code._

_On the web page, this step shows the code panel with the matching code._

**Check:** It&#39;s your agent now.

### Hard mode: a new voice, same call

**Do:** **Hard mode.** Mid-conversation, pick a new **Voice** and tap **Apply voice only**.

**Listen for:** the same call in a new voice.

_On the web page, this step has the Settings panel; in your own code the same settings are in the start file._

**Check:** Hard mode: a new voice, same call. (Optional.)

**How it works**

Who it is: a cafe barista, a museum guide, a very calm airline pilot. How it talks: short answers, one question at a time, no lists. One rule: something it always or never does.

Your prompt travels as one string, `agent.think.prompt`, in the same Settings message. The **Settings JSON** tab shows your sentences in it.

**Going further.** Two more knobs sit at the bottom of Settings. **Speed** is how fast it talks; **Expressivity** is how much feeling it puts in (0 is neutral, 2 is a performance). Nudge one, tap **Reconnect and apply**, and listen. Set them back to 1.0 and 0 before the next mission so you know what normal sounds like.

**Hard mode check.** It looks for a reply before the swap and another after it, in the same call. That's how an app swaps voices without hanging up.

## Take it with you

### Rebuild it anywhere

**Do:** Rebuild this agent anywhere:

- [Voice Agent Playground](https://playground.deepgram.com/voice-agent?utm_source=workshops&utm_medium=agent&utm_campaign=workshop-voice-agent&utm_content=md-first-words): the same settings panel, bigger.
- The attendee project: [Python](https://github.com/deepgram-devs/voice-agent-workshop/blob/main/python/missions/00-first-words/start.py) or [TypeScript](https://github.com/deepgram-devs/voice-agent-workshop/blob/main/typescript/missions/00-first-words/start.ts), this mission as three TODOs.
- New to this? Try the [todo voice agent starter](https://github.com/deepgram-devs/todo-voice-agent-workshop).

Building on LiveKit, Pipecat, Vapi, Twilio, or Telnyx? [PARTNERS.md](https://github.com/deepgram-devs/voice-agent-workshop/blob/main/PARTNERS.md) in the code project shows what carries over.

Keep your key on your server.

_On the web page, this step shows the code panel with the matching code._

**Keep your key safe**

The program in the code panel runs from a terminal: type a line and it answers in the transcript.

The [attendee project](https://github.com/deepgram-devs/voice-agent-workshop) has one folder per mission in Python, TypeScript, and Java, with an offline check that tells you when the TODOs are done. The [todo voice agent guide](https://workshops.deepgram.com/todo-voice-agent) walks the simpler starter step by step.

Python has the microphone; TypeScript and Java take typed input. After setup, every check runs offline.

On your own machine the key stays with you. In anything you ship, a web page or a phone app, keep the key out of the code people download. Put a small server of yours in between, the way this workshop does: the browser talks to your server, and your server holds the key and talks to Deepgram. Or have your server ask Deepgram for a short-lived token (`POST /v1/auth/grant`, 30 seconds by default) and hand that to the app.

**In production**

- **Watch:** the `Error` and `Warning` events, and how often a session closes before the agent's first reply.
- **Aim for:** `SettingsApplied` before any audio goes out, and a KeepAlive every 5 seconds or so whenever no audio is flowing.
- **Read:** the [Voice Agent docs](https://developers.deepgram.com/docs/voice-agent) for every Settings field.

**What you tuned:** the voice layer, with a little thinking. One Settings message set who your agent is and how it sounds.
