This guide demonstrates how to build a voice-based tutor agent that can teach, explain concepts, and help students with various subjects using Pipecat for real-time communication and Sarvam AI for speech processing. Perfect for EdTech platforms, online tutoring, and educational applications serving Indian students.
A tutor agent that can:
.env file with your API keysCreate a file named .env in your project folder and add your API keys:
Replace the values with your actual API keys.
Create tutor_agent.py:
The agent will create a Daily room and provide you with a URL to join.
Open the provided Daily room URL in your browser and start speaking. Your tutor will listen and respond!
For Hindi-medium students:
For diverse student populations:
When students speak in regional languages but you want English processing:
Male (23): Shubh (default), Aditya, Rahul, Rohan, Amit, Dev, Ratan, Varun, Manan, Sumit, Kabir, Aayan, Ashutosh, Advait, Anand, Tarun, Sunny, Mani, Gokul, Vijay, Mohit, Rehan, Soham
Female (14): Ritu, Priya, Neha, Pooja, Simran, Kavya, Ishita, Shreya, Roopa, Tanya, Shruti, Suhani, Kavitha, Rupali
Customize the voice for better teaching experience:
Pipecat uses a pipeline architecture where data flows through a series of processors:
mode="transcribe", or translation to English via mode="translate")language="unknown" to support students who code-mix (Hinglish, Tanglish, etc.)ishita for teachinggpt-4o for better reasoning on complex problemsAPI key errors: Check that all keys are in your .env file and the file is in the same directory as your script.
Module not found: Run the installation command again based on your operating system.
Poor transcription: Try language="unknown" for auto-detection, or specify the correct language code.
Connection issues: Ensure you have a stable internet connection and the transport is properly configured.
Happy Building!