The Calendar AI Assistant is an intelligent chatbot interface for managing your Google Calendar. It uses the OpenAI Agents SDK and integrates with Google Calendar APIs to offer natural language access to your schedule.
This assistant is designed with clean prompt engineering and robust function tooling, demonstrating best practices for LLM-powered task automation.
- View upcoming events for the next 10 days
- Search events by title
- Schedule new events by collecting structured inputs
- Delete events by ID
All powered by your favorite LLMs (OpenAI GPT-4o, DeepSeek, Claude, LLaMA locally) via OpenAI-compatible endpoints.
- ✅ Prompt Engineering Excellence: A carefully crafted system prompt ensures task adherence, precise output formatting, and guardrails against hallucinations.
- 🔧 Function Tools: Modular
function_tool
decorators enable secure execution of calendar operations. - 📆 Google Calendar Integration: List, create, search, and delete events using the Google Calendar API.
- 💬 Gradio Interface: Chatbot interface with clear instructions, async agent calls, and session-specific memory.
- 🔄 Multi-Agent Support: Easily switch between agents from GPT to Claude, DeepSeek, or LLaMA (localhost).
Function | Description |
---|---|
get_calendar_events() |
Lists events in the next 10 days |
find_calendar_event_by_title(title) |
Searches events by keywords in the title |
schedule_calendar_event(input) |
Schedules new events by structured input |
delete_calendar_event(event_id) |
Deletes an event using the event ID |
git clone https://github.com/bahathabet/calendar-openai-agent.git
cd calendar-openai-agent
pip install -r requirements.txt
Make sure your .env
file includes the following keys:
OPENAI_API_KEY=your_openai_key
GOOGLE_API_KEY=your_google_key
DEEPSEEK_API_KEY=your_deepseek_key
ANTHROPIC_API_KEY=your_anthropic_key
To enable access to your calendar:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Enable the Google Calendar API.
- Go to "Credentials" and create OAuth 2.0 Client ID credentials.
- Set the application type to Desktop App.
- Download the
credentials.json
file and place it in the root of your project. - On first run, the script will guide you through authentication and store
token.json
.
What are my upcoming events?
✅ Callsget_calendar_events()
Schedule a meeting titled "Team Sync" tomorrow at 10am with [email protected]
✅ Guides user to provide structured event input
Delete event with ID
abcd1234
✅ Callsdelete_calendar_event()
Made with ❤️ using OpenAI Agents SDK + Google Calendar API.