
Deploy a live kid ai agent on AWS EC2 integrated with a clinic website to answer services and address, and to book appointments with calendar updates and email notifications.
Build and deploy a full-stack voice AI agent on AWS using LiveKit, MCP, and n8n, from EC2 setup to domain, SSL, and real-time web integration.
Set up an AWS EC2 Ubuntu server in the Asia Pacific Mumbai region, launching the latest Ubuntu image on a suitable instance type and allocating 30 GB storage.
Connect to your AWS EC2 instance via MobaXterm using SSH with a private key, update packages, install Python, pip, and venv, and create your AI project directory.
Create the project directory and four essential files—requirements.txt, prompts.py, agent.py, and .env—outlining Python dependencies, AI prompt templates, the LiveKit agent, and secure environment variables.
Create and activate a dedicated Python virtual environment to prevent conflicts with other projects, install the venv module, and use source bin/activate to enter the environment.
Learn how LiveKit serves as an open source real-time communication platform to stream audio between users and AI agents, enabling voice-enabled interactions on websites, WhatsApp, and apps.
Adopt LiveKit for real-time voice communication, an open source platform that enables a low-latency, secure voice ai agent with SDKs, easy model integration, and scalable hosting on AWS or GCP.
Explore LiveKit documentation to configure a voice AI agent and build a voice assistant in less than ten minutes using Python backend and AI models such as OpenAI and Artesia.
Prepare the server for life kit des agents by listing dependencies in a requirements file, including life kit des plugins for OpenAI, noise cancellation, dotenv, and pedantic-slim, then install.
Create a LiveKit account, set up a new project, generate APIs (websocket url, api key, api secret), and populate a hidden .env file to connect your voice AI agent.
Log in to OpenAI, create API keys, and add credit to power the LLM and TTS for your voice agent; configure Deepgram for speech-to-text and save keys in the .env.
Create a Deepgram account, generate and copy the api key, and configure it in the dot env file as deepgram_api_key for use in the project.
Set up the dot env file with Deepgram and OpenAI credentials for LiveKit plugins, install the required packages, and prepare to create agents using the official agent code.
Create the agent by using the LiveKit sample in agent.py, configure Deepgram and OpenAI settings, install dependencies, and run the script.
Access the voice AI agent via LiveKit Playground, fix Deepgram issues, and see an interactive agent respond to queries, with the next lecture showing prompts for an eye clinic.
Explore the prompts.py file that defines Neha, the Smart Eyecare receptionist, guiding her interactions on the Smart Eyecare website with correct Indian time formatting and explicit agent instructions.
Define Neha's hospital tasks by sharing doctor services, consultation charges, and clinic location, and reply 'I do not have that information' for non-hospital questions, following date rules and session instructions.
Define session instruction in prompts.py to create a clinic knowledge base for Neha, including doctor information, hours, charges, services, and address, plus a welcoming greeting for confident, receptionist-like responses.
Import agent_instruction and session_instruction from prompts.py into agent.py. Merge them into a combined_system_prompts and update reply generation so the assistant uses these rules and knowledge base.
This lecture demonstrates running a voice ai agent, returning clinic details, doctor timings, and services, while noting appointment booking is not yet trained and will be covered later.
Create a human-like ai avatar with towers for lip-sync and real-time reactions, connected via LiveKit for audio and video, using Deepgram for speech-to-text and OpenAI for smart replies.
Learn how AI avatar integration syncs lips and face to voice output using LiveKit for real-time streaming, with Deepgram speech-to-text, OpenAI text generation, and OpenAI TTS.
Create a tower's ai account, set up a personal assistant persona from a replica, and save the generated persona/replica id in your env file while creating the api.
Copy the Tavus persona ID and replica ID from Towers AI into the .env file, and set the entry named _API_KEY_ with the generated key.
Add avatar to agent.py by configuring avatar session data from the environment, including persona id, replica id, and API key, using os to start the session and join the room.
Rerun the voice AI agent by importing the towers plugin, installing dependencies, and starting the agent to verify the AI avatar readiness in the live kit playground.
Test the ai avatar in the LiveKit playground, fix minor errors, and watch Neha provide clinic details, including location, consultation charges, services, and doctor timings in real time.
Learn to run the AI agent as a systemd background service that boots automatically, stays running, and logs activity to /var/log by configuring a voice ai service file.
Integrate a live voice AI agent with a custom React frontend using LiveKit's open source starter, test locally on EC2, then deploy production with nginx and HTTPS.
Clone the Live Kit React starter project from GitHub, install node.js and npm, install frontend dependencies, and configure build time environment variables for the live voice ai agent.
Install frontend dependencies, set up dot env local with LiveKit APIs, and run npm run dev to start the React app in development mode, accessible at the EC2 public IP:3000.
Access the React frontend of the live Voice AI agent through the EC2 public IP and port 3000, with HTTP now and HTTPS with a custom domain planned.
Deploy your Next.js voice agent to production by building, fixing TypeScript or ESLint issues, and rebuilding. Use PM2 to keep the app running and verify deployment with the public IP.
Deploy a voice agent app to production by building the project and addressing types and eslint errors. Back up next.config.ts and run the app with pm2 in the background.
Install pm2 globally, start the Next.js app with pm2 start, load environment, and name the app; save the process, enable startup, and verify access via the web URL.
Verify deployment of the Next.js voice agent running under PM2, test via public IP and port, address the https error, and confirm the app is working for user interactions.
Purchase a domain from GoDaddy and configure DNS records to point to your EC2 instance, giving users a clean URL for your full-stack voice AI agent.
Configure a DNS A record to point your domain to your EC2 instance, using an elastic IP to prevent IP changes, then set up nginx and https for secure access.
Build your own end-to-end Voice AI Agent using LiveKit, n8n, and MCP — hosted on AWS.
This course guides you step by step in developing a real-time intelligent Voice AI system with automation, voice interaction, and web integration.
You’ll begin by setting up and configuring an Ubuntu server on AWS EC2, preparing your Python environment, and integrating LiveKit for real-time communication. Then, you’ll connect your AI Agent with n8n for workflow automation and MCP for multi-channel task handling — enabling features like voice-based appointment booking, email notifications, and calendar scheduling.
Once the backend is complete, you’ll build and deploy a React/Next.js frontend, secure it using NGINX and SSL certificates, and manage your application using PM2 and Systemctl .
By the end of the course, you’ll have a fully functional, secure, and automated Voice AI Agent deployed in a cloud environment.
Introduction
What You’ll Learn
System Setup on AWS EC2
Set Up and Configure an Ubuntu Server on AWS EC2
Connect to Your AWS EC2 Instance Using MobaXterm
Set Up the Project Directory
Set Up Python Virtual Env
LiveKit Essentials: Setup, API Keys, and Configuration
What is Livekit?
Why LiveKit for Our AI Project?
LiveKit Documentation Overview
Installing LiveKit and Its Dependencies
Create LiveKit Account
Set Up Your OpenAI API Key
Deepgram Account & API Setup
LiveKit Plugins Setup
Build and Test Your AI Agent in LiveKit
Build and Run the Agent Script (agent)
Access via LiveKit Playground
Integrate prompts. py with AI Agent
How prompts. py Works in the Project
Add Task Definition
Define Session Instruction
Update agent. py Based on prompts. py
Run Voice AI Agent
Integrating AI Avatars with Your Voice AI Agent
What is an AI Avatar?
How AI Avatar Integration Works
Tavus Account & Persona Setup
Add Tavus Persona IDs and APIs to .env
Add Avatar in agent. py
Rerun Voice AI Agent
Test AI Avatar via LiveKit Playground
Configure AI Agent as a Systemctl Service
Create a Systemctl Service File for the Voice AI Agent
Integrating LiveKit AI Agent with a Custom React Frontend
Integrate with React Frontend
Clone the React Project and Install Node.js
Run the React App in Development Mode
Access the React Frontend via EC2 Public IP
Deploy Next.js Frontend to Production Using PM2
Overview of Next. js Production Deployment
Build & Fix Build Issues
Run with PM2
Verfiy deployment
Purchase a Domain and Configure DNS Records
Purchase a Domain from Godaddy
Configure A Records
Secure the Application using NGINX and Let's Encrypt SSL
Overview of the Project
Set Up and Configure NGINX
Install Certbot Let’s Encrypt to Enable HTTPS
Verify HTTPS Access
Auto Renew SSL Certificates
Integrating AI Agent with n8n and MCP
Overview: AI Agent with n8n and MCP
Overview of n8n
What is MCP?
How It Works: AI Agent - MCP - n8n Flow
Modify Agent Configuration for MCP Server
Add an MCP Server Trigger Node in n8n
Add a Google Calendar Node in n8n
Fix Google Calendar Access
Add Another Google Cal Node
Add MCP Server URL in .env File on Server
Restart Agent and Verify n8n Integration
Modify prompts. py for Appointment Booking Flow
Book an Appointment with Voice AI Agent
Booking Validation: Prevent Double Appointments
AI Agent: Book the Appointment and Send Email Notification
Add a Gmail Node in n8n workflow
Set the Parameters in Gmail Node in n8n
Modify prompts. py for Email Notifications
Test the Voice AI Agent: Book Appointment and Send Email Notification
Integrate the Voice AI Agent with a Website (Smart Eye Clinic)
Overview of the Project
Clone Frontend Repo to Server
Build Frontend — From Dev to Prod
Run with PM2
Add LiveKit APIs to .env.local
Voice AI Testing — Smart Eye Clinic
Last Lecture