Skip to main content

Install GeoSQL instructions into local AI CLIs.

Project description

GeoSQL

Claude, Codex, and GitHub Copilot skill for data scientists and analysts working with geospatial data on PostGIS, BigQuery, Snowflake, and Wherobots.

Note: No SaaS account needed. Works 100% locally or self-hosted.

GeoSQL demo

4x improvement on geospatial tasks with map in the loop.

Agent with maps loop, 4x performance

Quick Start

With Python (interactive mode):

pip install geosql && geosql

Install directly into a supported agent:

geosql install claude
geosql install codex
geosql install copilot

Or in Claude Code:

/plugin marketplace add dekart-xyz/geosql
/plugin install geosql

After geosql install copilot, use GeoSQL from VS Code Copilot or Copilot CLI with prompts such as:

/geosql Show EV charger density along major roads and render a map

Install Dekart for map rendering and PostGIS support

GeoSQL optionally uses Dekart: an open-source Kepler.gl backend with connectors for PostGIS, BigQuery, and Snowflake. You can run Dekart locally with one docker command, self-host it on your own infrastructure, or use Dekart Cloud.

Run Dekart locally (skip this step to use Dekart Cloud):

docker run -p 8080:8080 dekartxyz/dekart

Install the Dekart CLI:

pip install dekart && dekart init

Follow CLI and dekart prompts to connect your PostGIS, BigQuery, Snowflake or Wherobots database.

Example prompts to try in your agent:

Real estate analysis:

/geosql Show buildings with low school accessibility in Ottawa, render as a map

Site selection:

/geosql Find the top 10 locations for Sporting Goods Store in Seattle based on POI co-location and distance to the nearest competitor. Create a map.

EV charging infrastructure:

/geosql create map EV charger density along major Romanian roads, highlighting how many charging stations are within 5 km of each motorway, trunk, or primary road segment.

How it works

GeoSQL runs an agent loop with a map in it.

  1. Discovery. The skill explores your warehouse metadata (tables, columns, types) instead of guessing schemas. Works with Overture Maps shares on BigQuery and Snowflake, and your private tables on PostGIS, BigQuery, Snowflake, or Wherobots.
  2. SQL. The agent writes spatial SQL using the right functions for your engine (ST_INTERSECTS, ST_DISTANCE, H3, bbox overlap for partition pruning, and so on).
  3. Cost check. On BigQuery, every query is dry-run first to estimate bytes scanned. A 10 GiB billing cap is enforced by default. Over-budget queries get rewritten cheaper (tighter bbox, lower H3 resolution, more filters) instead of executed.
  4. Geometry validation. The agent computes total area (polygons) or total length (lines) as a sanity check, and cross-checks against domain knowledge.
  5. Map feedback. When available, the agent renders the result through Dekart, looks at the rendered image, and corrects geometry mistakes the text-only loop would miss. This is the loop that gets the 4x improvement.

The skill uses your local CLI authentication (bq, snow, dekart), so warehouse credentials never go to the agent.

Benchmarks

GeoSQL ships with a reproducible eval suite under evals/. Each case asserts specific behaviors (cost guardrails, validation steps, correct result), not just "did the agent answer."

Current 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%

Average: 3,085 tokens per turn, 72 s duration per turn.

The 4x improvement chart above compares the same task set with and without the map-in-loop step. Without maps, the agent's text-only validation misses geometry-class errors (mistaking a neighborhood polygon for a metro-area perimeter, double-counting overlapping features, picking the wrong join key on coordinate-reference systems). Adding the rendered map as a tool call lets the agent see those mistakes and self-correct.

Run the suite yourself:

python evals/run.py

See evals/RUNBOOK.md for setup and how to add new cases. PRs with new evals welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geosql-0.25.0.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geosql-0.25.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file geosql-0.25.0.tar.gz.

File metadata

  • Download URL: geosql-0.25.0.tar.gz
  • Upload date:
  • Size: 7.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for geosql-0.25.0.tar.gz
Algorithm Hash digest
SHA256 4e4009ca15b95d6e0b8ef6b434fdd0d9ce06710c6364500455ecdce5b51f7d2c
MD5 b07526502014f45db7f7091ae36c3b4b
BLAKE2b-256 cd683f8f6930af95fa45c78b43b7331ec9e33abcfee4050ffd6ce938ce0178da

See more details on using hashes here.

File details

Details for the file geosql-0.25.0-py3-none-any.whl.

File metadata

  • Download URL: geosql-0.25.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for geosql-0.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e9c838f4fdacbe82b3ba86948ea02c2c15c95dbcdc34991e30adf9014ec4ff4
MD5 46f02591511f363bd348ef7043ef009a
BLAKE2b-256 a28a2b19bd6ed52dafef7c41a136f84f5a6cbc363572e4f4d3c7c84381488d35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page