๐๏ธ PlanAI
Your AI-Powered Group Calendar Assistant
The intelligent command center that unifies your chaotic communication channels into one seamless schedule.
๐ฏ The Problem We Solve
Students today are drowning in information scattered across multiple platforms:
| Channel | Problem |
|---|---|
| ๐ง Official Emails (coming soon) | Important deadlines buried in long chains |
| ๐ฌ Telegram Groups | Event details lost in 500+ unread messages |
| ๐ Calendar Apps (coming soon) | Empty because manual entry is tedious |
| ๐ง Human Memory | Unreliable for tracking multiple commitments |
The Market Gap
Traditional calendar apps are passive storage binsโthey only work if you manually enter every event. But students receive scheduling information through conversations, not forms.
PlanAI bridges this gap by acting as an active AI agent that:
- ๐ Listens to your group chats for event mentions
- ๐ง Understands natural language ("let's meet tomorrow at 2pm")
- ๐ Researches the web for deadlines you might miss
- โ ๏ธ Warns you about schedule conflicts in real-time
- ๐ฒ Proactively reminds you of tomorrow's events every night
โจ Key Features
1. ๐ Passive Group Chat Listener
Never miss an event mentioned in your group chats again
Add PlanAI to any Telegram group, and it will automatically:
- Detect event-related messages using AI
- Extract event details (time, location, title)
- Check for schedule conflicts
- Send you a private notification (no group spam!)
๐ฅ Group Chat:
"Let's meet tomorrow at 2pm at COM1"
๐ค PlanAI (privately to you):
โ
Event Added!
๐ Meeting
๐ Jan 18, 2:00 PM
๐ COM1
2. ๐
/agenda - Daily Dashboard
See your entire day at a glance
Command: /agenda or "what is my plan today?"
๐
Your Agenda for Saturday, January 18, 2026
09:00 - CS2103T Lecture
๐ I3 Auditorium
14:00 - Team Meeting
๐ COM1-0210
16:00 - Gym Session
18:00 - Dinner with Friends
๐ UTown
โ ๏ธ CONFLICT
Design Principles:
- โ Celebratory empty state ("No events! Enjoy your free time!")
- โ Visual timeline with bold times
- โ Location shown only when available
- โ Clear conflict warnings
3. ๐ต๏ธ /track - Active Research Mode
Let AI find deadlines for you
Don't know the important dates? PlanAI searches the web and extracts deadlines automatically.
Command: /track [topic]
/track CS2103 deadlines
๐ Research Complete: CS2103 deadlines
๐ Found 5 events:
1. CS2103 PE-D
๐
Mar 21, 2026, 4:00 PM
2. CS2103 Final Exam
๐
Apr 26, 2026, 9:00 AM
3. Team Project Submission
๐
Apr 15, 2026, 11:59 PM
...
โ
Added to your calendar!
๐ Source: Web Research
4. ๐ง Statefulness - Smart Update Detection
Context-aware conversations
PlanAI remembers the last event discussed in each group and intelligently handles updates:
๐ค "Meeting tomorrow at 2pm at COM1"
๐ค โ
Event saved!
๐ค "Actually, change it to 3pm"
๐ค โ
Event Updated!
โฐ Time: Jan 18, 2PM โ Jan 18, 3PM
Not confused by new events:
๐ค "Dinner at 7pm tomorrow"
๐ค โ
New event saved! (not an update)
5. ๐ Nightly Briefing
Proactive reminders at 9 PM
Every night at 9 PM (Singapore time), PlanAI sends you tomorrow's schedule:
๐ Tomorrow's Schedule
๐
Sunday, January 19, 2026
You have 3 events tomorrow:
09:00 - CS2103T Lecture
๐ I3 Auditorium
14:00 - Team Meeting
๐ COM1-0210
18:00 - Dinner with Friends
๐ UTown
๐ช Busy day ahead! You've got this!
Demo Command: /force_briefing - Test the nightly briefing instantly
6. โ ๏ธ Real-Time Conflict Detection
Never double-book yourself again
When adding any event, PlanAI automatically checks for overlapping schedules:
โ ๏ธ CONFLICT DETECTED
Your new event overlaps with:
1. CS2103T Lecture (Jan 18, 2:00 PM)
๐ก Please choose a different time.
7. ๐ Web Enrichment
Automatic context for your events
When you add an event, PlanAI searches the web for relevant information:
โ
Event Added!
๐ CS2103T Lecture
๐ Jan 24, 2:00 PM
๐ I3 Auditorium
๐ More Information
โ https://nus-cs2103.github.io/website/
8. ๐๏ธ /clearall - Clear Your Day & Rest!
When you need a break from productivity
Sometimes you just need to clear your schedule and take a day off. PlanAI understands!
Command: /clearall
๐๏ธ Cleared 4 events...
๐ฅ KABOOM! Your to-do list has exploded into confetti!
๐ Congratulations! You've unlocked: FREE TIME! ๐
Quick, do nothing before responsibilities find you! ๐โโ๏ธ
Remember: You can't be late if you have nowhere to be *taps head*
Features:
- โ Clears all events for today
- โ Random goofy messages encouraging you to rest
- โ Smart empty state detection ("Your schedule was already empty. You absolute legend. ๐")
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TELEGRAM โ
โ (Groups + Private DMs) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI Webhook โ
โ (app/api/webhook.py) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Message Router โ
โ (app/bot/router.py) โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Private Chat โ โ Group Chat โ โ
โ โ (Master Hub) โ โ (Listener) โ โ
โ โ โ โ โ โ
โ โ โข /agenda โ โ โข Event Detection โ โ
โ โ โข /track โ โ โข Update Detection โ โ
โ โ โข /clearall โ โ โข Conflict Checking โ โ
โ โ โข /force_brief โ โ โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Layer (OpenAI GPT-4o) โ
โ (app/core/llm.py) โ
โ โ
โ โข extract_event_from_text() - Natural language โ Event โ
โ โข detect_update_intent() - Is this an update? โ
โ โข check_event_intent() - Fast keyword filter โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Research Agent (Tavily) โ
โ (app/core/agent.py) โ
โ โ
โ โข scavenge_events() - Web search โ Events โ
โ โข enrich_event() - Add web context โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Supabase (PostgreSQL) โ
โ (app/services/crud.py) โ
โ โ
โ โข save_event_to_db() - With conflict detection โ
โ โข get_events_by_date() - For /agenda & briefings โ
โ โข update_event() - For statefulness updates โ
โ โข delete_events_by_date() - For /clearall command โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Quick Start
Prerequisites
- Python 3.10+
- Telegram Bot Token (from @BotFather)
- OpenAI API Key
- Supabase Project (free tier works!)
- Tavily API Key (for web search)
Installation
# Clone the repository
git clone https://github.com/dannylhk/PlanAI.git
cd PlanAI
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Configuration
Create a .env file in the project root:
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
OPENAI_API_KEY=your_openai_api_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
TAVILY_API_KEY=your_tavily_api_key
Database Setup
Create an events table in Supabase:
CREATE TABLE events (
id SERIAL PRIMARY KEY,
title TEXT NOT NULL,
start_time TIMESTAMP NOT NULL,
end_time TIMESTAMP,
location TEXT,
description TEXT,
source TEXT DEFAULT 'telegram',
context_notes TEXT,
web_enrichment TEXT,
user_id BIGINT,
created_at TIMESTAMP DEFAULT NOW()
);
Running the Server
# Development mode with auto-reload
uvicorn main:app --reload --port 8000
# Production mode
uvicorn main:app --host 0.0.0.0 --port 8000
Setting Up Telegram Webhook
curl -X POST "https://api.telegram.org/bot<YOUR_TOKEN>/setWebhook?url=https://<YOUR_DOMAIN>/api/telegram"
๐งช Test Cases - Try These in Your Telegram!
Test 1: Basic Event Creation
In a group chat with the bot:
Let's meet tomorrow at 2pm at COM1
Expected: Private notification with event details
Test 2: Event Update (Statefulness)
After Test 1, in the same group:
Actually, change it to 3pm
Expected: Update confirmation showing time change
Test 3: New Event Detection
After Test 2, in the same group:
Dinner at 7pm at UTown
Expected: New event created (not treated as update)
Test 4: Conflict Detection
In a group chat:
Meeting at 3pm tomorrow at NUS
If you already have an event at 3pm: Expected: Conflict warning with existing event details
Test 5: Daily Agenda
In private chat with bot:
/agenda
Expected: Beautiful timeline of today's events
Test 6: Natural Language Agenda
In private chat with bot:
what is my plan today?
Expected: Same agenda output as /agenda
Test 7: Active Research
In private chat with bot:
/track NUS academic calendar 2026
Expected: List of academic deadlines added to your calendar
Test 8: Force Nightly Briefing
In private chat with bot:
/force_briefing
Expected: Tomorrow's schedule preview
Test 9: Empty State
In private chat (with no events today):
/agenda
Expected: ๐ No events scheduled for today. Enjoy your free time!
Test 10: Location Enrichment
In a group chat:
CS2103T lecture tomorrow at 2pm at I3
Expected: Event card with web enrichment link to course website
Test 11: Clear All Events
In private chat with bot:
/clearall
Expected: All today's events cleared + goofy rest message encouraging you to relax
Test 12: Clear All (Empty State)
In private chat (with no events today):
/clearall
Expected: Message saying "Your schedule was already empty. You absolute legend. ๐"
๐ Project Structure
PlanAI/
โโโ main.py # FastAPI entry + APScheduler (9 PM briefing)
โโโ requirements.txt # Python dependencies
โโโ .env # Environment variables (not in git)
โ
โโโ app/
โ โโโ api/
โ โ โโโ webhook.py # Telegram webhook endpoint
โ โ
โ โโโ bot/
โ โ โโโ router.py # Message routing brain
โ โ โโโ responses.py # Telegram message formatting
โ โ โโโ briefing.py # Nightly briefing logic
โ โ โโโ date_utils.py # Date formatting utilities
โ โ โโโ utils.py # Helper functions
โ โ
โ โโโ core/
โ โ โโโ llm.py # OpenAI GPT-4o integration
โ โ โโโ agent.py # Web search agent (Tavily)
โ โ โโโ prompts.py # LLM system prompts
โ โ
โ โโโ schemas/
โ โ โโโ event.py # Pydantic Event model
โ โ
โ โโโ services/
โ โโโ crud.py # Database operations
โ โโโ db.py # Supabase client
โ
โโโ tests/
โโโ test_agenda.py # /agenda feature tests
โโโ test_briefing.py # Nightly briefing tests
โโโ test_track.py # /track command tests
โโโ test_statefulness.py # Update detection tests
โโโ test_conflict_fix.py # Conflict detection tests
๐ ๏ธ Technologies
| Technology | Purpose |
|---|---|
| FastAPI | High-performance async web framework |
| Telegram Bot API | User interface via httpx |
| OpenAI GPT-4o | Natural language understanding |
| Tavily | Web search for deadline research |
| Supabase | PostgreSQL database with real-time |
| APScheduler | Cron jobs for nightly briefings |
| Pydantic | Data validation & schemas |
| pytz | Singapore timezone handling |
๐ฏ What Makes PlanAI Different?
| Feature | Traditional Calendars | PlanAI |
|---|---|---|
| Event Entry | Manual typing | Automatic from chat |
| Conflict Check | After booking | Real-time prevention |
| Deadline Discovery | You search | AI searches for you |
| Daily Reminder | Generic notification | Personalized briefing |
| Group Events | Everyone enters separately | One person mentions, all synced |
| Context Awareness | None | Remembers last event |
| Web Integration | None | Auto-enriches with links |
๐ฎ Future Roadmap
- [ ] ๐ง Email parsing for official university announcements
- [ ] ๐ Two-way sync with Google Calendar
- [ ] ๐ฅ Shared group calendars
- [ ] ๐ Custom reminder times
- [ ] ๐ Analytics dashboard
- [ ] ๐ Multi-timezone support
๐ฅ Contributors
| Role | Responsibility |
|---|---|
| Member A | LLM Integration, Web Research Agent, Database Layer |
| Member B | Bot UX, Message Routing, Telegram Integration |
๐ License
MIT License - feel free to use and modify!
Built with โค๏ธ at Hack&Roll 2026
Because your schedule shouldn't be another thing to worry about.
Log in or sign up for Devpost to join the conversation.