Skip to content
latentSource

Mexico City transit assistant

A conversational transit map that resolves places and asks a routing engine to calculate the journey.

Gemini · MCP · PostGIS · pgRouting

Mexico City transit assistant

How the pieces connect

Engineering brief

Problem
Turn a trip described in natural language into a route that can be checked on a map.
My contribution
Built a Gemini assistant connected to MCP tools backed by PostGIS and pgRouting, with place resolution and visible tool traces.
Key decision
Let the language model select tools; calculate routes in the stored transit graph.
Result & evidence
The recorded application returns a mapped route and the calls that produced it. The article documents GTFS ingestion, graph costs, transfers, and spatial queries.
Limitations
Dated network coverage and routing assumptions limit the journey estimates; this is not a live guarantee of service or travel time.

What it does

Ask for a trip between stations or landmarks. The assistant uses MCP tools to resolve places, find stations, and calculate a route through the stored transit network.

The map and trace let you inspect the returned route and the calls behind it. The saved network has dated coverage, so calculated journeys are estimates under those data assumptions.

How it is built

The technical post explains GTFS ingestion, graph costs, transfers, spatial queries, and the boundary between the language model and the route calculation.

Ask for a route