Verifiable GIS Code Assistant

GeoAgent

Turning GIS code generation from a one-shot answer into a loop of document retrieval, generation, execution, repair, and evaluation.

  • RAG
  • Geospatial AI
  • Workflow Evaluation

General models often produce GIS code that looks reasonable but does not run. A wrong API, parameter, projection, or file can make an answer unusable. Users need less documentation hunting and debugging—not merely attractive code.

How can a natural-language request move through reliable knowledge, data selection, and execution feedback to become a verifiable GIS result?

Every action should have a reason.

  1. Build 6k+ GIS QA pairs and 320 Query-Code examples first.

    A vertical task needs stable data boundaries and example coverage; it cannot rely only on model memory or scattered prompts.

  2. Use RAG to retrieve official documentation and code examples.

    GIS APIs change and parameters are specific. Retrieval provides traceable grounding and is more maintainable than an ever-longer prompt.

  3. Connect execution, error, repair, and evaluation in a loop.

    Early review showed that code resembling an answer is not the same as a deliverable task. Execution feedback exposes dependencies, paths, tool use, and exception handling.

How a GIS request becomes a runnable, verifiable result

Start / inputProcessDecisionOutcome
  1. User

    Describe a spatial task

    State the goal, input data, spatial relationships, and expected artifact.

  2. RAG + data layer

    Retrieve knowledge and confirm data

    Recall official APIs and examples, then inspect files, projections, and fields.

  3. Planning / generation agent

    Plan and generate code

    Choose tools, sequence, and parameters, then produce an executable script.

Execution environment

Does it run and produce a trustworthy spatial result?

Check runtime status, artifact existence, spatial logic, and quality metrics together.

Runs + passes validation

Deliver code and spatial artifacts

Preserve data, parameters, and evaluation evidence for reproducibility.

Runtime error

Route error to the repair agent

Feed dependency, path, API, or parameter failures back into generation.

Missing requirement / data

Return to the user for clarification

Request files, projection, field meaning, or a clearer expected output.

Validation loop

Route failure causes back to retrieval and planning

Locate the failure in knowledge, data, planning, execution, or evaluation, then rerun instead of hiding it in the final answer.

Business meaningThe core is not code generation alone. It is a loop that connects grounding, data selection, execution feedback, and spatial validation so plausible but undeliverable answers are exposed.

From judgment to something that runs.

Understand

Parse the spatial task, inputs, and expected artifact.

Plan

Retrieve relevant knowledge and select files, tools, and sequence.

Verify

Execute generated code, repair errors, and evaluate output quality.

  • Built 6k+ GIS QA pairs and 320 Query-Code examples
  • 78.3% CodeBLEU improvement over baseline
  • 35 GIS tasks completed in about five minutes on average
  • 50% improvement in defensive coding patterns
What this does not prove yet

Code similarity and a small task set do not establish production reliability. The first site release does not link the research repository because it contains local path traces.

What I would test next

Expand spatial-result validation and failure coverage, prioritizing “is the result trustworthy?” over “was code generated?”