Lifecycle
An overview of the lifecycle of a Daily Bot
Overview
The general flow for a Daily Bot is as follows:
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.
Client is connected
The client application calls connect()
on the RTVIClient
.
The internal endpoint is triggered
The RTVIClient
connects to the internal endpoint and sends the
configuration and settings.
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
).
Bot Launches
The Daily Bots REST endpoint launches the AI Agent in the cloud.
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.