Calendar-to-Brain

Google Calendar events synced into raw/calendar/ as daily markdown files. Years of meeting history become searchable relationship data.

Why This Matters

Calendar data is the richest source of relationship history. Years of events tell you who you've met with, how often, where, and with whom. When someone emails you, the wiki already knows your meeting history. When you have a meeting tomorrow, the agent pulls attendee context automatically.

Adapted from gbrain's calendar-to-brain recipe, integrated into the kevin-wiki filesystem-native architecture. Source: scripts/sync-calendar.ts; recipes/calendar-to-brain.md

How It Works

Google Calendar API  sync-calendar.ts  raw/calendar/{YYYY}/{YYYY-MM-DD}.md → agent compiles → wiki/

The collector is deterministic: pagination, attendee filtering, date formatting are all code, not LLM. Agent judgment comes after, when compiling raw files into wiki pages.

Usage

npx tsx scripts/sync-calendar.ts --auth          # first-time OAuth setup
npx tsx scripts/sync-calendar.ts                  # sync last 7 days
npx tsx scripts/sync-calendar.ts --days 30        # last 30 days
npx tsx scripts/sync-calendar.ts --start 2022-01-01 --end 2026-04-12  # backfill

Requirements

  • Google Cloud project with Calendar API enabled
  • OAuth2 credentials (Desktop app type)
  • Environment variables: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET

Smart Chunking

API calls use monthly chunks for sparse years (pre-2024) and weekly chunks for dense periods. This minimizes API calls: ~96 calls for 8 sparse years vs. ~600+ with weekly.

Cost

$0/mo - Google Calendar API is within free quota for personal use.


Timeline