Urban space analysis method and system for multi-agent collaborative retrieval enhancement generation
By leveraging a multi-agent collaborative retrieval-enhanced urban spatial analysis method, combined with a multimodal large language model and semantic-spatial dual-indexing technology, efficient autonomous processing and intelligent analysis of urban spatial data are achieved. This solves the problems of low efficiency and semantic understanding disconnect in traditional technologies, and improves the accuracy and real-time performance of data retrieval and visualization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING INST OF GEOGRAPHY & LIMNOLOGY
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies in urban spatial research suffer from problems such as low data processing efficiency, disconnect between semantic understanding and spatial reasoning, high barriers to human-computer interaction, and insufficient adaptability to multi-agent collaboration and retrieval enhancement generation technologies, making it difficult to achieve a closed-loop process of data retrieval, analysis, and visualization.
We construct a multi-agent collaborative retrieval and enhanced generation method and system for urban spatial analysis. We adopt a multimodal large language model and semantic-spatial dual indexing technology. Through task parsing, autonomous data exploration, multi-agent collaborative reasoning and visualization transformation, we realize natural language-driven urban spatial data processing.
It significantly improves the efficiency and accuracy of urban spatial data retrieval and analysis, lowers the threshold for human-computer interaction, and supports intelligent processing and real-time decision support for complex urban spatial problems.
Smart Images

Figure CN122045192A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban spatial analysis and artificial intelligence, specifically to a method and system for urban spatial analysis with enhanced multi-agent collaborative retrieval. Background Technology
[0002] Urban space is the core carrier for population agglomeration, industrial evolution, and public service allocation. Its structural health and operational efficiency directly determine urban resilience, residents' well-being, and the achievement of "dual carbon" goals. Current urban spatial research mainly relies on the traditional data processing mode of geographic information systems, which requires manual data screening, spatial analysis modeling, and result interpretation. This has limitations such as low data processing efficiency, a disconnect between semantic understanding and spatial reasoning, high barriers to human-computer interaction, and insufficient adaptability to multi-agent collaboration and retrieval enhancement generation technologies.
[0003] In recent years, the development of multimodal large models and multi-agent technologies has offered possibilities for solving the above problems. Some studies (such as Geo-GPT and GeoTool-GPT) have attempted to combine large language models with geographic information system applications, but the following shortcomings still exist: First, they rely on users to explicitly specify the data source path and lack autonomous data retrieval capabilities; second, they mostly focus on single spatial tasks (such as map drawing and buffer analysis) and cannot complete the entire closed loop of "data retrieval - analysis - visualization - conclusion generation"; third, they have not introduced a retrieval enhancement generation mechanism, making it difficult to dynamically integrate real-time updated urban spatial data, resulting in insufficient timeliness and accuracy of the analysis results.
[0004] Therefore, there is an urgent need to construct an urban spatial research architecture with the capabilities of "natural language driven, multi-agent collaboration, retrieval-enhanced generation, and spatial visualization closed loop" to realize autonomous processing and intelligent analysis of urban spatial data, reduce the threshold of human-computer interaction, and provide efficient and accurate technical support for urban planning decisions. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for urban spatial analysis with multi-agent collaborative retrieval and enhanced generation. It takes a multimodal large model as the core cognitive center, integrates a multi-agent collaborative architecture, and achieves efficient joint query and complete analysis report output of urban-level heterogeneous data (vector, raster, and text street view) driven by natural language through a five-layer collaborative architecture of "task parsing - data retrieval - spatial reasoning - knowledge generation - visualization closed loop". This is supported by spatial semantic indexing technology. It solves the four major structural defects that have long existed in urban spatial research: "low data coupling efficiency - semantic-spatial reasoning discontinuity - high interaction threshold - failure of retrieval and enhanced generation technology in urban scenarios".
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: A multi-agent collaborative retrieval-enhanced urban spatial analysis method and system, the steps of which include: Standardize multi-source heterogeneous urban spatial feature data and construct a semantic-spatial dual index; After users submit task requests in natural language, the task is parsed using a multimodal large language model and the data is explored autonomously using a semantic-spatial dual index. After completing task analysis and autonomous data exploration, multi-agent collaborative spatial semantic reasoning and analysis are performed based on the reflective enhanced task graph. By constructing an intelligent compilation mechanism for geographic semantics and visualization, the structured conclusions obtained from multi-agent collaborative reasoning are automatically transformed into spatial data for visualization.
[0007] According to the above technical solution, by introducing a fine-tuning strategy to enhance geographic knowledge, the structure and training of the Qwen3-Embedding-8B model are optimized. The trained Qwen3-Embedding-8B model is then used to transform the normalized urban spatial feature data into a high-dimensional vector.
[0008] The Qwen3-Embedding-8B model unifies the natural language descriptions of multi-source geospatial data into machine-understandable high-dimensional vector representations. This process integrates the functional semantics, spatial attributes, and contextual information of ground features, thereby achieving a precise mapping from text descriptions to geographic scene representations. The model input follows a unified paradigm, combining task instructions, query statements, text to be encoded, and terminators to ensure consistent expression of different types of semantic information in the vector space. This model can simultaneously encode the semantic features of ground features and their implicit spatial attributes in the vector space, giving it a stronger ability to understand geographic scenes.
[0009] To enhance the model's ability to understand complex geographic semantics and spatial relationships, the Qwen3-GeoEmbedding-8B model employs a multi-stage progressive training strategy. First, it integrates publicly available geographic data sources such as OpenStreetMap and GeoNames to construct a large-scale geographic entity corpus. Geographic coordinate information is encoded and then jointly input into the model with text descriptions, enabling the model to establish a correspondence between textual semantics and spatial location during training. Subsequently, by introducing a training method that combines geographic semantics and spatial relationships as constraints, the model is guided to maintain both semantic similarity and spatial consistency within the embedding space, thereby enhancing its ability to perceive geographic context. Building upon this foundation, high-quality urban spatial text data is further used to refine the model's training, further improving its understanding of urban functions, spatial structures, and complex contexts.
[0010] After model training is complete, a high-dimensional vector interpolation strategy is introduced during the model fusion stage to improve the smoothness and stability of the embedding space. Spherical linear interpolation can be used to fuse embedding results from different training stages or different expert models. By performing smooth interpolation on a unit sphere, this method can maintain semantic consistency while avoiding discontinuities or semantic distortions in vector representations, thereby improving the model's robustness in urban spatial analysis tasks.
[0011] The trained semantic embedding vectors are stored in a PostgreSQL database through the PGVector extension, enabling efficient management and similarity retrieval of natural language semantic vectors. The PGVector extension supports multiple vector similarity measurement methods and can work in conjunction with the database's existing spatial indexing mechanism: on the one hand, it can quickly filter the spatial extent of geographic entities based on the PostGIS spatial index; on the other hand, it can perform semantic similarity matching on candidate data based on the vector index, thereby achieving synergy between semantic retrieval and spatial retrieval.
[0012] According to the above technical solution, the semantic-spatial dual index is constructed by building a high-dimensional semantic vector index and a spatial index; the high-dimensional semantic vector index and the spatial index are associated through a unified geographic entity ID to form a collaborative retrieval framework; The high-dimensional semantic vector index is used to extract and encode key semantic features and contextual relationships in the data metadata; the spatial index is used to organize the geographical location and topological information of the data.
[0013] This dual-indexing mechanism enables the system to simultaneously understand the semantic meaning and spatial constraints of user queries during the retrieval phase. It not only accurately understands the semantic intent of the user query but also ensures the spatial accuracy of the retrieval results, thereby quickly and precisely matching the most relevant data and significantly improving the efficiency and accuracy of urban spatial data retrieval and analysis tasks. Simultaneously, the database table structure and related attributes are provided to the multimodal large language model in a readable form, offering rich context and significantly improving the efficiency of subsequent data retrieval and the accuracy of generation tasks. This provides complete and reliable contextual support for its subsequent task planning and reasoning.
[0014] According to the above technical solution, the input task is decomposed into a set of structured and executable sub-task sequences using the multimodal large language model. For the sub-task sequences, semantic-spatial dual indexes are used for autonomous data exploration. Specifically, for queries based on semantic conditions, high-dimensional semantic vector indexes are used for initial recall, followed by spatial constraints. For queries based on spatial range, candidate regions are first determined using spatial indexes, followed by semantic filtering using high-dimensional semantic vector indexes. For complex queries that simultaneously contain both spatial and semantic constraints, the two types of indexes are used in a coordinated or alternating manner, and the results are comprehensively sorted.
[0015] Its core objective is to automatically transform user-generated spatial query or analysis requests in natural language into structured task representations, guiding subsequent data retrieval processes. In practice, after a user submits a request for urban spatial analysis or monitoring in natural language, the system first uses a multimodal large language model to perform deep semantic parsing of the input. This identifies and extracts key elements of the task, including spatial scope (e.g., administrative regions, buffer zones, grid cells), target objects (e.g., buildings, roads, green spaces, or population rasters), analysis type (statistical analysis, spatial relationship analysis, temporal change detection, etc.), and desired output format. The system also accurately identifies the data type required for the task—whether it's vector data, raster data, or auxiliary information such as text and images. Based on this, the high-level natural language requirements are automatically broken down into a set of structured, executable subtasks, and the required data type and computation method are matched to each subtask. Relying on the constructed "semantic-spatial" dual-index system, the system can autonomously explore and accurately retrieve data, automatically locating the most relevant vector and raster datasets without requiring manual data path specification.
[0016] According to the above technical solution, the steps for constructing the reflexive enhanced task graph are as follows: The subtask sequence obtained from task parsing is formally organized into a directed acyclic task graph G after dependency analysis: ; in, Represents a set of task nodes. This indicates dependencies between tasks. When dependencies exist... When, explain the task The input depends on The system determines the execution order and parallelism of tasks based on dependencies, forming a hierarchical execution plan that enables phased division of labor for spatial computing tasks among multiple agents.
[0017] When executing the directed acyclic task graph, each agent node reflects on its decision or outcome before executing its core function, pre-evaluating it to obtain a self-score. If the self-score is lower than a threshold, the node's internal decision adjustment and optimization are triggered. ; Represents a node The self-score, the internal performance score under the intelligent agent role, is used for subsequent policy adjustment and optimization; Represents the reflection function. For nodes If the self-assessment score of the corresponding intelligent agent role is lower than the threshold, it will trigger internal decision adjustment and optimization to prevent errors from the source.
[0018] During and after the execution of the directed acyclic task graph, inter-graph reflection is performed using a long short-term memory architecture. This involves caching short-term memory, such as immediate feedback, errors, and local optimization information from the current task execution. This assists the system in making adaptive adjustments to subsequent nodes. After the initial task map is completed, the complete trajectory of the current task (including planning, tool usage, reflection and scoring, and final output) is stored, utilizing this long-term memory. This enables in-task strategy iteration and optimization. Based on comprehensive analysis of long short-term memory, the system can dynamically optimize the task graph, generating an adjusted, reflective, enhanced task graph. ): .
[0019] According to the above technical solution, after completing task parsing and data matching, the system enters the multi-agent collaborative spatial semantic reasoning and analysis stage. First, spatial consistency detection and topological relationship correction are performed on the retrieved multi-source spatial data, including coordinate reference system one, geometric validity checks, and spatial superposition relationship verification, to ensure the reliability of subsequent analysis results. Subsequently, the reflective enhanced task graph, after combining various sub-tasks, is executed collaboratively in parallel by multiple agents. Each agent is responsible for a different functional domain and embeds a reflection process within its node during its decision-making cycle. Different agents, based on their functional roles, are responsible for spatial computation (such as buffer analysis, spatial connectivity, and grid statistics), semantic reasoning (such as interpreting indicator meanings and judging spatial relationship logic), and result evaluation, respectively. In this process, semantic reasoning and spatial computation are coupled: semantic information guides the selection of analysis paths, while spatial analysis results, in turn, supplement the contextual information required for semantic inference, thus forming a closed-loop reasoning mechanism. This collaborative reasoning process significantly improves the robustness and intelligence of the system in complex urban spatial monitoring tasks. This two-stage reflection mechanism creates a closed loop of "evaluation-execution-learning-optimization." It ensures the dual consistency of the agent's output in both logical and geospatial dimensions, significantly reduces the risk of error propagation, and enables the system to intelligently handle fuzzy, complex, and dynamically changing urban spatial problems, realizing the evolution from "data-driven" to "knowledge-driven" and ultimately to "optimization-driven".
[0020] According to the above technical solution, the intelligent compilation mechanism for constructing geographic semantics and visualization expression automatically selects an appropriate visualization method based on the analysis target and result characteristics. Based on the geographic cartographic knowledge accumulated by the large language model, it automatically optimizes the parameter settings for visualization generation and generates visualization effects after performing spatial consistency detection and topological correction.
[0021] Specifically, based on the analysis objectives and result characteristics, the system automatically selects appropriate visualization methods, such as thematic maps, statistical charts, spatial distribution heat maps, or multi-scale interconnected display models. In this process, semantic information is used not only to determine the visualization type but also to guide the design of symbolization rules and expressive priorities. For example, colors, symbol sizes, and layer hierarchy are dynamically adjusted based on the semantic attributes of geographical features, thereby enhancing the readability and decision support value of the results. Ultimately, the system generates visualizations tailored to user needs, which can be directly used for urban spatial monitoring, planning evaluation, or management decision support, achieving a complete closed loop from natural language input to spatial cognitive output.
[0022] This includes a technical solution: a multi-agent collaborative retrieval and enhanced generation urban spatial analysis system, comprising: The data storage and indexing module standardizes multi-source, heterogeneous urban spatial feature data and constructs a semantic-spatial dual index. This semantic-spatial dual index is built by constructing a high-dimensional semantic vector index and a spatial index. The high-dimensional semantic vector index and the spatial index are linked through a unified geographic entity ID, forming a collaborative retrieval framework. This enables efficient organization and joint retrieval of spatial data in both semantic and spatial dimensions, thereby supporting accurate data location for natural language queries. The urban spatial feature data includes at least vector data and raster data. The multi-agent collaboration module allows users to submit task requirements via natural language. It then uses a multimodal large language model to parse the task into a structured, executable sequence of sub-tasks and autonomously explores the data using a semantic-spatial dual-index. Based on a reflective enhanced task graph, it performs multi-agent collaborative spatial semantic reasoning and analysis. Upon receiving the parsed task instructions, the module automatically completes the entire process from relevant data retrieval, joint spatial and semantic reasoning, spatial analysis and computation to result consistency verification, effectively ensuring the consistency and accuracy of urban spatial research tasks at both the semantic understanding and spatial data representation levels.
[0023] The natural language interaction module serves as the system's human-computer interaction entry point. It receives natural language tasks input by the user and converts the task text into corresponding semantic vectors to drive spatial data retrieval and analysis operations. Simultaneously, the module performs semantic integration and language generation on the intermediate results and final output generated by the multi-agent collaboration module, transforming them into natural language response results that are highly readable at the expression level and maintain spatial logical consistency at the content level, and then feeding them back to the user.
[0024] The visualization module, through an intelligent compilation mechanism that integrates geographic semantics and visual representation, automatically transforms structured conclusions and spatial data obtained from multi-agent collaborative reasoning into visual representations. It can automatically map spatial computation and reasoning results into multi-dimensional geographic expressions, outputting them as thematic maps, statistical charts, or spatial distribution models, thereby enhancing the interpretability and decision support capabilities of urban spatial research results.
[0025] Including a technical solution, the present invention further provides an electronic device, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to execute the multi-agent collaborative retrieval enhanced generation urban spatial analysis method described in any of the above technical solutions.
[0026] Including a technical solution, the present invention further provides a storage medium storing at least one instruction, which is loaded and executed by a processor to implement the multi-agent collaborative retrieval enhanced urban spatial analysis method described in any of the above technical solutions.
[0027] Compared with the prior art, the beneficial effects achieved by the present invention are: 1. This invention constructs a dual indexing system of "semantic vector index - spatial index" and associates the two based on a unified geographic entity representation. Combined with the spatial semantic reasoning capabilities of a multimodal large language model, it effectively alleviates the semantic ambiguity and spatial mismatch problems that easily occur in traditional retrieval enhancement generation methods in urban spatial tasks. Through joint modeling of semantic relevance and spatial constraints, it significantly improves the accuracy and stability of core tasks such as geographic information retrieval, spatial feature representation, and spatial relationship reasoning.
[0028] 2. This invention, based on a multi-agent collaborative mechanism, connects the entire processing chain from natural language requirement parsing, autonomous spatial data retrieval, semantic and spatial joint reasoning to result generation and expression. The system can autonomously drive the spatial analysis and visualization generation process, including professional mapping, without human intervention, and performs semantic understanding and consistency verification on the generated results. This transforms the traditional urban spatial analysis process, which relies on multiple manual steps, into a highly automated intelligent processing flow, significantly improving overall analysis efficiency.
[0029] 3. This invention continuously optimizes the analysis process and output results through intra-node reflection and inter-graph reflection update mechanisms. This closed-loop processing method ensures the validity and interpretability of spatial analysis results in the time dimension, and is particularly suitable for smart city operation management, disaster emergency response, and other decision-making scenarios with high real-time requirements.
[0030] 4. This invention supports direct interaction based on natural language, allowing users to complete complex urban spatial research and analysis tasks without requiring professional GIS operation or spatial analysis skills. It can automatically understand user intent and match corresponding data and analysis processes, effectively reducing the reliance on professional technical personnel in urban spatial research and significantly expanding the system's applicability in various application scenarios such as urban planning management, scientific research analysis, and public services.
[0031] 5. This invention adopts a modular system architecture, with each functional module being independent and having clear interfaces, supporting flexible expansion to new agent types or access to new data source types. The system can adapt to the multi-source spatial data analysis needs of large-scale, complex cities, as well as meet the basic spatial research needs of small and medium-sized cities or regions, possessing good scalability, maintainability, and application promotion value. Attached Figure Description
[0032] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the steps of the multi-agent collaborative retrieval enhancement method for urban spatial analysis of the present invention; Figure 2 This is a block diagram of an urban spatial analysis system that enhances multi-agent collaborative retrieval. Figure 3 This is a schematic diagram of a geographic information retrieval example; Figure 4 This is a schematic diagram of spatial feature analysis of the embodiment; Figure 5 This is a visualization-themed map generated by multi-agent driven retrieval enhancement in the implementation example. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] Example 1: A multi-agent collaborative retrieval-enhanced urban spatial analysis method, the steps of which include: S1. Standardize multi-source, heterogeneous urban spatial feature data and construct a semantic-spatial dual index. Specifically: S101 integrates two main categories of urban spatial feature data sources: vector data (such as roads, buildings, administrative boundaries, green spaces, and water bodies) and raster data (such as population density and digital elevation models). A dedicated metadata table is established for centralized management of all these spatial data and their descriptive information. For various types of vector geographic data, such as points, lines, and polygons, and their complex spatial topological relationships, natural language semantic descriptions are embedded at the database table and field levels to meticulously characterize the spatial morphological features, functional attributes, and interrelationships of geographic entities, thereby achieving deep integration of spatial data and semantic information. In terms of raster data processing, the PostGIS PGRaster extension module enables efficient storage and unified management of spatiotemporal data such as satellite remote sensing imagery, digital elevation models (DEMs), and climate rasters. Geospatial data of different modalities undergo format standardization and semantic annotation during the data entry stage, establishing a clear and stable mapping relationship between spatial data and natural language semantics, ensuring accurate parsing and retrieval by the large language model in subsequent task inference and visualization analysis.
[0035] S102. By introducing a fine-tuning strategy to enhance geographic knowledge, the structure and training of the Qwen3-Embedding-8B model are optimized. The trained Qwen3-Embedding-8B model is then used to transform the normalized urban spatial feature data into a high-dimensional vector.
[0036] In this embodiment, the Qwen3-GeoEmbedding-8B model employs a four-stage progressive pre-training process for geographic semantic understanding, specifically: Phase 1: Geospatial Data Construction and Encoding. The model constructed a spatial feature corpus of hundreds of millions of elements by accessing the OpenStreetMap and GeoNames databases. To uniformly process heterogeneous geographic information, the original coordinates were converted into high-dimensional spatial vectors using sine and cosine encoding, thus forming a structured input format: "[Feature Description] | [Spatial Encoding] | [Feature Category]". This process helps the model learn the correspondence between textual semantics and spatial location across a wide range of data and capture subtle differences in different contexts.
[0037] The second stage: Contrastive learning for spatial awareness. By constructing joint geo-semantic positive and negative sample pairs, the model is driven to fuse textual descriptions and spatial coordinates. Positive samples use descriptions of the same geographical feature and their coordinates; negative samples include semantic negative samples (randomly selected descriptions of different geographical features) and spatial negative samples (geographically distant but semantically similar descriptions, such as "Wangfujing in Beijing" and "Nanjing Road in Shanghai"). This training enables the model to maintain both semantic relevance and spatial proximity in the joint embedding space, establishing a geographical context-aware capability.
[0038] Phase Three: Refined Training in Geographic Context. The model undergoes refined training using carefully selected high-quality, multi-dimensional urban spatial text data to further enhance its deep understanding of complex urban contexts and spatial relationships. By selecting texts containing clear spatial relationships, feature functions, and scenes, the model is forced to learn deeper and more subtle feature functional attributes and spatial contextual patterns, further improving its ability to deeply understand and represent urban spatial semantics, functional attributes, and multi-layered contextual patterns.
[0039] Phase Four: Model Fusion and Spatial Smoothness Optimization. The model employs spherical linear interpolation, fusing expert models obtained from multiple training phases. During the fusion process, spatial smoothness constraints are introduced to ensure the model's consistency and robustness in urban spatial analysis. As an interpolation technique in high-dimensional space, spherical linear interpolation, with its smooth transition characteristics on a unit sphere, can perfectly maintain the semantic consistency of the embedded vectors. Specifically, given a unit vector... and Interpolation function between It can be represented as: ; ; In the above spherical linear interpolation process, the interpolation parameters The value of is between 0 and 1. This method effectively preserves the geometric properties of vectors and avoids semantic inconsistencies or unnatural changes that may be caused by traditional linear interpolation methods. Through this precise interpolation technique, the model can transition more smoothly in high-dimensional space, ensuring that the generated vectors are semantically consistent and have stronger expressive power.
[0040] S103. Construct a high-dimensional semantic vector index and a spatial index; the high-dimensional semantic vector index and the spatial index are associated through a unified geographic entity ID to form a collaborative retrieval framework; among them, the high-dimensional semantic vector index is used to extract and encode key semantic features and contextual relationships in the data metadata; the spatial index is used to organize the geographic location and topological information of the data.
[0041] S2. After the user submits a task request in natural language, the multimodal large language model is used for task parsing, and semantic-spatial dual indexing is used for autonomous data exploration. Specifically, the multimodal large language model is used to decompose the input task into a set of structured, executable sub-task sequences, and semantic-spatial dual indexing is used to explore the data autonomously for the sub-task sequences.
[0042] For example, taking the query "distribution of recently constructed commercial buildings and surrounding traffic conditions in a city center" as an example, the system can quickly identify the geographic object type "commercial buildings" and clarify that "distribution" corresponds to vector data and "surrounding traffic conditions" corresponds to spatiotemporal dynamic data such as traffic flow. Through fine-grained parsing of natural language, complex queries are broken down into logically clear and goal-oriented subtasks, laying a solid foundation for subsequent data retrieval and analysis. The user-input natural language query is decomposed into a sequence of subtasks ( This can be represented as: ; Subsequently, the system generates a data exploration strategy based on the parsed semantic features. This strategy includes: using spatial indexing techniques (such as R-trees and quadtrees) to quickly locate relevant geographic data; filtering data subsets that meet certain conditions based on attribute information; and combining spatiotemporal constraints to ensure that the acquired data meets the task requirements in terms of timeliness and relevance. Taking the search for buildings within a certain area as an example, the parsing module maps the subtask into a set of structured data information, facilitating downstream retrieval, similarity matching, and spatiotemporal analysis. ; in This represents a task decomposition function based on a large language model, where each... This corresponds to a geographic data entry or dataset to be retrieved. During the parsing process, the system can automatically identify the type of geographic entity involved in the query (such as roads, buildings, rivers, or land use types). By employing efficient spatial indexing technologies such as R-trees and quadtrees, the system can quickly filter out all building vector data located within a specific area, thus significantly improving data acquisition efficiency. Simultaneously, the system precisely filters data based on attribute information, further enhancing retrieval accuracy. For example, it can filter a subset of building data that meets specific building age, building use, and other criteria from a large amount of building data. To achieve efficient similarity matching and provide comprehensive and accurate data support for intelligent urban spatial monitoring, this invention uses cosine distance as a similarity metric. Cosine distance is a commonly used metric to measure the similarity between two non-zero vectors; the smaller the value, the higher the similarity between the two vectors. Its specific formula is: ; The geographic entity information to be retrieved is vector A, and the data description in the database is vector B. Their cosine distance is... Represents the similarity in their semantic space, when the directions of the two vectors are exactly the same (i.e., Their cosine distance is 0, indicating complete similarity; when the directions of the two vectors are completely opposite (i.e., ... The cosine distance is 2, indicating that they are completely dissimilar.
[0043] S3. After completing task parsing and autonomous data exploration, perform multi-agent collaborative spatial semantic reasoning and analysis based on the reflective enhanced task graph. Specifically: Reflective Enhanced Task Graph Construction: The sub-task sequence obtained from task parsing is formally organized into a directed acyclic task graph after dependency analysis. When executing the directed acyclic task graph, in-node reflection is performed before each agent node executes its core function, pre-evaluating its upcoming decision or result to obtain a self-score. If the self-score is lower than a threshold, the decision adjustment and optimization within the node are triggered. During and after the execution of the directed acyclic task graph, inter-graph reflection is performed through a long short-term memory architecture. Based on the comprehensive analysis of long short-term memory, the directed acyclic task graph is dynamically optimized to generate an adjusted reflective enhanced task graph.
[0044] Multi-agent collaborative execution: To achieve efficient execution of complex spatial tasks after combining various sub-tasks, a multi-type collaborative agent system is designed in the reflective augmented task graph. Each agent is responsible for a specific functional domain and embeds an in-node reflection process within its decision-making cycle. Typical roles include: Query Understanding Agent: This agent serves as the system entry point, transforming natural language requirements into structured tasks. Its reflection focuses on evaluating the completeness, logical consistency, and accuracy of the task decomposition, as well as the understanding of ambiguous semantics. For example, for the query "Find old residential areas with inconvenient subway access," reflection ensures that the decomposed sub-task chain (searching for residential areas, searching for subway stations, calculating distances, and filtering) is complete and logically consistent.
[0045] Retrieval Agent: This agent is responsible for accurately retrieving data from spatial databases (such as PostGIS). Its reflection is based on historical retrieval feedback in short-term memory, evaluating the rationality of the current query strategy (such as spatial filtering conditions and utilization of temporal patterns) to avoid repeated and invalid searches.
[0046] Spatial analysis agent: This agent is responsible for performing geometric calculations, spatial statistics, and pattern recognition (such as clustering and anomaly detection). Its reflection focuses on the applicability of the analytical methods, the rationality of parameter settings, and the spatial logical credibility of the results. For example, it can use clustering analysis techniques to identify potential "urban heat island" effect areas or to identify patterns of abnormal traffic flow peaks.
[0047] A semantic reasoning agent is responsible for transforming massive amounts of spatial data into meaningful insights, helping the system identify problems and propose optimization solutions. Through causal reasoning and the construction of knowledge graphs, it organizes various spatial relationships, activities, and influencing factors in the city for in-depth analysis, revealing potential influencing factors and the root causes of problems. Simultaneously, the agent can analyze data from different dimensions, providing urban planners with cross-level, comprehensive optimization suggestions.
[0048] Supervisory Agent: This agent plays a monitoring and coordination role throughout the entire task execution process. It monitors the task's execution status in real time, identifies and resolves conflicts within the task, and ensures that the task is completed as planned. When anomalies occur, the supervisory agent can automatically deduce the root cause of the problem and take corrective action, ensuring stable system operation. Furthermore, it can dynamically optimize resource allocation, improve the efficiency of computing resource utilization, and ensure that tasks can be executed efficiently under various conditions.
[0049] The mapping agent is designed to visualize complex spatial data, helping users understand and analyze it more intuitively. It automatically identifies relationships between data points and displays them graphically, supporting various visualization formats such as heatmaps and GIS displays, enabling users to perform data analysis at different dimensions and scales. The mapping agent also features automated color matching and design capabilities, ensuring that the visualizations are not only aesthetically pleasing but also deliver efficient information delivery.
[0050] Logically, these agents form a hierarchical collaborative structure where lower-level agents focus on raw data manipulation and computation, while upper-level agents concentrate on semantic interpretation and logical reasoning. This drives the task flow from a "data-driven" to a "knowledge-driven" progressive development. During collaborative execution, the agents exchange information through a shared communication interface, forming a reflective collaborative chain. The communication content includes data descriptions, execution results, spatial relationships, and task status. Let the set of agents be... The message passing process of the system can be represented as: ; in, To send intelligent agents The output results, Indicates the receiving agent The mission intent This is a message conversion function used to map the format of results to semantic input. The system continuously optimizes through inter-graph reflection. Short-term memory enables the retrieval and analysis agents to adjust strategies in real time; long-term memory triggers a re-evaluation of the plan when a task fails or the result is unsatisfactory. The query understanding agent uses historical trajectories to optimize the task decomposition scheme, forming a new and improved task graph for re-execution. This two-stage reflection mechanism creates a closed loop of "evaluation-execution-learning-optimization." It ensures the dual consistency of the agent's output in both logical and geospatial dimensions, significantly reduces the risk of error propagation, and enables the system to intelligently handle fuzzy, complex, and dynamically changing urban spatial problems, realizing the evolution from "data-driven" to "knowledge-driven" and ultimately to "optimization-driven."
[0051] S4. By constructing an intelligent compilation mechanism for geographic semantics and visualization, the structured conclusions obtained from multi-agent collaborative reasoning are automatically transformed into spatial data for visualization. Specifically: First, the drawing agent receives the structured task semantics (including the object of analysis, dimensions, and spatiotemporal range) output by the query understanding agent and the standardized data processed by the spatial analysis agent. Through a semantic-spatial dual-index matching algorithm, the system establishes precise associations to ensure spatial consistency of the data. To address the spatiotemporal inconsistency problem of multi-source data, the system introduces an automatic spatiotemporal dimension alignment algorithm. For example, when a user queries "compare population density in the Beijing-Tianjin-Hebei region and the Yangtze River Delta in 2020," the system can automatically identify and process the differences in time granularity between the two regions (e.g., annual data for Beijing-Tianjin-Hebei and quarterly data for the Yangtze River Delta), and perform weighted fusion of the original data using a spatiotemporal interpolation algorithm. ; in, These are dynamic weighting coefficients determined based on a combination of temporal proximity and data quality. For the first Each data source at its original time point The observations were fused after spatiotemporal alignment and scale transformation. Target time The fused data values represent estimated metrics (such as population density) at a user-spatiotemporally aligned target time (such as the entire year of 2020). The number of original data points participating in the fusion is crucial; these data points may originate from different data sources, different time granularities (e.g., annual, quarterly), or different spatial units. By generating spatiotemporally comparable datasets, the scientific rigor and accuracy of subsequent visualization comparisons are ensured. Based on this, the intelligent decision-making and compilation phase of the visualization solution utilizes a rule-model hybrid decision engine to achieve precise selection based on geographic cartographic standards and cognitive science. This engine first performs multi-dimensional feature analysis on the input data, including calculating the data distribution skewness (…). ) and spatial autocorrelation index ( The former is used to characterize the distribution pattern and asymmetry of attribute data, while the latter is used to measure the spatial clustering or dispersion of attribute values, thereby determining the optimal visualization scheme: ; ; in, It represents the value of a certain attribute in a geographic dataset (such as population density, GDP, etc.). This is the arithmetic mean of the dataset. This is a mathematical expectation operator, which is usually approximated by the sample mean in actual calculations. The standard deviation of the data is used to characterize the dispersion of attribute values. This is the global mean of all cell attribute values in this space. This refers to the total number of spatial units (such as administrative districts or regular grids) within the research area. Spatial weights represent spatial units. and Spatial relationships between them (such as adjacency, distance decay, or K-nearest neighbor relationships). This is the sum of all spatial weights.
[0052] Specifically, when the spatial autocorrelation index I of a geographic dataset is greater than 0.3 and the skewness is... When the threshold is >1.5, the system will prioritize the use of hierarchical color maps and quantile classification to maximize inter-class differences and reduce the impact of outliers. This is because quantiles can more effectively reveal regional difference patterns in highly clustered and right-skewed geographic data (such as population density).
[0053] Subsequently, based on the geographic cartographic knowledge accumulated by the large language model, the system will automatically optimize the parameter settings for visualization generation. This optimization process takes into account the diversity of spatial data and performance requirements, and includes optimizations to key visualization elements such as raster data transparency adjustment, vector boundary line width, legend, scale bar, coordinate system, and data scale. This ensures that the generated map conforms to geographic cartographic standards and generates dynamic visualization configurations based on geographic context. ; Where R represents the spatial calculation result, and S represents the spatial extent and coordinate reference information. This is a set of visualization parameters (including color scheme, layer transparency, scale, etc.). This function uses the semantic reasoning capabilities of a large model to automatically extract the visualization intent from the task description. For example, when a user requests "Display the distribution of green spaces in the main urban area of Nanjing," the system will automatically identify the visualization operation corresponding to "display," the land cover type corresponding to "green space distribution," and select the most matching data layer from the result set for map rendering.
[0054] To ensure the accuracy and scientific validity of the visualization results, the system performs spatial consistency checks and topological corrections before generating maps. This ensures that the output results are free of spatial topological conflicts and conform to geographic cartographic standards in visual representation. This process includes: Spatial matching detection: For example, the system will detect whether the spatial range of building height data completely covers the user's required range, ensuring that "data outside the required range is mixed in" or "data within the required range is missing" does not occur.
[0055] Time synchronization verification: For bivariate data (such as plot ratio and traffic congestion index), the system will check whether their timestamps are consistent to prevent bias in correlation analysis caused by "spatiotemporal mismatch".
[0056] Automatic correction and optimization: If problems are detected (such as overlapping vector data boundaries, raster data projection distortion, or excessive differences in the range of bivariate data values), the system will automatically perform corrections. For example, if adjacent building footprints overlap, the system will correct the boundaries using a "topology fusion algorithm" to ensure unique height values; if raster data has projection distortion, the system will unify the coordinate system using "projection transformation correction" to ensure spatial accuracy; if the range of data values differs too much, the system will unify the range of values using "data standardization processing" to avoid visual imbalance.
[0057] Furthermore, the entire visualization generation process incorporates a two-stage reflection and optimization mechanism to achieve continuous evolution. In-node reflection (pre-generation assessment) assesses cognitive load through an eye-tracking prediction model. The model is trained based on geographic expert scoring tracking data. ; Where V represents visual element complexity, D represents information density, and C represents color contrast. , , These are all model parameters. When cognitive load... Automatic adjustment is triggered when a certain threshold is exceeded; while inter-graph reflection (post-generative learning) accurately tracks the decision nodes that lead to user dissatisfaction through a decision path backtracking algorithm, and uses a weight update formula: ; in For error function, For learning rate, and These represent the weights before and after reflection, respectively.
[0058] Based on this, the system establishes a geographic visualization strategy version control system, recording the context and effects of each decision adjustment. This makes the optimization process traceable and verifiable, avoiding performance degradation caused by blind adjustments. Ultimately, it forms an intelligent system that can learn from each interaction, with visualization quality improving exponentially over time. Through this semantic-driven automated visualization generation mechanism, the system not only improves the presentation of spatial data but also ensures that the visualization results meet user needs and have high interpretability. This intelligent visualization method greatly reduces the operational threshold for users while improving the efficiency of data analysis and decision support. Especially in complex urban spatial monitoring and analysis tasks, it effectively improves the accuracy and operability of the results.
[0059] Example 2: Geographic Information Retrieval This case study focuses on the question: "What is the largest inland waterway in Nanjing? What is its area?" The task requires a large language model to accurately retrieve relevant information from a database within the urban spatial area, integrating various spatial element data, and generate an answer that conforms to natural language expression. The task execution process consists of several main stages. First, the task planning agent performs semantic parsing of the input question, identifying key geographical elements—the administrative boundaries of Nanjing and the distribution data of inland waterways. Then, the task planning agent breaks down the question into several sub-tasks, including defining the administrative boundaries of Nanjing, selecting waterways, and calculating their area.
[0060] Next, the task decomposition agent breaks down the overall task into multiple sub-tasks based on the target requirements. It then executes spatial queries on the PostGIS database to extract vector data of all water bodies within the administrative area of Nanjing City and calculates the area of each body. In this stage, the retrieval agent efficiently searches the database to ensure the comprehensiveness and accuracy of the search results.
[0061] In the results generation phase, the result generation agent performs statistical analysis on the retrieved spatial data and uses natural language processing technology to semantically describe it, transforming the data into easily understandable text output. After analysis, the model automatically generated the following concluding text: "The largest inland water body in Nanjing is Shijiu Lake, with an area of approximately 210.4 square kilometers. As one of the most important water bodies in Nanjing, Shijiu Lake holds a significant position in the city's water system and is an important component of the regional ecosystem and water resource management."
[0062] Through this process ( Figure 3 The system can not only automatically identify and process user-submitted questions, but also accurately retrieve information from spatial databases to generate answers that meet actual needs. This intelligent retrieval and generation method greatly improves the efficiency and accuracy of urban spatial information analysis, providing strong technical support for urban planning, environmental management, and decision support.
[0063] Example 3: Spatial Feature Analysis: To verify the capabilities of the multi-agent-driven retrieval-enhanced urban spatial research method in the comprehensive analysis and semantic generation of multi-source heterogeneous spatial data, the second case study (Figure 4) selects "the spatial distribution characteristics of Nanjing's population" as a typical question. In this case, the user poses the question in natural language: "What are the spatial distribution characteristics of Nanjing's population?" This question requires the system not only to retrieve and integrate relevant spatial distribution data of Nanjing, but also to generate a natural language description that conforms to logic and geographical semantics, thereby demonstrating the framework's collaborative reasoning capabilities in spatial cognition and language generation.
[0064] First, after receiving user input, the task planning agent uses a semantic parsing model to identify the spatial scope (administrative area of Nanjing City) and analysis topic (population distribution characteristics) in the query. The agent further determines the data type and spatial resolution requirements needed to complete the task, and automatically decides which raster data (e.g., population density grid) and vector data (e.g., administrative boundaries) to access. This semantic parsing stage not only ensures the spatial and semantic alignment of the task objective but also sets clear structured constraints for subsequent task decomposition and data retrieval. Next, the task decomposition agent transforms the overall analysis objective into several executable sub-tasks. Each sub-task corresponds to a specific spatial operation, such as population raster clipping, administrative unit masking, statistical summarization, and spatial clustering analysis. Simultaneously, the mapping function generates corresponding structured data access requirements and processing rules, ensuring the accuracy and efficiency of data retrieval. In the data retrieval stage, the retrieval agent automatically generates spatial SQL queries based on task dependencies and uses the PostGIS interface to jointly extract vector and raster data. Spatial constraints (such as the ST_Intersects and ST_Clip functions) ensure that only effective population density raster data within the administrative boundaries of Nanjing City are extracted, providing an accurate data foundation for subsequent analysis. In the reasoning and result generation phases, the result generation agent and the visual agent work collaboratively. The former uses a large language model to abstract and summarize statistical and spatial pattern results; the latter, based on a multimodal model, extracts spatial structural features from the raster data from a visual perspective, identifying the core areas and transition zones of population density (as shown in Figure 5). Through a fusion mechanism of visual and semantic elements, the system can extract implicit geographical relationships from the spatial pattern and transform them into interpretable natural language expressions. For example, the system automatically generates the description: "Nanjing City's population density exhibits a significant center-periphery decreasing distribution pattern. The core urban areas (such as Gulou District and Qinhuai District) have the highest population density, while the peripheral areas (such as Lishui and Pukou) are relatively sparse. This distribution characteristic is highly correlated with topographic relief, land use intensity, and traffic accessibility, with significantly higher population density along major transportation arteries and economic functional zones." Finally, the task integration agent performs logical fusion and semantic consistency verification on the output results of all subtasks. The resulting natural language response is not only highly readable, but also maintains spatial logical consistency at the content level, demonstrating the deep collaborative capabilities of the multi-agent-driven retrieval enhancement generation framework in spatial data understanding, visual feature extraction, and language generation.
[0065] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0066] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A multi-agent collaborative retrieval-enhanced urban spatial analysis method, characterized in that, The steps include: Standardize multi-source heterogeneous urban spatial feature data and construct a semantic-spatial dual index; After users submit task requests in natural language, the task is parsed using a multimodal large language model and the data is explored autonomously using a semantic-spatial dual index. After completing task analysis and autonomous data exploration, multi-agent collaborative spatial semantic reasoning and analysis are performed based on the reflective enhanced task graph. By constructing an intelligent compilation mechanism for geographic semantics and visualization, the structured conclusions obtained from multi-agent collaborative reasoning are automatically transformed into spatial data for visualization.
2. The urban spatial analysis method with enhanced multi-agent collaborative retrieval as described in claim 1, characterized in that, By introducing a fine-tuning strategy to enhance geographic knowledge, the structure and training of the Qwen3-Embedding-8B model are optimized. The trained Qwen3-Embedding-8B model is then used to transform the normalized urban spatial feature data into a high-dimensional vector.
3. The urban spatial analysis method with enhanced multi-agent collaborative retrieval as described in claim 2, characterized in that, The semantic-spatial dual index is constructed by a high-dimensional semantic vector index and a spatial index; the high-dimensional semantic vector index and the spatial index are associated through a unified geographic entity ID to form a collaborative retrieval framework. The high-dimensional semantic vector index is used to extract and encode key semantic features and contextual relationships in the data metadata; the spatial index is used to organize the geographical location and topological information of the data.
4. The urban spatial analysis method with enhanced multi-agent collaborative retrieval as described in claim 3, characterized in that, The input task is decomposed into a set of structured and executable sub-task sequences using the multimodal large language model. For the sub-task sequences, semantic-spatial dual indexes are used for autonomous data exploration. Specifically, for queries based on semantic conditions, high-dimensional semantic vector indexes are used for initial recall, followed by spatial constraints. For queries based on spatial range, candidate regions are first determined using spatial indexes, followed by semantic filtering using high-dimensional semantic vector indexes. For complex queries that contain both spatial and semantic constraints, the two types of indexes are used in a coordinated or alternating manner, and the results are comprehensively ranked.
5. The urban spatial analysis method with enhanced multi-agent collaborative retrieval as described in claim 4, characterized in that, The steps for constructing the reflexive enhanced task graph are as follows: The sequence of subtasks obtained from task parsing is formally organized into a directed acyclic task graph after dependency analysis. When executing the directed acyclic task graph, each agent node reflects on its decision or result before executing the core function and obtains a self-evaluation score. If the self-evaluation score is lower than the threshold, the decision adjustment and optimization within the node are triggered. During and after the execution of the directed acyclic task graph, inter-graph reflection is performed through a long short-term memory architecture. Based on the comprehensive analysis of long short-term memory, the directed acyclic task graph is dynamically optimized to generate an adjusted, reflective, and enhanced task graph.
6. The urban spatial analysis method with enhanced multi-agent collaborative retrieval as described in claim 5, characterized in that, The reflective augmented task graph combines various sub-tasks and executes them in parallel through the collaboration of multiple agents. Each agent is responsible for a different functional domain and embeds a reflective process within the node during its decision-making cycle.
7. The urban spatial analysis method with enhanced multi-agent collaborative retrieval as described in claim 6, characterized in that, The intelligent compilation mechanism for constructing geographic semantics and visualization expressions automatically selects an appropriate visualization method based on the analysis objectives and result characteristics. Then, based on the geographic cartographic knowledge accumulated by the large language model, it automatically optimizes the parameter settings for visualization generation and performs spatial consistency detection and topological correction before generating the visualization effect.
8. A multi-agent collaborative retrieval-enhanced urban spatial analysis system, characterized in that, include: The data storage and indexing module standardizes multi-source heterogeneous urban spatial feature data and constructs a semantic-spatial dual index. The semantic-spatial dual index is constructed by building a high-dimensional semantic vector index and a spatial index. The high-dimensional semantic vector index and the spatial index are associated through a unified geographic entity ID to form a collaborative retrieval framework. The urban spatial feature data includes vector data and raster data. The multi-agent collaboration module allows users to submit task requests via natural language. The module then uses a multimodal large language model to parse the task into a set of structured, executable sub-task sequences and conducts autonomous data exploration through semantic-spatial dual indexes. Based on a reflective enhanced task graph, it performs multi-agent collaborative spatial semantic reasoning and analysis. The natural language interaction module serves as the system's human-computer interaction entry point. It receives natural language tasks input by the user and converts the task text into corresponding semantic vectors to drive spatial data retrieval and analysis operations. Simultaneously, the natural language interaction module performs semantic integration and language generation on the intermediate results and final output generated by the multi-agent collaboration module, converting them into natural language response results and feeding them back to the user. The visualization module automatically transforms the structured conclusions and spatial data obtained from multi-agent collaborative reasoning into visualizations by constructing an intelligent compilation mechanism for geographic semantics and visualization expressions.
9. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the method according to any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method as described in any one of claims 1-7.