> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Voice Agent

Learn how to build a natural realtime voice experience, ready for production use.

**Key concepts demonstrated:**

* Speech-to-text (STT) - for understanding speech inputs
* LLM - for generating the agent text response
* Text-to-speech (TTS) - for generating agent speech audio

<Note>
  **Architecture**

  * **Backend:** Inworld Agent Runtime + Express.js
  * **Frontend:** Vite + React
  * **Communication:** WebSocket
</Note>

## Prerequisites

* Node.js v20 or higher: [Download here](https://nodejs.org/en/download)
* Assembly.AI API key (required for speech-to-text functionality): [Get your API key](https://www.assemblyai.com/)
* Inworld API key (required): [Sign up here](https://platform.inworld.ai/signup) or see [quickstart guide](/node/authentication#getting-an-api-key)

## Run the Template

### Start the Server

1. Clone the [Voice Agent GitHub repo](https://github.com/inworld-ai/voice-agent-node):
   ```bash theme={"system"}
   git clone https://github.com/inworld-ai/voice-agent-node
   cd voice-agent-node
   ```
2. Navigate to the server directory:
   ```bash theme={"system"}
   cd server
   ```
3. Copy the `.env-sample` file to `.env`:
   ```bash theme={"system"}
   cp .env-sample .env
   ```
4. Configure your `.env` file with required API keys:

   ```env .env theme={"system"}
   # Required, Inworld Agent Runtime Base64 API key
   INWORLD_API_KEY=<your_api_key_here>

   # Required, get your Assembly.AI API key from https://www.assemblyai.com/
   ASSEMBLY_AI_API_KEY=<your_assemblyai_api_key_here>
   ```

   <Note>
     Get your [Assembly.AI API key](https://www.assemblyai.com/) for speech-to-text functionality.
   </Note>
5. Install dependencies:
   ```bash theme={"system"}
   npm install
   ```
6. Start the server:
   ```bash theme={"system"}
   npm start
   ```
   The server will start on port 4000.

### Start the Client

1. Open a new terminal window.
2. Navigate to the client directory:
   ```bash theme={"system"}
   cd client
   ```
3. (Optional) Create a `.env` file to customize client behavior:
   ```env .env theme={"system"}
   # Optional: Enable latency reporting in the UI
   VITE_ENABLE_LATENCY_REPORTING=true

   # Optional: Server port (default: 4000)
   VITE_APP_PORT=4000
   ```
4. Install dependencies:
   ```bash theme={"system"}
   npm install
   ```
5. Start the client:
   ```bash theme={"system"}
   npm start
   ```
   The client will start on port 3000 (or the next available port if 3000 is in use) and should automatically open in your default browser.

### Chat with Your Agent

1. **Configure the agent:**
   * Enter the agent system prompt
   * Click "Create Agent"

2. **Start chatting:**
   * **Voice input:** Click the microphone icon to unmute yourself, speak, then click again to mute
   * **Text input:** Type in the input field and press Enter to send

3. **Monitor performance:**
   * View [dashboards](/portal/dashboards), [traces](/portal/traces), and [logs](/portal/logs) in the [Inworld Portal](https://platform.inworld.ai/)
   * Enable `VITE_ENABLE_LATENCY_REPORTING=true` in client `.env` to see latency metrics in the UI

## Next steps

<CardGroup cols={2}>
  <Card title="Explore templates" icon="code" href="/node/templates/overview">
    Explore more templates for building with the Runtime SDK.
  </Card>

  <Card title="Vibe Code Your App" icon="sparkles" href="/guides/vibe-code">
    Learn how to vibe code any workflow or agent
  </Card>
</CardGroup>
