Skip to main content

Overview

Retell AI is a specialized conversational voice engine designed for sub-second conversational latency (~350 ms) and human-like turn-taking. In BrokerOS, the Retell integration is implemented in integrations/voice/agents/retell/src/index.ts under the Turborepo workspace package @brokeros/int-agent-retell. BrokerOS administrators configure and manage Retell AI directly through the Web UI at Dashboard -> Marketing -> Voice -> Settings. All API credentials are encrypted using AES-256-GCM and stored in PostgreSQL (VoiceAgentIntegration).

Architecture and Dispatch Sequence

The Retell integration implements the IVoiceAgentProvider contract from @brokeros/types.

Step 1: Obtain Credentials from Retell AI

  1. Log into your account at beta.retellai.com.
  2. Navigate to API Keys in the left sidebar menu.
  3. Click Create API Key and copy your secret key (starting with key_).
  4. In the Phone Numbers tab, purchase or link an outbound phone number for Caller ID display.
  5. In the Agents tab, create or inspect your target agent persona.

Step 2: Connect in the BrokerOS Web Dashboard

In your BrokerOS dashboard:
  1. Navigate to Dashboard -> Marketing -> Voice -> Settings.
  2. Select the Gateways & Voice Platforms tab (/dashboard/marketing/voice/settings?tab=providers).
  3. Click the AI Voice Platforms sub-tab.
  4. Click Add Platform and select Retell AI.
  5. Fill in the modal connection fields:
  1. Click Save & Verify Engine. BrokerOS sends a live verification request to GET https://api.retellai.com/list-agents. Once confirmed, the key is encrypted via AES-256-GCM and stored in VoiceAgentIntegration.

Step 3: Webhook Telemetry Handling

When a call concludes, Retell automatically posts post-call analytics and diarized transcripts to the BrokerOS webhook route:
The BrokerOS parseRetellWebhookEvent parser automatically captures:
  • Audio recording URL
  • Speaker diarized transcript (Agent vs Lead)
  • Sentiment classification (Positive, Neutral, Negative)
  • Extracted client budget and location objections

Integration Implementation Details

The Retell client and call dispatcher are located in integrations/voice/agents/retell/src/index.ts and integrations/voice/agents/retell/src/retell-dispatcher.ts.

Live Verification Engine

When tested in the UI, RetellAgentClient.validateCredentials() executes an authenticated health check:

Outbound Call Dispatch and Overrides

The dispatcher resolves outbound phone numbers, matches agents, and builds runtime configuration overrides: