A modern calendar booking application powered by Gemini AI, LangGraph, and Google Calendar API. This application allows users to interact with their calendar using natural language through an AI assistant.
The project is live on https://booking-ai-agent-aff7.onrender.com/ and you can view the changes in this calendar
- Natural Language Processing: Book meetings, list events, and check availability using conversational language (e.g., "Book a meeting tomorrow at 2 PM for 1 hour")
- AI-Powered Assistant: Built with Gemini AI and LangGraph for intelligent, context-aware responses
- Google Calendar Integration: Seamless integration with Google Calendar API
- Modern UI: Beautiful Streamlit frontend with real-time chat interface
- FastAPI Backend: Robust REST API with proper error handling
- Time Zone Support: All meetings are booked and displayed in IST (Asia/Kolkata, GMT+5:30)
- Edit Meetings: Update meeting details (title, time, description) or reschedule existing events
- List Upcoming Events: View all your upcoming meetings/events in a friendly format
- Real-time Status: Live monitoring of API and calendar connection status
- Frontend: Streamlit
- Backend: FastAPI
- AI/ML: Google Gemini AI, LangGraph
- Calendar: Google Calendar API
- Authentication: Google Service Account
- Python 3.8+
- Google Cloud Project with Calendar API enabled
- Google Service Account with Calendar permissions
- Gemini API Key
git clone <repository-url>
cd booking-ai-agent
pip install -r requirements.txt- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API
- Create a Service Account:
- Go to IAM & Admin > Service Accounts
- Click "Create Service Account"
- Download the JSON key file
- Place it in the root directory as
service_account.json
- Go to Google AI Studio
- Create a new API key
- Copy the API key
Create a .env file in the root directory:
# Google API Configuration
GOOGLE_API_KEY=your_gemini_api_key_here
GOOGLE_CALENDAR_ID=your_calendar_id_here
# Service Account Configuration
SERVICE_ACCOUNT_FILE=service_account.json
# API Configuration
API_URL=http://localhost:8000Note: For GOOGLE_CALENDAR_ID, use:
primaryfor your main calendar- Or the specific calendar ID from Google Calendar settings
Make sure your service account has access to the calendar:
- In Google Calendar, go to Settings
- Find your calendar and click "Share with specific people"
- Add your service account email (found in the JSON file)
- Grant "Make changes to events" permission
From the project root, run:
python start_app.py- The backend (FastAPI) will be available at
http://localhost:8000 - The frontend (Streamlit) will be available at
http://localhost:8501
The AI assistant can understand natural language requests like:
- "Book a meeting tomorrow at 2 PM for 1 hour"
- "Show me my calendar for next week"
- "Check if I'm free on Friday at 3 PM"
- "Schedule a team meeting next Monday at 10 AM"
- "What meetings do I have today?"
- "Edit my meeting on Friday to 4 PM and change the title to 'Project Review'"
- "List all my upcoming events"
GET /health
POST /chat
{
"message": "Book a meeting tomorrow at 2 PM"
}
GET /calendar/events?start_time=2024-01-15T10:00:00+05:30
POST /calendar/events
GET /calendar/availability?start_time=...&end_time=...
booking-ai-agent/
├── backend/
│ ├── main.py # FastAPI application
│ ├── langgraph_agent.py # LangGraph agent implementation
│ └── calendar_utils.py # Google Calendar utilities
├── frontend/
│ └── app.py # Streamlit frontend
├── requirements.txt # Python dependencies
├── service_account.json # Google service account (not in repo)
├── start_app.py # Startup script for backend & frontend
└── README.md # This file
All meetings are booked and displayed in IST (Asia/Kolkata, GMT+5:30) by default for maximum clarity and consistency.
You can customize the AI behavior by modifying the prompts and tools in backend/langgraph_agent.py.
-
"Calendar service not initialized"
- Check if
service_account.jsonexists and is valid - Verify the service account has calendar permissions
- Check if
-
"API Error: 401"
- Check if your Gemini API key is correct
- Verify the API key has proper permissions
-
"Connection Error"
- Ensure the backend is running on the correct port
- Check if the API_URL in the frontend matches the backend
To enable debug logging, set the environment variable:
export DEBUG=true- Google Gemini AI for the language model
- LangGraph for the agent framework
- Streamlit for the beautiful UI framework
- FastAPI for the robust backend framework