KAirOS
The right route. Right now.

Safer, smarter commute in Metro Manila.

One app for every leg of your trip — jeepney, bus, MRT, LRT, and walking — powered by MMDA data and on-device AI.

Listening…
"Take me to Ayala at 8 AM"
Plan ahead · Trip Watch

Choose a future departure. KAirOS builds an MMDA-aware forecast now, then keeps checking planner-published conditions before you leave.

Personal route details stay local · anonymous zone, time window, and mode inform aggregate demand
Report to MMDA · one tap

Pick what you see. Two confirmations, or one MMDA check, turn it into a routing rule for every KAirOS user.

Sends type, road and heading only · no name, plate or trip history

Overview

Demo clock · --:-- PHT Aggregated · zone-level only
Low demand Moderate High Mild Moderate Severe modelled severity · sample scenario Demand, safety, closure, and route lenses stay in place; severity colours show where a planned disruption hits hardest before it is published.

Beta architecture

planned · AWS Singapore · Terraform

The production system the PP2 beta runs on: two clients, one API, one routing engine, one database, all built once from Terraform and scaled by rules, so after handover only the code changes.

Planned, not deployed. This demo is fully client-side (static JSON, browser routing, LocalStorage). The page below is the beta design from Technical Proposal 3.5 and docs/INFRASTRUCTURE.md, with the sizing model from that plan. Every figure is an October 2026 estimate for the Inception Report, not a measurement.
VPC 10.20.0.0/16 · ap-southeast-1a + 1b PUBLIC SUBNETS · ECS CLUSTER · INGRESS ONLY FROM THE ALB PRIVATE SUBNETS · NO INTERNET ROUTE Phones Expo app · Android + iOS MMDA console browser · S3 static · SSE live view MMDA systems REST · API key · advisories CloudFront + WAF caches forecast + advisories 60 s · rate limit per device Application Load Balancer HTTPS · ACM certificate · /v1/* → api · reachable only from CloudFront api Fastify · REST v1 · SSE · rules cache Fargate ARM 0.5 vCPU / 1 GB worker SQS consumers · schedules Fargate ARM 0.25 vCPU / 0.5 GB routing Valhalla · OSM + Annex A tiles · predicted traffic ECS on EC2 · routing / match.kairos.local · sidecar RDS PostgreSQL 16 + PostGIS db.t4g.medium · gp3 50 → 100 GB · daily snapshots · encrypted tiles synced from S3 at task start · no SSH · instance is disposable SQS telemetry · report-events · triage push-fanout · jobs (FIFO) · DLQs SNS push APNs + FCM · 500 per batch phones wait 0–90 s, then refresh S3 tiles · Annex A · exports console static · tfstate Secrets db · APNs · FCM API keys CloudWatch + EventBridge logs · alarms · dashboard · budgets forecast 5 min · expiry 1 min · KPIs 02:00 POST /v1/routes GET forecast · 304 when unchanged console · HTTPS POST advisories api → routing · exclude_polygons per rule · alternates telemetry → queue → worker rule published → fan-out traces reduced to segment speeds · raw positions never stored
Route request Cached read (the burst path) Telemetry, queued Rule → push fan-out Internal call External system
Set up once, then only code changes

Terraform builds the whole account during Phases 2 and 3 and is then left alone. Code reaches production one way: merge to main, GitHub Actions builds the images, ECS rolls them out with a circuit breaker. Road-network refreshes are a commit to the tile build, never a server change.

  • MMDA touches: the repository, the CloudWatch dashboard, the bill, snapshot restore, secrets rotation, two Terraform variables at most.
  • MMDA never touches: task definitions, scaling policies, security groups, the EC2 instance, SSH (there is none), the console by hand.
The one scaling case: the push burst

With 5,000 users, steady traffic is under one route a second. When MMDA publishes a flood rule, thousands of phones open within two minutes: 50 to 100 times steady. Fargate takes 2 to 3 minutes to add a task, so the burst is absorbed before the API, and the API is raised before the push goes out.

  • Forecast and advisory reads are cacheable GETs with ETags, and every phone asks for the same URLs (5-minute slots, one advisory version), so CloudFront serves the repeats.
  • The publish is a console action, so the worker raises the api floor to 4 tasks and staggers the zone topics before any phone is pushed.
  • Phones wait a random 0 to 90 s after a push before refreshing, and re-route only if a saved trip touches the rule's segments.
  • WAF limits by device, not by address: hundreds of phones share one carrier-NAT address.
Scaling rules per tier
  • api 2 to 8 tasks. Target tracking on ALB requests per target, set from the January load test, and CPU 60%; a step adds 2 in a burst. Out in 60 s, in after 10 min.
  • worker 1 to 4 tasks. Target tracking on backlog per task (telemetry messages ÷ tasks, target 300); one poll loop per queue.
  • routing 1 instance, ceiling 2 only so a deploy starts the new task before the old stops. Grows by changing one instance-type variable.
  • decide (report triage) a Lambda function on the triage queue; scales to zero by itself.
  • database no compute autoscaling; storage grows to 100 GB by itself. Multi-AZ and a read replica are flags, off.
The three flows
  • Route. Phone → ALB → api: rules in force at departure become Valhalla exclusions per vehicle class; Divert and Weight rules are applied in the api over Valhalla's alternatives, as the prototype's router does. Target 1.5 s at p95.
  • Telemetry. A position every 5 s, uploaded each minute, trimmed 300 m at each end, answered 202 and queued. The worker map-matches and writes segment speeds. Raw positions are never stored.
  • Report → rule → push. Two user confirmations or the console publish the rule, credit 5 points and fan out a push scoped to the corridor.
Security and RA 10173
  • Phones carry a random device ID and a bearer token; no accounts, phone numbers or emails.
  • Console users have passwords (argon2id) and TOTP; every write lands in the audit log.
  • One IAM task role per service; deploys through GitHub OIDC, so no long-lived AWS keys exist.
  • TLS 1.2+ at the edge; RDS, EBS, S3, SQS and logs encrypted at rest; secrets only in Secrets Manager.
  • Zone-level intents, 80-character report notes filtered for plates and numbers, plate suffix kept on the device.
Budget and milestones

Production is quoted at USD 255 a month: database 85, Fargate 40, routing instance 65, load balancer 35, storage and transfer 15, queues and monitoring 15. Staging adds 40. Budget alarms at 200 and 300. The slider follows the plan's growth path: about 380 at 20,000 users, 900 at 100,000, 1,750 at 500,000 and 2,500 at 1,000,000; the plan's three further changes (segment matching on the phone, one upload at trip end, reservations bought by MMDA) would bring 1,000,000 to about 1,500.

  • Mid Nov 2026 staging from Terraform; CI plans every PR.
  • Dec 2026 tiles from OSM + Annex A; first load test.
  • Early Jan 2027 production, restore test, 5,000-device burst test under 1.5 s p95.
  • 15 Jan 2027 beta on the stores. 1 Jun 2027 cost report from real data. Aug 2027 account handed to MMDA.
Trade-offs chosen on purpose: ECS tasks sit in public subnets behind security groups instead of paying about USD 35 a month for a NAT gateway (a private_tasks flag adds one); the database is single-AZ with point-in-time recovery (a 5-minute recovery point, where the proposal promises a day) and the routing instance is one, replaced in about 5 minutes, because during either outage the app plans saved trips on the device; Valhalla has hard exclusions but no soft per-area cost, so advice rules are scored in the api. Full detail: docs/INFRASTRUCTURE.md.