Repository navigation
💡 New script: gmail-travel-itinerary (Gemini-powered travel booking extraction to Sheets & Calendar) #550
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Extract flight, hotel, and car rental confirmations from Gmail using Gemini structured output, consolidating multi-provider travel bookings into a unified Google Sheet (with dates, confirmation numbers, costs) and optionally creating Calendar events for each trip leg. Follows the project's label-scoped processing pattern.
Market Signal
Travel itinerary extraction is explicitly identified as an underserved category in the personal productivity AI market. TripIt (SAP Concur) is enterprise-focused and requires email forwarding. Google's native travel cards in Gmail are basic and non-exportable. No Workspace-native tool consolidates multi-provider bookings into a structured Sheet or Calendar. UK Making Tax Digital (April 2026) drives automated travel expense tracking. Competitors (SaneBox, Superhuman, etc.) charge $7-36/month and don't offer travel-specific extraction. The Vertex AI Advanced Service reaching GA in Apps Script (January 2026) makes Gemini-powered parsing a first-class capability.
User Signal
The gmail-receipt-tracker idea (#534) already tracks financial transactions from email — travel itinerary extraction is the natural companion for a different data type (logistics vs. finances). No existing idea covers travel-specific extraction. The project's gmail-ai-classifier (merged as PR #492) demonstrates the Gemini-powered email parsing pattern this script would extend. The label-scoped processing architecture from gmail-to-drive-by-labels provides the proven input pipeline.
Technical Opportunity
Leverages the project's proven architecture: label-scoped Gmail processing (from gmail-to-drive-by-labels), Gemini structured output (from gmail-ai-classifier via Vertex AI), and Sheet output (from calendar-to-sheets). The dual-file pattern (code.gs + src/index.js) with dependency injection enables comprehensive testing of parsing logic. Start with major providers (United, Delta, American, Marriott, Hilton, Hertz) and expand. A validation layer (similar to
validateClassificationin the classifier) catches hallucinated dates or confirmation numbers.Assessment
Adversarial Review
Strongest objection: Email format diversity across airlines, hotels, and rental companies makes reliable extraction very difficult. Gemini could hallucinate dates or confirmation numbers, and non-English confirmations add complexity.
Rebuttal: Gemini 3.5 Flash's structured output handles diverse formats well — the gmail-ai-classifier already proves this pattern works in this codebase. The script starts with a focused set of major providers and uses a validation layer to catch hallucinations. Label-scoping means users explicitly mark travel emails, reducing the search space. Even imperfect extraction (90% accuracy) saves significant manual data entry versus the alternative of zero automation.
Suggested Next Step
Create a design spike: catalog the email formats of the top 5 airlines and top 5 hotel chains, define the Gemini extraction prompt and JSON schema (departure city, arrival city, date, time, confirmation number, cost), and validate extraction accuracy on sample emails before full implementation.
All reactions