Enable live video roleplay with a photorealistic AI avatar that speaks, listens, and reacts in real time â powered by Tavus Conversational Video Interface (CVI).
When a learner clicks Video AI, the frontend calls your backend which calls the Tavus API to create a conversation. Tavus returns a conversation_url that gets embedded as an iframe. The avatar speaks in real time, hears the learner's mic, and stays in character using the scenario's system prompt.
Sign up or log in at platform.tavus.io â
Go to Settings â API Keys and create a new key. Copy it â you'll need it in Step 2.
Open your .env file (copy from .env.example if you haven't already) and set:
.gitignore. Use environment variables or a secrets manager in production.A Replica is the photorealistic avatar model. You can use:
Copy the replica_id (format: rf<hex>) and paste it as TAVUS_REPLICA_ID in your .env.
You can also set a per-scenario replica by storing tavus_replica_id on the scenario record in the admin panel.
.env.example (rf4e9d9790f0) is Tavus's public demo replica â it works but has limited daily minutes. Replace it with your own replica for production.A Persona holds the system prompt (scenario context, character personality, rules). You can create one per scenario so that starting a video session is instant.
After adding a scenario in the admin panel, call:
The persona ID is automatically saved on the scenario and used for all future video sessions for that scenario.
If no persona is pre-created, the system prompt is passed inline per session â slightly slower but fully functional.
Restart RolePilot:
Then:
Register your webhook in the Tavus dashboard under Settings â Webhooks:
Tavus will POST to this URL when a video session ends, sending the full transcript. RolePilot's /api/tavus/webhook handler receives this and can trigger the AI report generation.
ngrok http 8000TAVUS_API_KEY is not set or invalid â check your .env; (2) TAVUS_REPLICA_ID doesn't exist in your account; (3) The replica has no minutes remaining on the free plan.TAVUS_API_KEY environment variable is empty. Open your .env file and add it, then restart the server with python run.py.<iframe> tag in session.html already includes allow="camera; microphone; autoplay; display-capture". If it still doesn't work, check your browser's site permissions â some browsers require HTTPS for camera access. Use a local HTTPS proxy or deploy to a domain with TLS.