Skip to content

The Calendar AI Assistant is an intelligent chatbot UI 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 for best practices for LLM-powered automation.

Notifications You must be signed in to change notification settings

bahathabet/calendar-openai-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

📆 Calendar AI Assistant

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.

✨ Features

  • 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.

🧠 Highlights

  • 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 Tools Overview

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

🚀 Install requirements and enjoy running the notebook

Clone the repository

git clone https://github.com/bahathabet/calendar-openai-agent.git
cd calendar-openai-agent

Install dependencies

pip install -r requirements.txt

Set up environment variables

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

🔐 Google Calendar Setup

To enable access to your calendar:

  1. Go to the Google Cloud Console.
  2. Create a new project or select an existing one.
  3. Enable the Google Calendar API.
  4. Go to "Credentials" and create OAuth 2.0 Client ID credentials.
  5. Set the application type to Desktop App.
  6. Download the credentials.json file and place it in the root of your project.
  7. On first run, the script will guide you through authentication and store token.json.

🧪 Prompt Design Example

What are my upcoming events?
✅ Calls get_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
✅ Calls delete_calendar_event()


🧠 How to Install and Run Ollama Locally

📜 License

MIT License.

Made with ❤️ using OpenAI Agents SDK + Google Calendar API.

About

The Calendar AI Assistant is an intelligent chatbot UI 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 for best practices for LLM-powered automation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published