Skip to content
Hariom Pandey
Back to projects

Completed, 2025 · Built the application

Tasky

AI productivity assistant that turns natural-language requests into Google Calendar and Tasks actions.

A Next.js full-stack application connecting Google Calendar, Google Tasks, and Gmail. It uses OpenAI gpt-4o-mini agents to extract structured scheduling and task intents from conversational text, enabling one-click execution through Google APIs.

  • Next.js
  • MongoDB
  • Google APIs
  • OAuth 2.0
  • Clerk
  • OpenAI API

Problem & context

Personal productivity is fragmented across disconnected inboxes, calendars, and to-do lists. Extracting meeting details, scheduling reminders, and updating tasks from unstructured messages or natural-language prompts requires tedious manual entry and accurate relative date/time calculation.

Target users

Professionals and students seeking a unified dashboard to manage schedules, organize daily to-dos, and translate natural language instructions into actionable Google Calendar and Tasks entries.

My contribution

Built the full-stack application: Clerk authentication with Google OAuth integration, specialized agent modules for Calendar, Tasks, and Gmail, Google API client integration wrappers, Mongoose data models for chat history, and the interactive dashboard UI.

Core capabilities

  • Unified dashboard displaying live Google Calendar events and Google Tasks in a consolidated view
  • Natural-language intent parsing for Calendar actions (add_event, update_event, delete_event) and Task operations (create, update, delete)
  • Dynamic temporal context injection anchoring relative references ('tomorrow', 'next Friday at 3pm') to user local date, time, and timezone offset
  • AI interpreter agent translating complex Google API response JSON into clear, user-friendly conversational summaries
  • Email importance classification and advisory action suggestions ('Add to Calendar', 'Add to Tasks', 'No Action') for Gmail messages
  • Clerk-based authentication managing Google OAuth 2.0 access tokens for secure third-party API communication
  • Mongoose schemas storing user profiles, chat threads, and message exchanges in MongoDB

Architecture & data flow

Next.js full-stack architecture coordinating client dashboard views, Clerk OAuth token management, modular OpenAI gpt-4o-mini agents for intent extraction, and server-side utilities dispatching CRUD operations to Google Calendar and Tasks APIs.

System components

Next.js Dashboard & App Router

Next.js, React, Tailwind CSS

Renders interactive calendar views, task lists, email review panes, and conversational chat interfaces using React components.

Clerk & Google OAuth Layer

Clerk, OAuth 2.0

Authenticates user sessions and manages scoped Google OAuth 2.0 credentials required for Calendar, Tasks, and Gmail API access.

Specialized Intent Agents

OpenAI API (gpt-4o-mini)

Domain-specific prompt modules (calendar/extractAction.js, tasks/aiTasksAgent.js) that evaluate natural language and output strictly formatted single-line JSON action proposals.

AI Interpreter Agent

OpenAI API (gpt-4o-mini)

Converts raw JSON responses from Google APIs and email summaries into concise, natural-language feedback and suggested next actions.

Google API Client Layer

Google APIs Node Client

Server-side utility wrappers (googleCalendar.js, googleTasks.js, googleEmails.js) executing authorized CRUD operations using user OAuth tokens.

MongoDB State Store

MongoDB, Mongoose

Persists synchronized user metadata, conversational chat sessions, and message history.

Execution lifecycle

  1. User Prompt: User submits a natural-language instruction (e.g., 'Schedule team sync tomorrow at 10am' or 'Add finish lab report to tasks').
  2. Temporal Context Injection: The server calculates the user's current local date, time, and timezone offset (e.g., ISO timestamp and offset +05:30) and dynamically injects this temporal anchor into the system prompt.
  3. Structured Intent Extraction: gpt-4o-mini processes the anchored instruction and generates a single-line JSON payload specifying the action, target date, time, duration, and parameters.
  4. JSON Validation & Proposal: The server parses the LLM output via JSON.parse. If valid, the proposal is presented to the user via interactive action buttons (CalendarActionButton or TaskActionButton).
  5. User-Triggered API Execution: When the user confirms the action, the Next.js API route calls the authenticated Google Calendar or Tasks API on behalf of the user.
  6. Response Interpretation: The interpreter agent ingests the raw Google API confirmation JSON and translates it into a concise, natural sentence.
  7. State Persistence: The completed exchange and updated state are recorded in MongoDB and reflected on the unified dashboard.

Technical decisions

Dynamic Temporal Anchoring in Prompts

Language models lack inherent awareness of current time. Rather than asking users for absolute dates, the server calculates the exact local ISO date, time, and timezone offset on every request, allowing the model to accurately resolve relative phrases like 'tomorrow', 'this Friday', or 'in 2 hours'.

Separation of AI Intent Extraction from API Execution

Rather than granting the model autonomous write access to user calendars and tasks, Tasky decouples extraction from mutation. The LLM produces a structured JSON proposal; the user triggers execution through UI action buttons. This prevents unintended deletions or duplicate calendar events caused by hallucinations.

Modular Domain Agents vs. Monolithic Prompts

Calendar, Tasks, and Gmail workflows use dedicated agent modules with narrow, domain-specific system prompts. Partitioning instructions by domain significantly improves JSON schema compliance and reduces prompt token overhead.

Prompt-Engineered JSON Contract

Intent parsing relies on prompt-engineered JSON schema instructions parsed with JSON.parse rather than provider-locked function-calling or structured-output APIs, keeping the agent layer portable and straightforward to inspect.

Challenges & solutions

Relative Date and Timezone Ambiguity

Natural-language temporal inputs ('tomorrow morning', 'next Tuesday at 4pm') frequently produce incorrect dates without an anchor. Solved by calculating user timezone offsets and current ISO dates server-side and binding them directly into system prompts.

Translating Dense Technical Payloads for Users

Raw responses from Google Calendar and Tasks APIs are deeply nested JSON structures unsuitable for chat displays. Introduced a secondary interpreter agent that distills technical payloads into friendly, contextual status sentences.

Testing strategy

  • Route testing for Google API proxy endpoints and token handling
  • Prompt format verification ensuring gpt-4o-mini responses adhere to single-line JSON requirements

Verified outcomes

  • Unified dashboard integrating Google Calendar, Google Tasks, and Gmail with Clerk OAuth 2.0 authentication
  • Conversational assistant reliably transforming natural-language scheduling instructions into verified Google API operations

Trade-offs & limitations

  • Prompt-engineered JSON parsing: Structured outputs rely on system prompt instructions and JSON.parse rather than OpenAI's native tools/function-calling or JSON schema response_format APIs, meaning malformed responses can require retry
  • Advisory email actions: Gmail integration suggests calendar and task actions based on email content, but does not automatically schedule items without user confirmation
  • OAuth token lifecycle: Google API access relies on Clerk OAuth tokens; session expiration or revoked scopes require re-authenticating with Google
  • No live public demo: The application was built and evaluated in development with test Google accounts; no production deployment or live user metrics are published