Skip to main content

Agent quickstart

This quickstart guide walks you through setting up and running the TEN Agent to experiment with different AI models, speech services, and communication tools. Using the interactive TEN Agent playground you can test and configure AI agents to:

  • Experiment with different AI models, TTS/STT systems, and real-time communication
  • Test agent behavior in a controlled environment
  • Configure extensions and modules through a visual interface

Prerequisites

Before starting, ensure you have:

  • Agora credentials from Agora Console

  • API keys for your chosen services

    • LLM service like OpenAI or Google Gemini
    • STT service such as Azure
    • TTS service like ElevenLabs or Azure TTS
  • Development environment
    Install one of the following:

  • System requirements

    • CPU: Dual-core processor or higher
    • Memory: 4 GB RAM minimum
info
If you are using an Apple Silicon Mac, uncheck the Use Rosetta for x86/amd64 emulation checkbox in Docker Desktop settings. While this may slow ARM builds, it ensures proper performance on x64 deployment servers.

Make sure the box is unchecked

Set up the project

Start by getting the code and configuring the basic environment with your credentials.

Clone the repository


_1
git clone https://github.com/TEN-framework/ten-framework.git

Configure environment

  1. Switch to the project directory and create a .env file from the template:


    _2
    cd ten-framework/ai_agents
    _2
    cp ./.env.example ./.env

  2. Open .env and add your Agora credentials:


    _2
    AGORA_APP_ID=your_app_id_here
    _2
    AGORA_APP_CERTIFICATE=your_certificate_here

  3. Add API keys and other configuration parameters to the .env file for the LLM, STT, and TTS extensions you want to test. Following are some commonly used parameters:


    _23
    # Extension: gemini_llm
    _23
    # Gemini API key
    _23
    GEMINI_API_KEY=
    _23
    _23
    # Extension: openai_chatgpt
    _23
    # OpenAI API key
    _23
    OPENAI_API_BASE=https://api.openai.com/v1
    _23
    OPENAI_API_KEY=
    _23
    OPENAI_MODEL=gpt-4o
    _23
    _23
    # Extension: agora_rtc
    _23
    # Azure STT key and region
    _23
    AZURE_STT_KEY=
    _23
    AZURE_STT_REGION=
    _23
    _23
    # Extension: azure_tts
    _23
    # Azure TTS key and region
    _23
    AZURE_TTS_KEY=
    _23
    AZURE_TTS_REGION=
    _23
    _23
    # Extension: elevenlabs_tts
    _23
    # ElevenLabs TTS key
    _23
    ELEVENLABS_TTS_KEY=

    info

    You can also configure these API keys later through the playground interface.

Start Docker containers

Run the docker command to compose containers:


_1
docker compose up -d

Build and run

Follow these steps to build and run TEN Agent:

  1. Enter the development container


    _1
    docker exec -it ten_agent_dev bash

  2. Build the agent

    Use the following command to build the agent:


    _1
    task use

  3. Start the web server


    _1
    task run

Configure your agent

The playground interface allows you to test different configurations and see results in real-time. Each graph type supports specific extensions and capabilities - Voice Agent for speech interactions, Realtime Agent for low-latency communication.

To get started:

  1. Open the playground at http://localhost:3000

  2. Configure your agent:

    1. Select a graph type (Voice Agent or Realtime Agent) from the dropdown.

    2. Click the module configuration button. Select extension modules such as STT, TTS, and LLM from the panel. The system saves settings to property.json when you click Save changes. For further details, see Configure modules.

    3. Click the settings button to configure extensions with required API keys and parameters. For further details, see Configure properties.

    4. To configure STT and TTS languages, see Configure languages.

Module Example

Modify the code directly

You can edit the configuration files directly if you prefer manual control. Open agents/property.json, locate the graph you want to modify, and update any values. After saving your changes, refresh the playground page and reconnect to the agent. Your changes take effect immediately.

Reference

This section contains content that completes the information on this page, or points you to documentation that explains other aspects to this product.