Inspiration
We've all been there — five tabs open, a calendar app, a to-do list, a notes app, a document folder, and still missing meetings and forgetting context. The average knowledge worker switches between 9 different apps per day just to stay organized. We asked ourselves: what if one AI-native app understood all of it together? What if your calendar could read your documents, your tasks could re-prioritize themselves, and one chat message could replace ten manual actions? That frustration — and that question — is what built SmartCal AI.
What It Does
SmartCal AI is a unified AI-powered productivity platform that combines a smart calendar, task manager, notes system, and document knowledge base into one application — all controlled by a natural language AI agent.
- Smart Calendar — Create, manage, and sync recurring events across Google Calendar and Outlook. Drag, drop, and reschedule with conflict detection built in.
- AI Agent — Powered by LangChain and Google Gemini, the agent can schedule meetings, find free time, prioritize your tasks, answer questions from your uploaded documents, and prepare you for meetings — all from one chat message.
- RAG Pipeline — Upload any PDF, DOCX, or TXT file. SmartCal AI extracts, chunks, and embeds the content into ChromaDB using Gemini embeddings. Ask anything about your documents and get grounded, accurate answers — not hallucinations.
- Task Manager — A Kanban board with AI-driven priority scoring. One click re-ranks your entire to-do list by urgency, deadline, and effort using Gemini.
- Notes System — Rich text notes that are auto-embedded and semantically searchable. Find anything you wrote without remembering the exact words.
- Smart Notifications — AI-controlled reminders via WebSocket, browser push, email, and Slack. The system respects your quiet hours and only interrupts for what actually matters.
- Bonus Features — Focus Mode with Pomodoro timer, energy-aware scheduling, smart meeting prep briefs, weekly AI digest emails, habit streak tracking, voice input, and global semantic search across everything.
How We Built It
We built SmartCal AI as a full-stack application with a clean separation between the frontend, backend, and AI layer.
Frontend — Pure HTML, CSS, and Vanilla JavaScript. We used FullCalendar.js for the calendar grid, Quill.js for the rich text notes editor, and the Web Speech API for voice input. Real-time notifications are handled by a Socket.IO client connected to a WebSocket server. A registered Service Worker enables background push notifications and basic offline support.
Backend — FastAPI with full async support. We chose FastAPI over Flask for its native async capabilities, automatic OpenAPI documentation, and performance under concurrent AI streaming requests. SQLAlchemy 2.0 with asyncpg handles all PostgreSQL queries. Celery with a Redis broker powers background jobs — scheduled reminders, weekly digest emails, and calendar sync tasks.
AI Agent — A LangChain ReAct agent orchestrates everything. The agent is initialized with Google Gemini 1.5 Pro as the LLM and given access to 10 specialized tools: CreateEventTool, QueryCalendarTool, FindFreeSlotTool, CreateTaskTool, PrioritizeTasksTool, SearchKnowledgeTool, SummarizeDocumentTool, SetReminderTool, MeetingPrepTool, and WeeklyDigestTool. Responses stream token-by-token to the browser via Server-Sent Events for an instant, real-time feel.
RAG Pipeline — Documents are extracted using pymupdf and python-docx, chunked into 500-token overlapping windows, and embedded with Gemini text-embedding-004. Vectors are stored in ChromaDB with user-level metadata filtering for strict data isolation. The LangChain RetrievalQA chain retrieves the top 5 relevant chunks at query time and passes them as grounded context to Gemini.
Storage — PostgreSQL stores all structured data (users, events, tasks, notes, documents). ChromaDB persists all vector embeddings locally. Redis handles sessions, caching, Celery task queues, and WebSocket pub/sub for multi-worker notification delivery.
Integrations — Google Calendar API with OAuth2 for two-way sync, SendGrid for email notifications, Web Push API with VAPID keys for browser push, and Slack webhooks for team notifications.
Challenges We Ran Into
Streaming AI responses through FastAPI — Getting Server-Sent Events to stream LangChain agent tokens in real time through FastAPI was tricky. The agent's ReAct loop introduces intermediate thinking steps and tool calls that needed to be surfaced to the user without breaking the stream. We solved this by using sse-starlette and building a custom streaming callback handler in LangChain that emits tool-use steps as separate SSE events.
Per-user RAG isolation — ChromaDB collections are shared, so we needed to guarantee that one user could never retrieve another user's document chunks. We implemented strict metadata filtering on every ChromaDB query using user_id, and validated isolation at the service layer before any result reached the agent.
Recurring event expansion — Storing and rendering recurring events correctly is deceptively complex. We stored RRULE strings (iCalendar spec) in PostgreSQL and expanded instances dynamically at query time using the python-dateutil rrule parser, rather than pre-generating all instances. Handling "edit this event only vs. all future vs. all instances" required careful parent_event_id tracking and conditional update logic.
Built With
- chromadb
- css
- fastapi
- google-gemini-api
- html
- javascript
- langchain
- postgresql
- redis
Log in or sign up for Devpost to join the conversation.