Spatial-Agent: Agentic Geo-spatial Reasoning with Scientific Core Concepts

Riyang Bao, Cheng Yang, Dazhou Yu, Zhexiang Tang, Gengchen Mai, Liang Zhao · DOI

Abstract

Geospatial reasoning is essential for real-world applications such as urban analytics, transportation planning, and disaster response. However, existing LLM-based agents often fail at genuine geospatial computation, relying instead on web search or pattern matching while hallucinating spatial relationships. We present Spatial-Agent, an AI agent grounded in foundational theories of spatial information science. Our approach formalizes geo-analytical question answering as a concept transformation problem, where natural-language questions are parsed into executable workflows represented as GeoFlow Graphs -- directed acyclic graphs with nodes corresponding to spatial concepts and edges representing transformations. Drawing on spatial information theory, Spatial-Agent extracts spatial concepts, assigns functional roles with principled ordering constraints, and composes transformation sequences through template-based generation. Extensive experiments on MapEval-API and MapQA benchmarks demonstrate that Spatial-Agent significantly outperforms existing baselines including ReAct and Reflexion, while producing interpretable and executable geospatial workflows.

Introduction: The Challenge of Spatial Thinking in LLMs

While Large Language Models (LLMs) are impressively articulate, they are notoriously limited in "spatial thinking." When tasked with complex queries—such as finding the safest neighborhood near a subway station—standard LLMs often rely on linguistic pattern matching or web searches rather than actual geometric computation. This leads to "spatial hallucinations," where agents claim a park is inside a city when it isn't, or fail to understand the procedural steps required to calculate a crime rate within a specific buffer zone.

Comparison between standard agent reasoning (left) and the theory-grounded Spatial-Agent approach (right).

The core challenge is that geospatial reasoning is procedural and computational, not just declarative. It requires identifying core entities (objects, fields, networks), selecting the right operators (buffering, routing, overlaying), and ordering them into a valid workflow. Current agents lack this "spatial grammar," often attempting to aggregate data before they have properly filtered it spatially.

Methodology: Grounding Reasoning in Spatial Theory

Spatial-Agent moves away from "black-box" prompting toward a theory-driven framework. Its architecture consists of several key innovations designed to enforce spatial logic:

  • Geospatial Concept Grounding: Drawing on Kuhn’s theory of core concepts, the agent parses questions into seven primitives: Location, Object, Field, Event, Network, Amount, and Proportion.
  • Functional Role Assignment: It assigns roles to these concepts (e.g., Extent for the search area, Measure for the final output) and enforces a strict Procedural Precedence (e.g., a sub-condition must be applied before a measurement is taken).
  • GeoFlow Graphs: The agent represents the reasoning process as a Directed Acyclic Graph (DAG). Nodes are spatial concepts, and edges are transformations.
  • Retrieval-Augmented Orchestration: To ensure the workflows are valid, the agent uses a library of "macro-templates" (like FILTER-AGGREGATE-MEASURE) to compose the graph.
The GeoFlow Graph construction and factorization process, mapping spatial concepts to executable tools.

To refine these capabilities, the authors utilized a two-stage fine-tuning process. First, Supervised Fine-Tuning (SFT) helps the model extract concepts. Second, Direct Preference Optimization (DPO) trains the model to prefer graphs that satisfy geographic constraints, such as acyclicity and proper role ordering.

Evaluation and Benchmarking

The researchers evaluated Spatial-Agent on two primary benchmarks:

  1. MapEval-API: A benchmark requiring agents to invoke real-world map tools for tasks like routing, finding nearby points of interest (POIs), and multi-stop trip planning across 180 cities.
  2. MapQA: An open-domain geospatial QA dataset containing over 3,000 question-answer pairs based on OpenStreetMap data from California and Illinois.

Key Insights: Theory as a Guardrail

By forcing the LLM to operate within the constraints of GIScience theory (Core Concepts and Functional Roles), the framework effectively provides the model with a "spatial logic" it does not possess natively. A critical insight is the importance of factorization: by distinguishing between abstract "concept transformations" and concrete "tool execution," the agent can ground its answers in verifiable computational results rather than "learned priors" or guesses.

Furthermore, the study highlights that one of the most common failure modes for LLMs is applying spatial constraints after aggregation. Spatial-Agent’s strict role-ordering (SUBCOND ≺ COND ≺ SUPPORT ≺ MEASURE) mathematically prevents this class of error, ensuring that data is filtered and buffered before final calculations are performed.

Results and Performance

  • Massive Accuracy Gains: On the MapEval-API benchmark, Spatial-Agent (using GPT-4o-mini) achieved 45.15% accuracy, a 96.3% relative improvement over the standard baseline (23.00%).
  • State-of-the-Art Performance: When equipped with a more powerful backbone (referred to as GPT-5 in the study), the agent reached 71.88% accuracy.
  • Efficiency and Interpretability: Despite the multi-stage reasoning, Spatial-Agent showed competitive latency, often outperforming iterative "self-reflection" agents because its plan is constructed correctly the first time. Because the output is a structured graph mapping to specific API calls, the reasoning process is fully transparent and debuggable.

Conclusion and Future Directions

While Spatial-Agent represents a significant leap forward, limitations remain. Error analysis revealed that nearly 80% of failures were due to external factors, such as data quality issues in underlying map APIs. Future work will focus on expanding template coverage for "out-of-the-box" spatial queries and extending the framework to specialized domains like maritime or planetary science. Additionally, reducing the annotation cost for fine-tuning remains a priority for scaling the system to new geographic regions and languages.

Summary updated

BibTeX
@misc{bao2026spatial,
  author = {Riyang Bao and Cheng Yang and Dazhou Yu and Zhexiang Tang and Gengchen Mai and Liang Zhao},
  title = {{Spatial-Agent: Agentic Geo-spatial Reasoning with Scientific Core Concepts}},
  year = {2026},
  eprint = {2601.16965},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.16965},
}
Figure