Skip to main content
The Voice Agent Template illustrates how to set up a text or audio to audio chat conversation. 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
Architecture
  • Backend: Inworld Runtime + Express.js
  • Frontend: Vite + React
  • Communication: WebSocket

Run the Template

Start the Server

  1. Download and extract the Inworld Templates and open it in an IDE.
  2. Open a new terminal window.
  3. Navigate to the voice agent server directory:
    cd voice_agent/server
    
  4. Make a copy of the .env-sample file:
    cp .env-sample .env
    
  5. Paste your Base64 Runtime API key into the .env file and set GRAPH_VISUALIZATION_ENABLED=true:
    .env
    # Required, Inworld Runtime Base64 API key
    INWORLD_API_KEY=<your_api_key_here>
    
    # Optional, defaults to `false`
    GRAPH_VISUALIZATION_ENABLED=true
    
  6. Install dependencies:
    yarn install
    
  7. Start the server:
    yarn start
    
    The server will start on port 4000. You will see the path to your graph visualization printed in your terminal. Here is an example of the visualization:
    Graph visualization is currently not supported on Windows

Start the Client

  1. Open a new terminal window.
  2. Navigate to the voice agent client directory:
    cd voice_agent/client
    
  3. Install dependencies:
    yarn install
    
  4. Start the client:
    yarn 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 Agent

  1. Configure your agent in the UI:
    • Enter your name
    • Set the agent’s name
    • Provide a description for the agent
    • Define the agent’s motivation
  2. Click “Start” to begin the conversation.
  3. Chat with the agent:
    • Type text in the input field and hit Enter or click the send button
    • Click the microphone icon to use voice input
    • Click the copy icon to copy the conversation to the clipboard
  4. Observe Telemetry

Next steps