MOBILITY.md

Pragmatic movement intelligence — where millions of entities contribute state and receive swarm guidance in realtime.

Part of the protocols.md network
Draft v0.1 - Lightweight brainstorming for the movement coordination layer. This is exploratory speculation about how autonomous agents might achieve swarm intelligence. RFC stage

The Protocol

Every scooter, robot, vehicle, and sensor becomes both a contributor and subscriber to the movement graph. No booking, no rides — just continuous state exchange.

1. Contribute

POST your position, velocity, intent. Batched or streaming.

2. Subscribe

SSE stream filtered to your corridor/bbox. Locally relevant.

3. Emerge

Swarm consensus, hazard alerts, flow patterns appear.

Write Path — Contribute State

Low-latency ingestion. Single events or NDJSON batches. Privacy-preserving (PII stripped client-side).

POST https://mobility.md/contribute
{
  "entity_id": "robot_44729",
  "entity_type": "delivery_robot",
  "position": {
    "lat": 34.0522,
    "lon": -118.2437
  },
  "velocity_mps": 1.2,
  "heading_deg": 47,
  "battery_pct": 67,
  "observed_at_iso": "2024-01-15T05:24:14.458Z",
  "corridor": "LAX_405_interchange",
  "intent": "medical_delivery"
}

Batch mode (NDJSON):

{"entity_id":"scooter_8821","position":{"lat":34.05,"lon":-118.24},"velocity_mps":8.3}
{"entity_id":"scooter_8822","position":{"lat":34.06,"lon":-118.25},"velocity_mps":7.1}
{"entity_id":"scooter_8823","position":{"lat":34.04,"lon":-118.23},"velocity_mps":0}

Read Path — Realtime Stream

Server-Sent Events deliver flow conditions, hazards, and swarm consensus. Filter by location for relevance.

SSE GET https://mobility.md/streamConnecting...

What Emerges at Scale

Swarm Consensus

// 47 robots approaching same intersection
{
  "swarm": {
    "nearby_entities": 47,
    "consensus_heading_deg": 52,  // Agreed optimal path
    "emergence_pattern": "zipper_merge",
    "coordination_efficiency": 0.94
  }
}

Cascade Detection

// Stadium exit creates ripple effects
{
  "hazards": [{
    "kind": "mass_exodus",
    "location": {"lat": 33.95, "lon": -118.34},
    "radius_m": 3000,
    "severity": 0.8,
    "cascade_eta": {
      "500m": "2min",
      "2km": "8min", 
      "5km": "22min"
    }
  }]
}

Flow Intelligence

// Real-time corridor metabolism
{
  "local_flow": {
    "vehicles_per_minute": 187,
    "congestion_factor": 0.73,
    "predicted_clearance": "14min",
    "alternate_routes": ["western_ave", "normandie"],
    "efficiency_delta": -0.31  // vs. yesterday same time
  }
}

Pull Mode — Query API

GET /query?bbox=-118.5,33.8,-118.1,34.1&since=2025-09-07T22:00:00Z

{
  "observed_at_iso": "2025-09-08T05:10:22Z",
  "aggregates": {
    "total_entities": 48291,
    "active_robots": 1847,
    "scooters_idle": 423,
    "avg_velocity_mps": 4.7
  },
  "patterns": [
    {"type": "convergence", "center": [34.05, -118.24], "magnitude": 0.82},
    {"type": "dispersal", "center": [34.02, -118.30], "magnitude": 0.45}
  ],
  "predictions": {
    "congestion_15min": 0.67,
    "optimal_corridors": ["I-10_west", "olympic_blvd"]
  }
}

Why This Architecture

SSE > WebSockets

Simpler, HTTP/2 multiplexing, automatic reconnect, CloudFlare-friendly.

NDJSON Batching

Scooter fleets dump 10K events/sec. One POST, not 10K.

Location Filtering

Subscribe only to relevant bbox/corridor. Network efficiency.

Privacy First

PII never leaves device. Positions jittered. Aggregate only.

Scale Trajectory

Today:47K entities/hour
Q1 2026:1M entities/hour
Q4 2026:100M entities/hour
2027:1B entities/hour (global)

Integration (Python)

import sseclient
import requests
import json

# Subscribe to movement stream
def subscribe_movement():
    url = "https://mobility.md/stream?corridor=LAX_405_interchange"
    headers = {"Authorization": "Bearer $TOKEN"}
    
    response = requests.get(url, headers=headers, stream=True)
    client = sseclient.SSEClient(response)
    
    for event in client.events():
        data = json.loads(event.data)
        
        # React to swarm consensus
        if data.get("swarm", {}).get("consensus_heading_deg"):
            adjust_heading(data["swarm"]["consensus_heading_deg"])
        
        # Avoid hazards
        if data.get("hazards"):
            reroute_around(data["hazards"])
        
        # Contribute back
        contribute_state()

def contribute_state():
    requests.post("https://mobility.md/contribute", json={
        "entity_id": "robot_44729",
        "position": get_gps(),
        "velocity_mps": get_velocity(),
        "observed_at_iso": datetime.now().isoformat()
    })
spec_version: 0.2.0
transport: Server-Sent Events (SSE)
published: 2025-09-08T06:22:00Z
status: production-ready
contact: proofmdorg@gmail.com

mobility.md

© 2025 mobility.md authors · MIT License · Pragmatic specification