Back to projects

Map

2023archived

Biometric RAG system syncing Apple Health with Google Calendar to create adaptive schedules based on physical energy levels.

// GitHub

View Repository
235 commits
Last commit 9 months ago
TypeScript

// Problem

Knowledge workers struggle to optimize their daily schedules around their actual energy levels. Calendars are filled reactively—meetings get scheduled wherever there's an opening, deep work gets squeezed in between calls, and rest is an afterthought. The result? You're doing your hardest thinking when you're exhausted and sitting in low-stakes meetings during your peak hours. Existing tools don't account for the physiological reality that your cognitive capacity fluctuates dramatically throughout the day based on sleep quality, recovery, and circadian rhythms.

// Solution

An AI-powered calendar assistant that bridges the gap between your body and your calendar. By syncing biometric data from WHOOP and Apple Health with Google Calendar, Map could understand when you're actually ready for deep work versus when you should be in meetings or resting. The AI assistant used tool-calling to answer questions about your schedule, help prioritize tasks, and intelligently suggest optimal time blocks based on your sleep recovery scores.

// What I Built

Map was an ambitious monorepo containing four interconnected apps: a Next.js dashboard for calendar and task management, an Express API handling Google Calendar sync, Supabase Edge Functions for background jobs, and a marketing website. The core experience was a unified productivity interface where your calendar, tasks, goals, and notes lived together—with an AI chat assistant that could query and manipulate all of it. I built a complete two-way Google Calendar sync with incremental updates, a comprehensive task management system with projects and dependencies, and laid the groundwork for health data integration from WHOOP.

// Technologies

Next.js 14 + React Server Components

App Router with RSC for streaming AI responses directly to the UI, enabling real-time tool execution results

Supabase

PostgreSQL with Row Level Security, Edge Functions for background jobs, and real-time subscriptions for live updates

Vercel AI SDK + OpenAI

Tool-based AI architecture where the LLM could call functions to fetch calendar data, query tasks, and generate insights

Google Calendar API

Full two-way sync with support for incremental updates via sync tokens, webhooks for real-time changes, and multi-calendar support

Turborepo

Monorepo orchestration for the dashboard, Express API, Edge Functions, and shared packages (UI, types, queries)

// Lessons Learned

  • 01Consumer health is a brutal market to crack. The friction of connecting health devices, granting permissions, and trusting an app with biometric data creates massive drop-off at every step.
  • 02Writing multi-agent workflows in 2023 was genuinely painful. Token management was inconsistent, model performance varied wildly between runs, and I spent more time debugging agent behavior than building features.
  • 03I went deep on RAG fundamentals—chunking strategies, embedding models, vector search with pgvector—only to watch much of that complexity become unnecessary as models got better at longer contexts.
  • 04Building my own calendar component from scratch taught me a lot about date math edge cases, but I should have just used a library. The timezone handling alone took weeks.
  • 05The techniques I learned (tool-calling, streaming UIs, background job orchestration) transferred directly to later projects, even if this specific product didn't ship.