Challenge: From Simple Map Queries to Complex Geospatial Analysis
The application of Large Language Models in maps, urban planning, and transportation is deepening. However, many real-world geospatial problems are far more complex than single-step API calls like ‘what restaurants are nearby?’ or ‘how to get from A to B?’. For instance, a user might need to analyze ‘which restaurants within a certain area meet specific criteria for distance, rating, opening hours, and route constraints?’. Such questions lack ready-made answers and require a series of logically rigorous analytical steps: first defining the spatial extent, then organizing query objects, filtering conditions, spatial relationships, and metrics.
When tackling such tasks, traditional LLM Agents, even if they successfully call tools for geocoding, place search, or route planning, often produce biased results due to incorrect analysis sequences. Take an analysis task like ‘calculate the proportion of a specific facility within a certain area.’ Should one first filter for the area and then calculate the proportion, or first aggregate the global data and then clip the result with the area’s boundary? These two seemingly reasonable workflows will yield vastly different answers. This exposes a core weakness of general-purpose Agents in specialized domains: a lack of understanding of domain-specific analytical logic. Relying solely on the ‘think-act-observe’ loop is insufficient to guarantee the correctness of the analysis process.
The Core Solution of Spatial-Agent: Introducing the GeoFlow Graph
To address these issues, researchers from Emory University, Rutgers University, and other institutions proposed the Spatial-Agent framework. Its core innovation is the introduction of an intermediate representation layer called the ‘GeoFlow Graph’ between the user’s natural language question and the underlying tool calls.
This GeoFlow Graph is not a simple chain-of-thought text but a structured computational graph. The nodes in the graph represent geospatial concepts (like places, objects, regions), and the edges represent the transformations between these concepts (such as filtering, aggregation, computation). The model first ‘translates’ the user’s ambiguous question into this clear analytical blueprint. Then, following the dependencies in the graph, it systematically calls map APIs and other tools to perform the actual operations. This ‘build the analytical skeleton first, then fill in the execution details’ approach makes the complex geospatial analysis process explicit and structured, thereby ensuring the entire workflow is verifiable and interpretable.
Theoretical Foundation: Integrating Core Concepts from GIScience
The power of Spatial-Agent lies in its deep theoretical roots, skillfully integrating two long-established theoretical systems from Geographic Information Science (GIScience) into the LLM’s reasoning process.
The first is the ‘Core Concepts’ of spatial information. This theory, established by scholars like Michael F. Goodchild and Werner Kuhn, abstracts geographic phenomena into fundamental units such as Location, Field, Object, Network, and Event. Spatial-Agent leverages this theory to identify these core concepts from the user’s query, providing the first layer of structured information for understanding the problem.
The second is the ‘Functional Roles’ in the analysis process. Developed by Simon Scheider and others, this theory focuses on the roles that different spatial concepts play in an analytical workflow, such as defining the analysis Extent, specifying a Condition, serving as a Support object, or being the final Measure target. By assigning functional roles to the identified concepts, Spatial-Agent clarifies not only ‘what’ is in the question but also ‘what their respective responsibilities are’ in the analysis, laying the foundation for constructing a logically sound GeoFlow Graph.
Implementation: A Four-Step Process from Concept Extraction to Tool Execution

The complete workflow of Spatial-Agent can be summarized in four main steps, systematically translating GIScience theory into executable computational procedures:
- Concept and Role Extraction: The system first parses the natural language query to identify the geospatial core concepts it contains (e.g., objects, locations, networks) and assigns them functional roles (e.g., extent, condition, measure). This step transforms unstructured text into structured analytical units.
- Macro-Template Application: To avoid logical errors that might arise from building an analysis flow from scratch, the system consults a library of pre-validated macro-templates. These templates correspond to common, high-frequency patterns in geospatial analysis, such as ‘filter-aggregate-measure,’ ‘object-to-distance-field conversion,’ and ‘multi-point route optimization,’ providing high-level guidance for the model to generate a reasonable GeoFlow Graph.
- GeoFlow Graph Construction: Combining the extracted concepts, roles, and recommended templates, the system constructs a complete GeoFlow Graph. This graph must satisfy constraints on operational order, data type compatibility, and connectivity, ensuring it is both faithful to the user’s intent and can be unambiguously executed later.
- Workflow Execution and Response Generation: Finally, the system maps the transformations in the GeoFlow Graph to specific tool API calls, such as geocoding, place search, routing, and spatial filtering. The system follows the graph to execute these operations, records intermediate results, and ultimately generates a precise answer to the user’s question.
Experimental Validation: Workflow Constraints Lead to Significant Performance Gains
The research team conducted a comprehensive evaluation of Spatial-Agent on the MapEval-API and MapQA geospatial question-answering benchmarks. The experimental results strongly demonstrated the method’s effectiveness.
- Significant Performance Outperforms Baselines: On the MapEval-API benchmark, Spatial-Agent using the GPT-4o-mini model achieved an overall accuracy of 45.15%, a 96.30% relative improvement over the standard API baseline’s 23.00%. When the model was upgraded to the more powerful GPT-5, the overall accuracy jumped to 71.88%.
- Strong Model Generalization: On the MapQA benchmark, the Spatial-Agent framework showed good cross-model transferability. It achieved stable and leading performance when combined with the closed-source GPT-4o-mini (61.45% accuracy), as well as with open-source models like LLaMA-70B (62.45%) and Qwen2.5-72B-Instruct (61.45%).
- Necessity of the Analytical Framework: Ablation studies showed that after removing the macro-template guidance, Spatial-Agent’s accuracy on MapEval-API dropped from 45.15% to 39.32%. This indicates that the pre-defined geospatial analysis patterns are crucial for guiding the model to generate correct GeoFlow Graphs.
Notably, the error analysis pointed out that most of the current system’s failure cases stem from the execution phase, such as missing POI information or inaccurate business hours—issues related to external data quality (accounting for 45.6%)—rather than logical errors in the planning phase. This indirectly confirms the robustness of Spatial-Agent in constructing correct analytical workflows.