Elena is an intelligent voice assistant built with Google's Agent Development Kit (ADK) that seamlessly integrates with Google Calendar. She can help you manage your schedule through natural voice conversations, making calendar management effortless and intuitive.
- π€ Voice-First Interface: Natural voice interactions with real-time speech recognition
- ποΈ Google Calendar Integration: Full CRUD operations on your calendar events
- π€ AI-Powered: Built on Google's Gemini 2.0 Flash model for intelligent responses
- π Web Interface: Beautiful, responsive web UI for both voice and text interactions
- β‘ Real-time Streaming: Live audio streaming with WebSocket connections
- π Secure Authentication: OAuth 2.0 integration with Google Calendar API
- π View Events: "What's on my calendar today?" or "Show me next week's schedule"
- β Create Events: "Schedule a meeting with John tomorrow at 2 PM"
- βοΈ Edit Events: "Reschedule my dentist appointment to Friday at 3 PM"
- ποΈ Delete Events: "Cancel my 3 PM meeting"
- π Find Free Time: "Find a 30-minute slot tomorrow for a meeting"
- π Multi-Calendar Support: Work with multiple calendars simultaneously
calendar-voice-assistant/
βββ app/
β βββ Elena/
β βββ agent.py # Main AI agent configuration
β βββ tools/
β βββ calendar_utils.py # Google Calendar API utilities
β βββ create_event.py # Event creation functionality
β βββ delete_event.py # Event deletion functionality
β βββ edit_event.py # Event editing functionality
β βββ list_events.py # Event listing functionality
βββ static/
β βββ index.html # Web interface
β βββ js/
β βββ app.js # Main application logic
β βββ audio-player.js # Audio playback functionality
β βββ audio-recorder.js # Audio recording functionality
β βββ pcm-player-processor.js # Audio processing
β βββ pcm-recorder-processor.js # Recording processing
βββ main.py # FastAPI server and WebSocket handling
βββ setup_calendar_auth.py # Google Calendar authentication setup
βββ requirements.txt # Python dependencies
- Python 3.8 or higher
- Google AI Studio account for Gemini API
- Google Cloud Project with Calendar API enabled
# Clone the repository
git clone https://github.com/HarshTomar1234/Calendar-Voice-Assistant
cd calendar-voice-assistant
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the project root:
GOOGLE_API_KEY=your_gemini_api_key_here-
Create Google Cloud Project:
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google Calendar API
-
Create OAuth Credentials:
- Navigate to "APIs & Services" > "Credentials"
- Create OAuth 2.0 client ID for "Desktop application"
- Download credentials and save as
credentials.jsonin project root
-
Run Authentication Setup:
python setup_calendar_auth.py
# Start the development server
uvicorn main:app --reloadVisit http://localhost:8000 to access the web interface!
| Command | Description |
|---|---|
| "What's on my calendar today?" | View today's events |
| "Show me next week's schedule" | View upcoming week |
| "Schedule a meeting with Sarah tomorrow at 2 PM" | Create new event |
| "Reschedule my dentist appointment to Friday at 3 PM" | Edit existing event |
| "Cancel my 3 PM meeting" | Delete event |
| "Find a free 30-minute slot tomorrow" | Find available time |
You can also interact via text input for precise control:
Create a meeting titled "Team Standup" for tomorrow at 9 AM to 10 AM
Show my calendar for December 25th
Delete the event "Lunch with John" on Friday
The assistant uses Google's Puck voice by default. You can modify voice settings in main.py:
speech_config = types.SpeechConfig(
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(voice_name="Puck")
)
)Available voices: Puck, Charon, Kore, Fenrir, Aoede, Leda, Orus, and Zephyr.
- Default Calendar: Uses your primary Google Calendar
- Timezone: Automatically detected from your calendar settings
- Event Format: Supports both timed and all-day events
The application follows a modular architecture:
- Agent Layer: AI agent powered by Google ADK and Gemini
- Tools Layer: Calendar operations and utilities
- Web Layer: FastAPI server with WebSocket support
- Frontend: HTML/JavaScript interface with audio capabilities
- New Calendar Tools: Add functions to
app/Elena/tools/ - Agent Instructions: Modify
app/Elena/agent.py - Web Interface: Update
static/files - Server Logic: Modify
main.py
# Run the application
uvicorn main:app --reload
# Test WebSocket connection
# The web interface automatically handles connection testing- OAuth 2.0: Secure Google Calendar authentication
- Local Storage: Tokens stored securely in user directory
- Minimal Permissions: Only requests necessary calendar access
- No Data Storage: No personal data stored on server
| Issue | Solution |
|---|---|
| Authentication errors | Delete ~/.credentials/calendar_token.json and re-run setup |
| Audio not working | Check browser permissions and microphone access |
| Calendar not loading | Verify Google Calendar API is enabled |
| Voice not responding | Check Gemini API key in .env file |
Enable debug logging by setting environment variable:
export DEBUG=true
uvicorn main:app --reload --log-level debugGoogle Calendar API has usage limits:
- Free Tier: 1,000,000 requests/day
- Paid Tier: Higher limits available
- Monitoring: Check usage in Google Cloud Console
GET /: Main web interfaceWebSocket /ws/{session_id}: Real-time communication
list_events(start_date, days): List calendar eventscreate_event(summary, start_time, end_time): Create new eventedit_event(event_id, summary, start_time, end_time): Edit existing eventdelete_event(event_id): Delete eventget_current_time(): Get current date/time
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Google ADK for the agent framework
- Google Gemini for AI capabilities
- FastAPI for the web framework
- Google Calendar API for calendar integration
Made with β€οΈ using Google's Agent Development Kit
Elena - Your AI Calendar Assistant

