GeoSQL installs itself as a skill into a coding agent so the agent can answer geospatial questions against a data warehouse. It targets data scientists and analysts working on PostGIS, BigQuery, Snowflake, and Wherobots, covering Overture Maps shares on BigQuery and Snowflake alongside private tables. After installation you prompt the agent with a /geosql command — for example, showing EV charger density along major roads and rendering a map.
The loop runs in five steps. The skill first explores warehouse metadata — tables, columns, types — instead of guessing schemas. The agent then writes spatial SQL with the functions its engine provides (STINTERSECTS, STDISTANCE, H3, bbox overlap for partition pruning). On BigQuery every query is dry-run to estimate bytes scanned against a 10 GiB default billing cap, and an over-budget query is rewritten cheaper — tighter bbox, lower H3 resolution, more filters — rather than executed. The agent computes total polygon area or line length as a sanity check, and where Dekart is available it renders the result, looks at the rendered image, and corrects geometry mistakes a text-only loop would miss. Warehouse credentials stay with your local CLI authentication (bq, snow, dekart) and are never handed to the agent.
An eval suite under evals/ asserts specific behaviours — cost guardrails, validation steps, correct result — rather than only whether the agent produced an answer. Reported results on the included suite:
| Case | Assertions | Pass rate |
|---|---|---|
| london-boroughs | 4 | 100% |
| berlin-create-map | 3 | 100% |
| paris-boundaries | 1 | 100% |
| Total | 8 | 100% |
Averages across the suite are 3,085 tokens and 72 seconds per turn. Comparing the same task set with and without the map-in-loop step is reported as a 4x difference: without the rendered map, text-only validation misses geometry-class errors such as mistaking a neighbourhood polygon for a metro-area perimeter, double-counting overlapping features, or picking the wrong join key across coordinate-reference systems.
Features
- Schema discovery: explores warehouse tables, columns, and types instead of guessing them
- Engine-aware spatial SQL: picks the functions the target engine provides, including H3 and bbox partition pruning
- Cost guardrails: BigQuery queries are dry-run against a 10 GiB default billing cap and rewritten cheaper when over budget
- Geometry validation: total area or length computed as a sanity check and cross-checked against domain knowledge
- Map feedback: results render through Dekart and the agent inspects the image to self-correct
- Local credentials: uses your existing bq, snow, and dekart logins, so warehouse credentials never reach the agent
- Reproducible evals: a suite under evals/ that asserts behaviours, not just answers
- Version check: a best-effort version ping with an opaque installation ID, disabled with DONOTTRACK=1 or DNT=1
