supercarto
LLM-native spatial middleware. It compiles geospatial data into token-budgeted topological graphs that an AI agent can reason over directly.
Install
npm install supercarto
Give it coordinates
Real OpenStreetMap data, fetched live, compiled into a graph an agent can navigate. No API key, no tile archive, any point on earth.
import { SuperCarto } from 'supercarto';
const carto = new SuperCarto();
const result = await carto.maplet({
lat: 35.6833,
lon: 139.7620,
radiusM: 400,
budget: 1500,
});
console.log(result.yaml);
The result is plain YAML: nodes, edges with distances in metres and compass directions, a record of what was left out, and the tools the agent can call next.
map:
center: "35.6833, 139.762"
radius: 400m
nodes:
n186: {type: transit, name: 新橋駅(3), tags: [subway_entrance]}
edges:
n1->n2: {dist: 120m, dir: east, path: road}
omitted:
- {layer: feature, count: 1754}
tools:
- expand_node(id)
- route(from,to,mode)
What it does
- Token budget. Named landmarks survive, anonymous intersections go first, and the surviving network stays connected.
- Honest omissions. Every drop is recorded in
omitted:, so the model can tell "not there" from "not shown". - Weather. Current conditions and an hourly forecast with no key. If the source is down it says so instead of returning zeroes.
- Traffic. Live with a TomTom or HERE key. Without one it reports free-flow and labels it as such.
- Indoor floors. Floor-by-floor graphs with lifts collapsed into one vertical link.
- MCP. Works as an MCP tool server for agents.
Data sources
| Source | Use |
|---|---|
| Overpass | Default map data, for development |
| PMTiles / Protomaps | Production map data |
| OSRM | Walk, bike and drive routing |
| Open-Meteo | Weather, no key |
| TomTom / HERE | Live traffic, key required |
| Terrarium tiles | Elevation and slope, no key |