Skip to content
Esc
L train: Canarsie Tube closedRun the controller
Lexington Ave express suspendedRun the controller
A and C: Cranberry Street Tunnel closedRun the controller
Aisha's tripArchitect, uses a wheelchair
Dev's tripLine cook, breakfast service
Grace's tripParalegal, downtown
Kwame's tripBank operations lead
Lena's tripGraduate student
Maya's tripICU nurse, day shift
Sam's tripAnalyst, Financial District
Tomás's tripHigh-school teacher
HomeThe L closure, chapter by chapter
Control roomClose a line and watch the agents
RidersRemembered riders and their routes
MemoryFacts over time, episodes, handoffs
Agency brainWho owns it, who knows it, and why
ProofFalkorDB against NetworkX
Who owns the Myrtle-Wyckoff elevator outage?Ask the agency brain
Why do L tube bus bridges get 27% more buses?Ask the agency brain
Who knows the most about the G at Metropolitan Av?Ask the agency brain
What changed in the last 7 days?Ask the agency brain
Who it hitsriders by stops from the closure
Where they gothe G overload
What it can carrymax flow
The choke pointmin cut
The fixa shuttle tested on a fork
The ridersadvisories after approval
FalkorDB vs NetworkXmax flow on every closure
Many agents at oncetenant isolation under load
What each tool costsqueries and milliseconds
Data and assumptionsMTA sources
Every querythe Cypher behind every tool

Graph Hacks · FalkorDB · All three tracks

When a subway line breaks, Detour measures what the city can still carry.

The real New York subway, built from the MTA's own data, lives in FalkorDB. Agents find whose trips a closure breaks, measure what the rest of the network can absorb with max flow, test shuttle bridges on forked copies of the graph, and tell every remembered rider what to take instead.

riders in the 8 a.m. hour
446,230
riders in the 8 a.m. hour
station complexes
445
station complexes
scheduled segments
1,459
scheduled segments
Follow the morning the L broke

01Who it hits

23,445

riders an hour on trips through the closed tube

Riders four stops away are hit too.

7,823 board at the closed stations. Count everyone whose trip crosses the tube from up to four stops away and it is 14,713. An alert sent to the closed stations would miss most of them.

On the map: each station whose riders are hit, shaded by how many stops before the closure they board.

02Where they go

244%

of capacity on the G, Greenpoint Av to 21 St

Left alone, they pile onto the G.

On their fastest open paths, 18,756 riders an hour find another way, and 4 G segments run at 190 to 244% of capacity. 4,689 have no open rail path at all.

03What it can carry

93%

of riders headed into Manhattan could still move

Spread perfectly, 17,167 of 18,432 get through.

FalkorDB runs max flow over every line's spare capacity on a copy of your graph: the most the open network could carry if every displaced rider were steered onto a line with room.

04The choke point

1 Av

1,266 riders an hour cannot move on rail

The min cut runs through 1 Av.

Its only rail links are the closed L, so no spare capacity anywhere else reaches its riders. The cut, read from the max flow's residual graph, says where buses have to go.

05The fix, tested first

4,689 → 623

riders an hour with no open path

A shuttle from 1 Av to Astor Pl, tested on a fork.

The controller sized it at 25 buses an hour, 27% more than the raw estimate, because memory says the June shuttle carried only 79% of plan (example data). On its own copy of the graph, the max-flow shortfall drops from 1,266 to 315.

A person approves before any rider hears about it.

06The riders

4

remembered riders rerouted

Then the rider desk tells the people it remembers.

One agent per affected rider finds their way around the break. Aisha (architect, uses a wheelchair) gets a route that keeps to step-free stations:

Take the M to 14 St/6 Av. About 33 minutes, step-free.

How it works

The agents choose the tools. The graph does the work.

The model never writes Cypher. It picks from a fixed catalogue of graph tools, each a parameterized query with its row count and latency shown in the trace, and every answer is a path, a flow, a dated memory, or an honest “not in the graph”.

Weekday 8 a.m. capacity from MTA GTFS (trains per hour × planning load per train); demand from the MTA's 2025 origin-destination estimates (30,205 of 91,719 station pairs, 90.5% of riders). The max-flow numbers are computed in FalkorDB and checked by a separate NetworkX implementation.

  1. Stop 01

    One graph per visitor

    Your sandbox is a copy of the template graph, so the closures, plans and memory you create never reach anyone else.

    GRAPH.COPY detour:template detour:sbx:<you>
  2. Stop 02

    Who rides through the break

    Every 2025 origin-destination flow whose 8 a.m. path used a closed segment, then the stations one, two, three stops upstream, hop by hop.

    MATCH (o:Station)-[d:DEMAND]->(x:Station)
    WHERE any(e IN d.via WHERE e IN $closed)
    RETURN o.id AS o, x.id AS d, d.riders AS riders
  3. Stop 03

    What the rest can absorb

    A fork of your graph without the closed segments, spare capacity summed per corridor, a super source and sink sized to the displaced riders, and FalkorDB's max flow.

    MATCH (src:Hub {id: $src}), (snk:Hub {id: $snk})
    CALL algo.maxFlow({sourceNodes: [src], targetNodes: [snk],
      relationshipTypes: ['FLOW'], capacityProperty: 'spare'})
    YIELD maxFlow, edges, edgeFlows
  4. Stop 04

    Test the fix before anyone acts

    Each shuttle plan gets its own fork with bus links added; every displaced trip is rerouted through platforms, transfers and walks, and max flow runs again. A person approves before a plan reaches riders.

    UNWIND $pairs AS p
    MATCH (a:Station {id: p.o}), (b:Station {id: p.d})
    CALL algo.SPpaths({sourceNode: a, targetNode: b,
      relTypes: ['BOARD', 'RIDE', 'ALIGHT', 'WALK', 'BUS'],
      weightProp: 'minutes'})
    YIELD path, pathWeight

Track 2

Agents that remember, and hand off through the graph.

When a dispatcher approves a plan, the control agent hands off to the rider desk as graph state. One agent per remembered rider checks whether their usual trip crosses the closure and writes them an advisory. Facts carry dates and close when they stop being true, so an elevator outage remembered last week changes a wheelchair user's route today.

Open the memory
  • Episodic

    Every tool call becomes an Episode in your graph, linked to its incident.

  • Semantic

    Findings with valid-from and valid-to; superseded facts are closed, never deleted.

  • Procedural

    Playbooks per line, with how often they were used and what a shuttle actually carried.

  • Per tenant

    A graph per visitor, measured under concurrent rider reads and controller writes.

Close a line yourself and watch the agents measure it.