Overview

The general flow for a Daily Bot is as follows:

1

Client is initialized

The client application creates an RTVI component, called the RTVIClient with the configuration for which type of bot (AI Agent) to launch, what settings and an internal endpoint to connect to.

2

Client is connected

The client application calls connect() on the RTVIClient.

3

The internal endpoint is triggered

The RTVIClient connects to the internal endpoint and sends the configuration and settings.

4

Daily's /bots/start endpoint is called

The internal endpoint uses a stored Daily API Key to forward the configuration and settings to the Daily Bots REST endpoint (/bots/start).

5

Bot Launches

The Daily Bots REST endpoint launches the AI Agent in the cloud.

6

Communication Begins

The AI Agent connects directly to the RTVIClient and the client application can now interact with the AI Agent.

The AI Agent will remain active until the client application calls disconnect() on the RTVIClient or a max duration is reached. The AI Agent will then be shut down and the connection will be closed.