Architecture

data sources, tool layer, and how the estimate is built← back to the desk
Departures analysed
145,890
Months of history
12
Destinations
83
Rotation pairs
1,017
Late-aircraft share
43%

Late-arriving aircraft cause 43% of all SFO departure delay minutes, but no departure board tells you where your aircraft is coming from. BTS on-time data carries a tail number per leg, so the rotation can be reconstructed offline.

OFFLINE — RUN ONCE, COMMITTED TO THE REPOBTS monthly7.05M US flightsextract.ts→ 291,860 SFO legsaggregate.tstail-rotation joinsfo-baserates.json1.2 MB, no runtime fetchVERCELlib/baserates.tsall arithmetic lives herelib/live.tskey-free public feedslib/tools.ts9 tools — one source of truth/api/chatstreams SSE to the browser/api/mcpMCP over streamable HTTPapp/page.tsxserver componentOUTSIDEaviationweather.govMETAR / TAF — no keyFAA NAS statusground stops — no keyBrowserchat UI, streams SSEMessages APIclaude-haiku-4-5Messages APIconnects to /api/mcp, runs the loop

One tool layer, two execution paths. In MCP mode the chat route hands Anthropic the URL of our own /api/mcp endpoint; Anthropic connects to it and runs the entire tool loop server-side, so there is no loop code in the request path. In local mode the same definitions are passed as ordinary tools and executed in-process. Append ?tools=local or ?tools=mcp to compare them. Any other MCP client can call the same endpoint.

Where the numbers come from

Every number the agent reports is computed in lib/baserates.ts. The model resolves messy phrasing, decides which tools to call, and explains the result — it never does the statistics. Nothing in the hot path requires heavy reasoning, so a small model is sufficient.

Adjustments compose as odds ratios, so they are multiplicative and order-independent, and each one is returned with its own sample size and plain-language explanation. The breakdown shown under each answer lists them.

The tool surface

resolve_airportcity name → IATA
get_route_historyfull record for one destination
list_inbound_originsrotation risk by inbound origin
get_sfo_conditionslive ceiling, TAF, FAA programs
get_destination_weatherconditions at the far end
assess_departure_riskthe main computation
lookup_flight_rotationone flight number's own aircraft rotation
compare_departure_optionsrank days and hours
get_sfo_delay_contexthourly profile + propagation curve

Limits

Base rates: US DOT BTS Reporting Carrier On-Time Performance (public domain), 2025-06 to 2026-05. Live conditions: aviationweather.gov and the FAA NAS status feed.