LiveKit Setup Guide
Analyze call recordings from LiveKit
Overview
Integrating LiveKit with Roark enables automatic analysis of audio call recordings. After each call, audio recordings and related metadata are made available to Roark. Roark processes this data to evaluate assistant or participant behavior and analyze tool usage and conversation flow.
Prerequisites
Before setting up the integration, ensure you have:
- ✅ A Roark API Key - Generate one here
- ✅ A LiveKit account and project – Create one here
- ✅ A storage bucket from a provider of your choice (e.g., AWS, Azure, GCP)
- ✅ A voice assistant running on LiveKit Cloud or a self-hosted LiveKit instance
- ✅ A webhook endpoint up and running and configured in the LiveKit dashboard settings page - LiveKit Webhook Documentation
Install Required Packages
Environment Setup
Configure these environment variables:
LiveKit Recording
LiveKit does not store call recordings by default. To enable recording, you need to explicitly start an egress session using the LiveKit Egress API. This setup guide walks you through the steps required to configure recording and send audio data to Roark for analysis.
For more details on LiveKit’s Egress API, refer to the official documentation.
In this example, we’ll use AWS S3 to store the recordings. To get started, you’ll need the following:
- Your LiveKit API credentials (API Key and Secret)
- A valid AWS S3 bucket and AWS credentials
- The name of the LiveKit room you want to record
Once everything is set up, you can call the Egress API to start recording and store the audio in your S3 bucket.
Stopping the Recording in LiveKit
Once the session ends, you should stop the recording to ensure it is properly saved to your storage provider. This action will also trigger the egress_ended webhook event, which includes the recording URL.
When stopping the egress session, make sure you reference the correct room name that was used to start the session.
For more details on available LiveKit webhook events, see the webhook documentation.
LiveKit Webhook Integration
LiveKit provides webhooks that notify you about changes in the room, participants, and egress sessions. In our case, when you stop the recording using the Egress API, the egress_ended event will be triggered. This event includes the URL of the recording uploaded to your S3 storage.
The implementation for handling this webhook event is as follows:
S3 Acccess
LiveKit does not support S3 pre-signed URLs. Therefore, once your recording is uploaded to your own S3 bucket, you should generate a signed URL yourself to provide secure, time-limited access to the file. This ensures that only authorized users can access the recording without exposing it publicly.
Get participants info from LiveKit
To send a call to evaluate using Roark, you need participant information from the session. You can retrieve participant details by using the LiveKit SDK.
Send call to evaluate using Roark
Final step, once you have gathered all the necessary data, map it to the format required by the Roark SDK before sending. Below is an example of what the complete implementation should look like.
🎉 You’re all set! Your LiveKit assistant is now integrated with Roark.
Need help? Contact Roark Support