1. User joins LiveKit room
│
▼
2. Agent worker spawned (entrypoint.py)
│
▼
3. Agent fetches config from Studio API
(agent ID, prompt, providers, functions)
│
▼
4. Session initialized
├── STT pipeline started
├── LLM context loaded (with memory if configured)
├── TTS provider initialized
└── Tools registered
│
▼
5. Live conversation loop
├── STT: User audio → transcript
├── LLM: Transcript → response (+ optional function calls)
└── TTS: Response → audio
│
▼
6. Session end (user hangs up / end_call tool)
├── Recording uploaded to GCS
├── Transcript saved to DB
├── Post-call analysis triggered (if configured)
└── Billing event sent to Billing Service