AI-gis system based on multi-agent fine-tuning language model
The AI-GIS system, which uses multi-agent fine-tuning of language models, solves the problems of insufficient professional knowledge and high resource consumption in existing GIS task processing technologies. It enables efficient and accurate GIS task processing for non-professional users, lowers the technical threshold, and supports the generation of complete workflows.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-13
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies cannot effectively handle complex Geographic Information System (GIS) tasks, especially due to a lack of professional knowledge, high computational resource consumption, and the inability to generate complete GIS workflows that involve task decomposition, tool matching, and process execution. This makes it difficult for non-professional users to efficiently handle complex GIS tasks.
The AI-GIS system, which employs multi-agent language model fine-tuning, builds a GIS-specific corpus, fine-tunes the base model, and designs a tree-like multi-agent architecture to achieve task decomposition, tool matching, and workflow generation, thereby reducing the technical threshold for users.
It enables non-professional users to obtain complete solutions by directly inputting task descriptions, significantly reducing the threshold for GIS technology applications, improving the efficiency and accuracy of complex GIS task processing, possessing lightweight computing resource requirements and scalability, and supporting multimodal data processing and API calls.
Smart Images

Figure CN121503702B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and geographic information science, and in particular relates to an AI-GIS system based on a multi-agent fine-tuning language model. Background Technology
[0002] Geographic Information Science (GIS), as a core tool for exploring the natural world, has been deeply applied in various fields such as scientific research, environmental governance, and urban planning. However, the rapid development of GIS technology has also brought significant application barriers: on the one hand, completing complex GIS tasks requires solid professional knowledge and proficiency in various tools, and the continuous expansion and deepening of the GIS research field has further raised the technical entry standards, making it difficult for researchers without professional backgrounds to directly participate in GIS-related work; on the other hand, the existing technology system has obvious shortcomings in dealing with complex GIS tasks and cannot effectively meet the needs of non-professional users, so there is an urgent need to introduce Artificial Intelligence (AI) technology to lower the application barrier of GIS technology and assist users in quickly carrying out GIS research.
[0003] While academia has attempted to combine large language models (LLMs) with GIS, existing solutions still suffer from three major limitations. First, general-purpose models lack GIS expertise, acquiring only limited GIS knowledge through prompts, making them ill-equipped for complex GIS tasks and limiting their general applicability in the GIS field. Second, single models have insufficient reasoning capabilities. While fine-tuning small language models (SLMs) in vertical domains can acquire GIS knowledge, they still cannot independently complete complete GIS task processing when faced with interdisciplinary physical knowledge requirements and complex task decomposition. Fine-tuning large language models can address the reasoning capability issue, but the sheer number of LLM parameters leads to extremely high computational resource consumption and expensive training costs, resulting in no practical applications in vertical GIS domains to date. Third, while some existing systems can achieve spatial data acquisition and analysis or high-precision GIS knowledge question answering, the former can only process publicly available data and cannot handle conversions between different data spaces or physical mechanisms, while the latter does not involve GIS tool calls. Neither can generate a complete GIS workflow covering "task decomposition - tool matching - process execution," making it difficult to handle personalized and specific complex GIS tasks.
[0004] Furthermore, existing technical approaches also have significant shortcomings at the level of specific GIS task execution: First, they rely on basic models to generate GIS task programming code, but basic models are difficult to complete with high-level code, requiring extensive manual intervention and demanding that users possess both programming skills and GIS expertise, further raising the barrier to entry. The other approach has not yet been practically applied in the GIS field. Only researchers in 2024 verified that a finely tuned SLM could achieve task decomposition and tool invocation, but no complete technical solution for the GIS field has been formed, and it cannot be directly transferred to GIS task processing.
[0005] In summary, to address the above issues, there is an urgent need to develop a new system that integrates AI and GIS technologies, possesses professional GIS knowledge reserves, and has complete task processing capabilities, in order to break through current technical bottlenecks and lower the threshold for GIS technology applications. Summary of the Invention
[0006] The purpose of this invention is to address the problem that existing general-purpose large language models (LLMs) cannot effectively handle complex geographic information system tasks, and to provide an AI-GIS system based on multi-agent fine-tuning of the language model. This system proposes a theoretical approach combining "task decomposition," "tool matching," and "multi-agent collaboration" to intelligently construct GIS workflows and automatically execute them to obtain results.
[0007] To achieve the above-mentioned objectives, the present invention specifically adopts the following technical solution:
[0008] In a first aspect, the present invention provides an AI-GIS system based on a multi-agent fine-tuning language model, the AI-GIS system comprising an agent service module, a GIS tool invocation module, and a visualization interaction module:
[0009] The intelligent agent service module is based on prompting engineering. It inputs the AI-GIS system's proprietary first prompt template into the AI large-scale model to generate task-subtask raw corpora covering multiple GIS task scenarios. After supervision and verification by GIS experts, a structured task decomposition corpus is formed. On this task decomposition corpus, the QLoRA framework is used to fine-tune the pre-trained first base model, thus obtaining the task decomposition intelligent agent based on the fine-tuned first base model. The second prompt template is input into the AI large-scale model to generate subtask-tool raw corpora covering various GIS tools. After supervision and verification by GIS experts and corpus enhancement, a structured task decomposition corpus is formed. A structured tool matching corpus is used. Based on this corpus, the QLoRA framework is employed to fine-tune a pre-trained second-base model, resulting in a tool matching agent. A tree-like multi-agent architecture with four layers of processing logic is constructed: the first layer receives the target task text and associated data input by the user through a visual interaction module; the second layer calls the task decomposition agent to perform first-level task decomposition; the third layer performs second-level task decomposition and calls the tool matching agent to perform tool matching; and the fourth layer integrates the matched GIS tools sequentially, establishes a GIS workflow, and provides feedback to the user through a visual interaction module.
[0010] Once the visualization interaction module receives the user's revision instruction, the intelligent agent service module optimizes the GIS workflow according to the revision instruction, and then sends the final workflow that meets the user's needs to the GIS tool calling module. The corresponding GIS tool is called through the API interface to generate the final result corresponding to the target task and display it to the user through the visualization interaction module.
[0011] Based on the above scheme, each step can be implemented in the following preferred manner.
[0012] As a preferred option for the first aspect mentioned above, the first prompt template in the intelligent agent service module includes three core input items: GIS knowledge, reference cases related to task decomposition, and JSON format requirements. The reference cases need to fully present a complete link example from the original GIS task to the basis for splitting first-level subtasks and then to the detailed logic of second-level subtasks. The JSON format requirements include GIS task ID, GIS task description, subtask list, and hierarchical relationship between GIS tasks.
[0013] As a preferred option for the first aspect mentioned above, the second prompt template in the intelligent agent service module includes three core input items: GIS tool information, reference cases for matching subtasks with GIS tools, and JSON format requirements. The reference cases should include a complete link example from the original GIS task to the decomposition of subtasks and then to the matching of GIS tools. The GIS tool information includes the GIS tool name, applicable scenarios, function description, GIS toolset to which it belongs, the type of subtask to which it is adapted, and API call parameters.
[0014] As a preferred option in the first aspect mentioned above, the intelligent agent service module expands the effective subtask-tool corpus obtained after expert supervision and verification in the GIS field into six association forms. The second prompt template, which covers the tool classification system, multi-tool collaboration logic, task-tool-toolset association cases, and JSON format requirements, is re-input into the AI big model to generate six enhanced corpora: subtask-tool, tool-subtask, tool-tool description, tool description-tool, subtask-tool description, and tool description-subtask, forming a tool matching corpus.
[0015] As a preferred option for the first aspect mentioned above, in the intelligent agent service module, the second level combines the thinking chain and reasoning action mechanism to perform first-level task decomposition, and selects the optimal sub-task solution from the multiple generated sub-task solutions. Then, it calls the task decomposition intelligent agent through the third prompt template to verify whether the optimal sub-task solution covers the target task. If it covers the target task, it proceeds to the third level; if it does not cover the target task, it supplements the return information on the third prompt template, regenerates the sub-task solution, and filters it until the optimal sub-task solution is selected.
[0016] As a preferred option in the first aspect mentioned above, the Phi-3-small-128k-instruct model is used as the first base model in the agent service module.
[0017] As a preferred option in the first aspect mentioned above, the Llama-3.1-8B model is used as the second base model in the agent service module.
[0018] In a second aspect, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can realize the AI-GIS system based on a multi-agent fine-tuning language model as described in any of the solutions of the first aspect above.
[0019] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the AI-GIS system based on a multi-agent fine-tuning language model as described in any of the solutions of the first aspect above.
[0020] Fourthly, the present invention provides a computer electronic device, which includes a memory and a processor;
[0021] The memory is used to store computer programs;
[0022] The processor is configured to, when executing the computer program, implement the AI-GIS system based on a multi-agent fine-tuning language model as described in any of the solutions of the first aspect above.
[0023] Compared with the prior art, the present invention has the following beneficial effects when processing GIS tasks:
[0024] 1) Significantly reduces the application threshold of GIS technology: This invention automatically completes task decomposition, tool matching and workflow generation through multiple agents, without requiring users to have professional GIS knowledge and programming skills. Non-professionals can directly obtain complete solutions by inputting task descriptions, thus solving the core problem of high entry barriers in existing technologies.
[0025] 2) Improve the efficiency and accuracy of complex GIS task processing: Compared with traditional manual workflow design, this invention can complete task decomposition and tool matching in minutes; and the fine-tuned base model is superior to mainstream models such as GPT-4 and Deepseek-R1 in terms of task decomposition and tool matching capabilities. The workflow generated by the system is highly consistent with the expert solution, which solves the problem of insufficient capabilities of existing general models in the GIS field.
[0026] 3) Lightweight and scalable: This invention uses a base model with fewer than 10 billion parameters, requiring only four 3090 graphics cards to complete training and deployment. The computational resource requirements are far lower than those for fine-tuning large language models. At the same time, it supports expanding intelligent agents and corpora by GIS subdomains, which can cover a wider range of GIS task scenarios and solve the problems of high resource consumption and weak generalization ability of existing technologies.
[0027] 4) Achieving a complete GIS workflow closed loop: Compared with existing systems, this invention covers the entire chain of task input-decomposition-tool matching-execution-verification-feedback, supports multimodal data processing and API calls, and can directly output usable task results, solving the problem of incomplete workflow in existing technologies. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the core process of the AI-GIS system of the present invention;
[0029] Figure 2 This is a flowchart of the corpus construction process in this invention;
[0030] Figure 3 This is a flowchart of the base model fine-tuning process in this invention;
[0031] Figure 4 This is a schematic diagram of the tree-like multi-agent architecture of the AI-GIS system in this invention;
[0032] Figure 5 This is a schematic diagram of the task decomposition process in this invention;
[0033] Figure 6 This is a schematic diagram of the tool matching process in this invention;
[0034] Figure 7 This is a test scenario result diagram of an embodiment of the present invention;
[0035] Figure 8 This is a schematic diagram of the composition of a computer electronic device provided in this invention. Detailed Implementation
[0036] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. Technical features in the various embodiments of the present invention can be combined accordingly without mutual conflict.
[0037] In the description of this invention, it should be understood that the terms "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include at least one of those features.
[0038] In existing technologies, general-purpose large-scale language models (LLMs) lack specialized GIS knowledge, while small-scale language models (SLMs) have insufficient reasoning capabilities when used alone. Furthermore, existing systems cannot generate a complete GIS workflow encompassing task decomposition, tool matching, and process execution, making it difficult for non-professional users to efficiently handle complex GIS tasks. Therefore, this invention addresses these technical bottlenecks by constructing a GIS-specific corpus, fine-tuning the base model (a small language model for a vertical domain), and designing a tree-like multi-agent architecture, thus forming an AI-GIS system that integrates artificial intelligence and GIS for efficient task execution.
[0039] like Figure 1 As shown, in a preferred embodiment of the present invention, taking the oceanographic GIS task of "measuring water depth in coastal areas using high-resolution multispectral images" as an example, the aforementioned AI-GIS system includes an intelligent agent service module, a GIS tool invocation module, and a visualization interaction module. The specific implementation processes of each module are described below:
[0040] The intelligent agent service module is based on prompting engineering. It inputs the AI-GIS system's proprietary first prompt template into the AI large-scale model to generate task-subtask raw corpora covering multiple GIS task scenarios. After supervision and verification by GIS experts, a structured task decomposition corpus is formed. On this task decomposition corpus, the QLoRA framework is used to fine-tune the pre-trained first base model, thus obtaining the task decomposition intelligent agent based on the fine-tuned first base model. The second prompt template is input into the AI large-scale model to generate subtask-tool raw corpora covering various GIS tools. After supervision and verification by GIS experts and corpus enhancement, a structured task decomposition corpus is formed. A structured tool matching corpus is used. Based on this corpus, the QLoRA framework is employed to fine-tune a pre-trained second-base model, resulting in a tool matching agent. A tree-like multi-agent architecture with four layers of processing logic is constructed: the first layer receives the target task text and supporting data input by the user through a visual interaction module; the second layer calls the task decomposition agent to perform first-level task decomposition; the third layer performs second-level task decomposition and calls the tool matching agent to perform tool matching; and the fourth layer integrates the matched GIS tools sequentially, establishes a GIS workflow, and provides feedback to the user through a visual interaction module.
[0041] Once the visualization interaction module receives the user's revision instruction, the intelligent agent service module optimizes the GIS workflow according to the revision instruction, and then sends the final workflow that meets the user's needs to the GIS tool calling module. The corresponding GIS tool is called through the API interface to generate the final result corresponding to the target task and display it to the user through the visualization interaction module.
[0042] It should be noted that in this invention, the core link in the workflow implementation of the AI-GIS system construction and task execution is the modular architecture design, mainly composed of several core modules such as the intelligent agent service module, the GIS tool invocation module, and the visualization interaction module. Each module has its own division of labor and cooperation. The intelligent agent service module serves as the "central hub," possessing the ability to intelligently decompose GIS tasks, reflect and calibrate, and form an executable workflow. The GIS tool invocation module acts as the "engine," undertaking the key function of connecting to external GIS tool APIs (Application Programming Interfaces). Based on the processing strategies issued by the intelligent agent service module, it can invoke relevant GIS tools to complete GIS data processing and spatial calculations. The visualization interaction module serves as the "interaction window," providing users with an intuitive operation interface and result display channel. Users can complete operations such as "task submission," "workflow / tool / parameter revision," and "intermediate / final results" in this module. Each core module achieves data interoperability and command transmission through standardized interface protocols, jointly supporting the entire process of the AI-GIS system from task reception, intelligent decomposition, tool execution to result output, ensuring the efficient, intelligent, and accurate completion of GIS tasks.
[0043] When a user enters the target task text and uploads relevant data (such as high-resolution multispectral imagery, DEM data, Shapefile boundary data, etc.) in the visualization interaction module of the AI-GIS system, the AI-GIS system will use the intelligent agent service module to automatically break down the target task into an executable workflow and display the workflow and corresponding results on the visualization interaction module. Users can make appropriate adjustments to the workflow structure, tool selection, tool parameters, etc., based on the actual execution effect to obtain the final result.
[0044] To facilitate understanding by those skilled in the art, the specific implementation details of the AI-GIS system of this invention are described below.
[0045] It should be noted that in the intelligent agent service module of this invention, the first prompt template includes three core input items: GIS knowledge, reference cases related to task decomposition, and JSON format requirements. The reference cases must fully present a complete link example from the original GIS task to the basis for first-level sub-task decomposition and then to the detailed logic of second-level sub-tasks, ensuring that the original task-sub-task corpus generated by the AI large model conforms to the hierarchical task decomposition rules of geographic information processing. In this embodiment, the first prompt template needs to be deeply aligned with the characteristics of GIS task decomposition. GIS knowledge covers professional content such as dataset types, scene tasks, spatial analysis, multispectral image preprocessing, water depth inversion models, and GIS tool functions. Reference cases include typical task decomposition cases such as geographic data processing and spatial analysis, such as the original case of "oceanic water depth measurement task." The JSON format requirements include core fields such as GIS task ID, GIS task description, sub-task list, and hierarchical relationships between GIS tasks.
[0046] It should be noted that in the intelligent agent service module of this invention, the aforementioned large AI model can select a suitable large language model according to actual needs, as long as it can generate the corresponding "task-subtask" raw corpus based on the first prompt template designed according to this invention. In this embodiment, the GPT-4o model and the Kimi model are specifically used as the aforementioned large AI model. After calling the GPT-4o and Kimi models and inputting the aforementioned first prompt template, the two models generate 5,000 task-subtask raw corpora based on the template learning. This corpus covers three types of GIS task scenarios: oceanography, soil science, and urban planning, ensuring the breadth of coverage of the task-subtask raw corpus in the scenario dimension.
[0047] Furthermore, after generating the original task-subtask corpus, such as Figure 2 As shown, this embodiment incorporates an expert oversight mechanism to validate the original task-subtask corpus. Specifically, this embodiment organizes three GIS experts to manually review the generated original task-subtask corpus, focusing on correcting three types of issues: first, common-sense errors—task-subtask corpus that does not conform to GIS common sense needs to be directly deleted; second, logical deviations—complete relationships need to be added to ensure the logical consistency of task decomposition; and third, formatting errors—ensuring the uniformity of the original task-subtask corpus format. After review and screening, 4800 valid task-subtask corpora are obtained, forming the aforementioned task decomposition corpus, providing domain-specific corpus support for fine-tuning the task decomposition agent.
[0048] It should be noted that in the intelligent agent service module of this invention, the aforementioned first base model can be selected according to actual needs, as long as it can have the task decomposition capability in the GIS field after fine-tuning. In this embodiment, a pre-trained Phi-3-small-128k-instruct model is specifically used as the aforementioned first base model, and the "task decomposition corpus" constructed based on the intelligent agent service module is fine-tuned using the QLoRA framework.
[0049] As an implementation of this invention, in the above-mentioned intelligent agent service module, such as Figure 3 As shown, the specific method for fine-tuning the Phi-3-small-128k-instruct model is as follows:
[0050] AS11: Data Preprocessing: The 4800 valid task-subtask corpora obtained from the agent service module are concatenated according to the specified format of "input-label". The input is the task description and the label is the subtask list. Then, the input and label are vectorized by the tokenizer, with a uniform sequence length of 512. At the same time, the training set and the validation set are divided in an 8:2 ratio.
[0051] AS12: Initialize Hyperparameters: Set appropriate hyperparameters for the Phi-3-small-128k-instruct model, and configure key dimensions such as learning rate, batch size, and training epochs appropriately. The hardware configuration is one A800 (80G) graphics card to ensure the efficiency and stability of the fine-tuning process.
[0052] Furthermore, the initialization of hyperparameters in AS12 needs to be compatible with the capabilities and hardware resources of the Phi-3-small-128k-instruct model: In this embodiment, an A800 (80G) graphics card is configured, the batch size is set to 10, the training epoch is set to 6, the total training steps are set to 20700, the training time is 3.3 hours, and the final loss value is 0.56.
[0053] AS13: Model Training and Selection: After starting model training, the training loss and validation loss are monitored in real time. When the model has been trained for 6000 steps, the training loss drops to 0.56, and the validation loss tends to stabilize. However, the validation loss increases in subsequent steps, indicating overfitting. At this point, training is stopped, and a task decomposition agent, Phi-3-small-128k-instruct-F, with GIS task decomposition capabilities is obtained based on the finely tuned first base model.
[0054] It should be noted that in the intelligent agent service module of this invention, the second prompt template includes three core input items: GIS tool information, a reference case for matching subtasks with GIS tools, and JSON format requirements. The reference case must include a complete link example from the original GIS task to the decomposition of subtasks and then to the matching of GIS tools. In this embodiment, the design of the second prompt template needs to conform to the characteristics of the GIS field and focus on the functional adaptability of GIS tools. The GIS tool information clearly specifies the GIS tool name, applicable scenarios, functional description, GIS toolset, adapted subtask type, API call parameters, etc. The reference case must include information such as GIS task objective, GIS tool selection basis, and GIS tool name to ensure that the generated subtask-tool raw data meets the professional requirements for GIS tool calls in GIS tasks. The JSON format requirements include core fields such as GIS task ID, GIS task description, subtask list, and hierarchical relationships between GIS tasks to ensure that the subtask-tool raw data generated by the AI large model conforms to the GIS task processing logic.
[0055] It should be noted that in the intelligent agent service module of this embodiment, after calling the GPT-4o and Kimi models and inputting the second prompt template designed above, the two models learn and generate 20,000 sub-task-tool raw corpora based on the template. This corpus covers 200 commonly used GIS tools in QGIS (Quantum Gis), ensuring the breadth of coverage of the sub-task-tool raw corpus in the GIS tool dimension.
[0056] Furthermore, after generating the original corpus for the subtasks—tools—this embodiment still employs an expert supervision mechanism to verify it, such as... Figure 2 As shown. Specifically, in this embodiment, GIS experts reviewed the generated subtask-tool raw corpus, correcting logical inconsistencies and formatting issues. After screening, 19,200 valid subtask-tool corpora were obtained.
[0057] It should be noted that in the intelligent agent service module of this invention, the effective subtask-tool corpus obtained after expert supervision and verification in the GIS field is expanded in six association forms. The second prompt template, covering tool classification systems, multi-tool collaboration logic, task-tool-toolset association cases, and JSON format requirements, is re-input into the AI large model, generating six enhanced corpora: subtask-tool, tool-subtask, tool-tool description, tool description-tool, subtask-tool description, and tool description-subtask, forming a tool matching corpus. In this embodiment, the intelligent agent service module, through multi-dimensional association expansion, ultimately obtains 115,200 enhanced corpora, improving the richness of the tool matching corpus and the generalization of model learning, providing corpus support for subsequent fine-tuning of the tool matching intelligent agent.
[0058] It should be noted that in the intelligent agent service module of this invention, the second base model can be selected according to actual needs, as long as it has the ability to recognize GIS tools in the GIS field. In this embodiment, a pre-trained Llama-3.1-8B model is specifically used as the second base model, and it is fine-tuned using the QLoRA framework based on the "tool matching corpus" built by the intelligent agent service module.
[0059] As an implementation of this invention, in the above-mentioned intelligent agent service module, such as Figure 3 As shown, the specific method for fine-tuning the Llama-3.1-8B model is as follows:
[0060] BS11: Data preprocessing: The 115,200 augmented corpora obtained from S2 are concatenated according to the specified format of "input-label", where the input is the task description and the label is the list of subtasks; then, the input and labels are vectorized by the tokenizer, and the training set and validation set are divided in an 8:2 ratio.
[0061] BS12: Initialize Hyperparameters: Set adaptive hyperparameters for the Llama-3.1-8B model (8B parameters). Hardware configuration consists of four 3090 (20G) graphics cards to ensure stability during fine-tuning.
[0062] Furthermore, the initialization of hyperparameters in BS12 needs to be adapted to the capabilities and hardware resources of the Llama-3.1-8B model: In this embodiment, four 3090 (20G) graphics cards are configured, the batch size is set to 16, the training epoch is set to 25, the total training steps are set to 37500, the training time is 6.0 hours, and the final loss value is 0.0386.
[0063] BS13: Model Training and Selection: After starting model training, the training loss and validation loss are monitored in real time. When the model has been trained for 9000 steps, the training loss drops to 0.0386 and the validation loss stabilizes. At this point, training is stopped, and a tool matching agent Llama-3.1-8B-F with GIS tool recognition capabilities is obtained based on the finely tuned second pedestal model.
[0064] Furthermore, the Phi-3-small-128k-instruct model and the Llama-3.1-8B model of the agent service module, after fine-tuning, both have fewer than 10 billion parameters, meeting the requirements for lightweight deployment and achieving optimal training results with limited computing resources.
[0065] It should be noted that in the intelligent agent service module of this invention, the second level combines the thinking chain and reasoning action mechanism to decompose the first-level task, and selects the optimal sub-task solution from the multiple generated sub-task solutions. Then, the task decomposition intelligent agent is called through the third prompt template to verify whether the optimal sub-task solution covers the target task. If it covers the target task, it proceeds to the third level. If it does not cover the target task, the return information is supplemented on the third prompt template, and the sub-task solution is regenerated and filtered until the optimal sub-task solution is selected.
[0066] It should be noted that in the agent service module of this embodiment, the above-mentioned tree-multi-agent system (T-MAS) is supported by the task decomposition agent and tool matching agent of the agent service module, such as... Figure 4 As shown, the architecture comprises four layers of processing logic: Layer 1, data reception, which receives the target task text input by the user and the data accompanying that text; Layer 2, task decomposition, which calls the task decomposition agent of the agent service module, and combines the Thinking Chain (CoT) and Reasoning Action (ReAct) mechanisms to decompose the target task into first-level sub-tasks (i.e., Figure 4 The process involves subtasks 1, 2, and 3, generating multiple subtask solutions based on the subtask list, selecting the optimal solution, and verifying its coverage of the target task. If the solution meets the criteria, it proceeds to the next level. Level 3 uses a matching tool to decompose the first-level subtasks into second-level subtasks (i.e.,...). Figure 4 Subtasks 1.1, 1.2, 1.3, etc., synchronously call the tool matching agent of the agent service module, and match the appropriate GIS tool (i.e., ...) from the GIS tool list for the secondary subtasks. Figure 4 Tools 1.1, 1.2, 1.3, etc.; Level 4 workflow construction, sequentially integrating the matching GIS tools from Level 3 to establish a GIS workflow (i.e. Figure 4 (Tools 1.1, 1.2, 1.3... 3.1, 3.2, etc.).
[0067] Furthermore, in Level 2, the verification logic for the first-level subtask decomposition needs to form a closed loop: after the initial decomposition, the subtask solution with the highest performance score (i.e., the optimal subtask solution mentioned above) is selected. By comparing the processing scope, required GIS tools, and target requirements of the subtask solution with those of the target task, it is determined whether it can cover all the requirements of the target task. If it covers them, then proceed to Level 3 for tool matching; if it does not cover them, return to Level 2, supplement the missing requirements with additional prompts, and drive the model to re-decompose the subtasks to ensure the completeness of this process.
[0068] like Figure 5As shown, after the user inputs the target task text, the task decomposition agent is responsible for breaking down the target task. During the decomposition process, the agent calls the Phi-3-small-128k-instruct-F model service and, based on the "target task information," "GIS tool information," and "JSON format information" provided by the prompt project, uses the thought chain (CoT) reasoning approach to gradually generate sub-task solutions. After obtaining multiple candidate sub-task solutions, the task decomposition agent calls the aforementioned model service again to select the optimal sub-task solution from the candidate solutions. Finally, through the Reasoning and Acting (ReAct) mechanism, the optimal sub-task solution and the target task are input into the Phi-3-small-128k-instruct-F model. By determining whether the solution covers all the requirements of the target task, it is decided whether to re-perform the sub-task decomposition process.
[0069] like Figure 6 As shown, after the optimal subtask solution is input, the tool matching agent is responsible for matching based on the "subtask" content. During the matching process, the agent calls the Llama-3.1-8B-F model service and, based on the "target task information," "subtask information," "GIS tool information," and "JSON format information" provided by the prompting project, uses the thought chain (CoT) reasoning approach to gradually construct a workflow solution. After obtaining multiple alternative workflow solutions, the tool matching agent calls the aforementioned model service again to select the optimal workflow as the GIS workflow from the alternatives. Finally, through the reasoning and action (ReAct) mechanism, the current GIS workflow and subtasks are input into the Llama-3.1-8B-F model. By determining whether the GIS workflow can complete the target task, it is decided whether tool matching needs to be repeated.
[0070] As an implementation of this invention, the specific method for building a tree-like multi-agent architecture and completing task processing in the above-mentioned agent service module is as follows:
[0071] Level 1: Users input the target task text "Measure water depth in coastal areas using high-resolution multispectral imagery" and upload the corresponding data.
[0072] Level 2: The task decomposition agent Phi-3-small-128k-instruct-F is invoked, and logical deduction is performed using a thought chain mechanism: the target task requires first processing MSI imagery, then calculating water depth, and finally outputting the results. Based on this, the model decomposes into three primary sub-tasks: 1) MSI image preprocessing; 2) water depth inversion calculation; 3) result visualization. The model outputs three sets of sub-task solutions. The Phi-3-small-128k-instruct-F model then scores the sub-tasks based on two metrics: sub-task coverage and logical coherence, selecting the highest-scoring sub-task solution and verifying that it covers the requirements of the target task.
[0073] Level 3: The first-level subtasks are further decomposed, and the Llama-3.1-8B-F model matching tool for the matching agent is invoked simultaneously. The MSI image preprocessing in step 1) is decomposed into: 1.1) cropping the MSI image to the study area; 1.2) correcting solar flares; 1.3) converting the boundary shapefile to a raster. The water depth inversion calculation in step 2) is decomposed into: 2.1) extracting image band reflectance; 2.2) calculating water depth using an empirical model; 2.3) verifying the accuracy of the water depth results. The result visualization in step 3) is decomposed into: 3.1) generating a water depth thematic map; 3.2) exporting the results in TIFF format, achieving a refined decomposition of the task.
[0074] The specific tool matching results are as follows: 1.1) Clip raster by mask layer; 1.2) Raster calculator; 1.3) Rasterize; 2.1) Band Collection Statistics; 2.2) Raster calculator; 2.3) Regression Analysis; 3.1) Symbolology; 3.2) Export Raster.
[0075] Level 4: Based on the execution logic of the subtasks, the tools matched in Level 3 generate a preliminary GIS workflow.
[0076] It should be noted that in S2 of this invention, when the user performs logical optimization of the GIS workflow based on the intelligent agent service module, the verification process needs to be combined with GIS domain standards. Specifically, it verifies whether the order of GIS tool calls in the GIS workflow is correct, whether the GIS tools and GIS toolsets meet the requirements for collaboration, whether the parameters are filled in correctly, and whether the output file type is consistent with reality. When the user finds a logical conflict in the GIS workflow during logical verification, the corresponding revision instruction is input through the visual interaction module. The intelligent agent service module then makes targeted adjustments based on the revision instruction, and re-matches suitable GIS tools and GIS toolsets through the third level of the tree-like multi-agent architecture to generate the GIS workflow until it passes the logical verification and the final workflow is obtained.
[0077] As an implementation of this invention, the specific method for GIS workflow logic verification and optimization in step S2 above is as follows: Based on a pre-built GIS domain knowledge base, the GIS workflow generated by the intelligent agent service module is verified: for example, checking whether the calling order of a series of GIS tools, from "clipping" to "solar flare correction" to "raster calculation," conforms to the standard processing flow, and confirming whether the input and output data formats between GIS tools match. If a logical conflict is found during verification, the conflicting nodes are marked, and the process returns to the intelligent agent service module to re-match and sort the GIS tools until all GIS tool calling logic is smooth, forming the optimized final workflow.
[0078] Furthermore, after obtaining the final workflow, the AI-GIS system relies on the GIS tool calling module to call the corresponding tools sequentially through the ArcGIS REST API according to the final workflow generated by S2, complete the processing and spatial calculation of GIS data, and finally output coastal water depth TIFF image and thematic map (i.e. the final result mentioned above), thus completing the automated execution of the GIS task.
[0079] Furthermore, after obtaining the GIS workflow, the corresponding intermediate results can also be output, that is, information such as workflow, tool selection, and tool parameters can be directly displayed to the user. The user can combine the intermediate results with the GIS workflow information and generate revision instructions according to their actual needs, thereby adjusting the intermediate process to achieve the verification goal.
[0080] Therefore, the aforementioned AI-GIS system can automate complex GIS tasks on a regular PC with four 3090 graphics cards. Non-professional users only need to input task descriptions and data to obtain complete workflows and results. The AI-GIS system supports multiple scenarios such as oceanography, soil science, and urban planning, effectively lowering the application threshold of GIS technology.
[0081] To better demonstrate the specific implementation and technical effects of the present invention, the AI-GIS system based on multi-agent fine-tuning of the language model described above will be applied to a specific example.
[0082] Example
[0083] The specific implementation process of the AI-GIS system based on the multi-agent fine-tuning language model used in this embodiment is as described above and will not be repeated here.
[0084] In this embodiment, the soil science GIS task of "estimating the annual soil loss in the target area in 2023 based on the Universal Soil Loss Equation (RUSLE)" is selected as the test scenario. The data used include Landsat 9 remote sensing imagery, digital elevation model data, shapefile data of the study area boundary, and RUSLE model parameters. This embodiment completes the task processing through the aforementioned AI-GIS system, and the specific process is as follows:
[0085] The AI-GIS system in this embodiment adopts a modular development architecture, with each module exchanging data through a JSON format interface. The AI-GIS system is deployed on a regular PC equipped with four 3090 (20G) graphics cards, and supports real-time viewing of task decomposition progress and tool call logs, making it easier for developers to locate abnormal issues.
[0086] Start the AI-GIS system, load the finely tuned models Llama-3.1-8B-F and Phi-3-small-128k-struct-F, configure each agent node based on the T-MAS architecture, and start the QGIS backend service to provide the AI-GIS system with tool intelligent call interfaces in the form of API.
[0087] Upon entering the task processing flow, the user inputs the target task text "Estimate the annual soil loss in the target area in 2023 using RUSLE combined with Landsat 9, DEM, and boundary data" through the AI-GIS system's visual interaction module, and uploads the corresponding data files; the AI-GIS system automatically calls the intelligent agent service module, using the Phi-3-small-128k-struct-F model and a thought chain mechanism to break down the target task:
[0088] First-level decomposition: The target task is broken down into four sub-tasks: "data preprocessing, RUSLE parameter calculation, soil loss estimation, and result output".
[0089] Secondary decomposition: "Data preprocessing" is further broken down into DEM data cropping - subtask 1.1, DEM slope and slope length calculation - subtask 1.2, and Landsat 9 image NDVI extraction - subtask 1.3; "RUSLE parameter calculation" is broken down into slope factor calculation - subtask 2.1, slope length factor calculation - subtask 2.2, and vegetation cover factor calculation - subtask 2.3.
[0090] By calling the GIS tool module, the Llama-3.1-8B-F model is loaded, and a suitable GIS tool is matched for the secondary subtask. After matching, the AI-GIS system generates a complete GIS workflow according to the logical order of "data preprocessing - parameter calculation - loss estimation - result output".
[0091] To execute the GIS workflow, the AI-GIS system calls the QGIS backend service associated with the tool via API: First, it calls the Clip raster by mask layer tool, inputs DEM data and boundary Shapefile, and outputs the clipped target area DEM; then, it calls the Slope tool to calculate the DEM slope, and combines it with the Raster calculator to calculate the slope length, obtaining L and S factor raster maps; next, it uses the Band Math tool to extract the NDVI values of the Landsat 9 image and converts them into C factor raster maps; finally, it calls the Raster calculator, inputs the RUSLE formula, substitutes the parameters to calculate the soil loss raster results for the target area in 2023, and exports them as TIFF format using the Export Raster tool.
[0092] In the results verification phase, the AI-GIS system automatically compared the output results with those manually calculated by domain experts: the expert solution used the same data and formulas, and the average soil loss rate was 2.3. The average result of the AI-GIS system is 2.25. The data deviation was only 2.17%, confirming that the tool call order generated by the AI-GIS system basically matched the expert solution.
[0093] After processing, the AI-GIS system's visualization module displays the results in a visual format: a thematic map of soil erosion and a workflow execution log. Users can download the TIFF result file and workflow document. Figure 7 The image shown is a calculation result diagram of soil loss estimation of the target area using the AI-GIS system in this embodiment. The redder the color, the greater the amount of soil loss.
[0094] Furthermore, this embodiment comprehensively evaluates the AI-GIS system designed in this invention against existing mainstream models from two dimensions: comparison with expert solutions and performance index evaluation. In the comparison with expert solutions, the workflow manually designed by experts includes nine tools, while the workflow generated by the AI-GIS system includes one more "filling" tool, making it more comprehensive. The final data deviation is approximately 2%, indicating good consistency between the AI-GIS system results and expert solutions. Performance index evaluation assesses the AI-GIS system's performance in two aspects: task decomposition capability, aiming to verify that the accuracy of the finely tuned Phi-3-small-128k-struct-F model in decomposing GIS professional tasks is superior to that of general models; tool matching capability, verifying its consistency with expert solutions in tool selection efficiency in complex scenarios, ensuring the AI-GIS system's professional performance advantages in the GIS field. Statistical results of accuracy indices for different methods are shown in Tables 1 and 2. Among them, BLEU, ROUGE, and TFIDF are word matching metrics, COSIN is a semantic similarity metric, GPT-4o is a large model evaluation metric, and Phi-3-Small, GPT-3.5, GPT-4.0, GPT-4o-2024 / 11 / 20, Deepseek-R1, Phi-3-Mini, and Llama3.1 are all existing comparison models.
[0095] It should be noted that, for the convenience of those skilled in the art, the specific calculation methods of the above indicators will be introduced below.
[0096] 1) Final evaluation score BLEU:
[0097]
[0098]
[0099]
[0100] in, yes Accuracy; for The order, such as yes That is, a single word; Candidate text Truncated count: First count the number of truncated segments in the candidate text. The number of times it appears, then count the number of times it appears. The smaller of the two values—the maximum number of occurrences across all reference texts—is used to avoid generating candidate texts repeatedly. This leads to an inflated accuracy rate; All of the candidate texts Total count: that is, all candidates in the text The sum of the number of times each appears; It is a length penalty factor to avoid situations where candidate text is too short but accuracy is high. When the candidate text length is... ≥ Reference text length When no penalty is applied, the value is 1; the final evaluation score BLEU is obtained by summing the above parameters and multiplying them by the weighting coefficients. The preset weighting coefficients, For the corresponding The weighting coefficients.
[0101] 2) ROUGE, a summary evaluation score oriented towards recall:
[0102]
[0103]
[0104]
[0105]
[0106] in, yes Recall rate for The order, such as yes ; Indicates all in the reference text Total number of times; yes Recall rate is used to measure the proportion of candidate text that covers the reference text information; That is, the length of the longest common subsequence. and The length of the longest consecutive character or word sequence that is consistent in order but not required; express Sequence length; yes The accuracy rate is used to measure the proportion of overlap between the candidate text and the reference text. express Sequence length; yes of The score is the harmonic mean of the combined recall and precision.
[0107] 3) Term Frequency-Inverse Document Frequency (TF-DIF):
[0108]
[0109]
[0110]
[0111] in, Keywords In document collection A document The word frequency in the document measures how often a word appears in the document. Indicator In the above document The number of times it appears in; This represents the total number of times all words appear in document d above; It is a word In the above set Inverse document frequency (IVF) in words, a measure of word frequency. The degree of rarity in this set; For this set Total number of documents in the database; For the words contained in this set The number of documents; It is the final TF-IDF value of word t in document d, which combines TF and IDF. The higher the value, the more important word t is to document d.
[0112] 4) Cosine similarity (COSIN):
[0113]
[0114]
[0115] in, and Given two vectors, They are respectively The first in One element, They are respectively The first in One element; Two vectors , The cosine similarity between them is obtained by calculating the element values of their vector dimensions and summing and multiplying them; The length of the vector; For vectors , The modulus; This represents the vector dot product operation; They are vectors , The first in Each element.
[0116] Table 1. Statistics of different model indicators for task decomposition
[0117]
[0118] Table 2. Statistics of different model indicators for tool matching
[0119]
[0120] Comparative experiments show that the finely tuned base model in this embodiment outperforms seven existing SLMs and LLMs. Its GIS task decomposition capability is approximately 18% higher than GPT-4 and approximately 14% higher than Deepseek-R1. Its GIS tool matching capability is three times that of GPT-4 and four times that of Deepseek-R1. The above practical case studies demonstrate that the workflow generated by the AI-GIS system highly matches the solutions provided by domain experts, and the execution results are essentially consistent. This effectively lowers the barrier to entry for GIS technology and provides efficient and accurate GIS task processing solutions for users lacking professional GIS knowledge.
[0121] It is understood that the AI-GIS system based on a multi-agent fine-tuning language model described above can essentially be implemented through a computer program. Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer program product corresponding to the AI-GIS system based on a multi-agent fine-tuning language model provided in the above embodiments. This product includes a computer program / instructions that, when executed by a processor, can implement the AI-GIS system based on a multi-agent fine-tuning language model as described in the above embodiments.
[0122] Similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer electronic device corresponding to the AI-GIS system based on a multi-agent fine-tuning language model provided in the above embodiments, such as... Figure 8 As shown, it includes a memory and a processor;
[0123] The memory is used to store computer programs;
[0124] The processor is configured to implement the AI-GIS system based on a multi-agent fine-tuning language model in the above embodiments when executing the computer program.
[0125] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0126] Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer-readable storage medium corresponding to the AI-GIS system based on a multi-agent fine-tuning language model provided in the above embodiments. The storage medium stores a computer program, which, when executed by a processor, can realize the AI-GIS system based on a multi-agent fine-tuning language model in the above embodiments.
[0127] It is understood that the aforementioned storage media may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Furthermore, the storage media may also be various media capable of storing program code, such as USB flash drives, external hard drives, magnetic disks, or optical discs.
[0128] It is understood that the processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0129] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.
Claims
1. An AI-GIS system based on a multi-agent fine-tuning language model, characterized in that, Includes an intelligent agent service module, a GIS tool invocation module, and a visualization interaction module: The intelligent agent service module is based on prompting engineering. It inputs the first prompt template, which is exclusive to the AI-GIS system, into the AI large model to generate task-subtask raw corpus covering multiple GIS task scenarios. After supervision and verification by GIS experts, a structured task decomposition corpus is formed. On the task decomposition corpus, the QLoRA framework is used to fine-tune the pre-trained first base model, so as to obtain the task decomposition intelligent agent based on the fine-tuned first base model. The second prompt template is input into the AI large model to generate a sub-task-tool raw corpus covering various GIS tools. After supervision and verification by GIS experts and corpus enhancement, a structured tool matching corpus is formed. On the tool matching corpus, the pre-trained second base model is fine-tuned using the QLoRA framework, thereby obtaining a tool matching agent based on the fine-tuned second base model. A tree-like multi-agent architecture with four layers of processing logic is built: the first layer receives the target task text and supporting data input by the user through the visual interaction module; the second layer calls the task decomposition agent to perform first-level task decomposition; the third layer performs second-level task decomposition and calls the tool matching agent to perform tool matching; the fourth layer integrates the matched GIS tools in sequence, establishes a GIS workflow, and provides feedback to the user through the visual interaction module. The first prompt template contains three core input items: GIS knowledge, reference cases related to task breakdown, and JSON format requirements; This reference case should fully demonstrate the complete chain example from the original GIS task to the basis for splitting first-level subtasks and then to the detailed logic of second-level subtasks; the JSON format should include the GIS task ID, GIS task description, subtask list, and hierarchical relationship between GIS tasks; In the intelligent agent service module, the second level combines the thinking chain and reasoning action mechanism to decompose the first-level task, select the optimal sub-task solution from the multiple sub-task solutions generated, and call the task decomposition intelligent agent through the third prompt template to verify whether the optimal sub-task solution covers the target task: if it covers it, then proceed to the third level. If not covered, the return information is added to the third prompt template, the subtask solution is regenerated and filtered until the optimal subtask solution is found. Once the visualization interaction module receives the user's revision instruction, the intelligent agent service module optimizes the GIS workflow according to the revision instruction, and then sends the final workflow that meets the user's needs to the GIS tool calling module. The corresponding GIS tool is called through the API interface to generate the final result corresponding to the target task and display it to the user through the visualization interaction module.
2. The AI-GIS system based on a multi-agent fine-tuning language model as described in claim 1, characterized in that, In the intelligent agent service module, the second prompt template contains three core input items: GIS tool information, reference cases for matching subtasks with GIS tools, and JSON format requirements. The reference case should include a complete link example from the original GIS task to the decomposition of subtasks and then to the matching GIS tools; the GIS tool information should include the GIS tool name, applicable scenarios, function description, GIS toolset to which it belongs, the type of subtask to which it is adapted, and API call parameters.
3. The AI-GIS system based on a multi-agent fine-tuning language model as described in claim 1, characterized in that, In the intelligent agent service module, the effective subtask-tool corpus obtained after supervision and verification by GIS experts is expanded in six association forms. The second prompt template, which covers the tool classification system, multi-tool collaboration logic, task-tool-toolset association cases, and JSON format requirements, is re-input into the AI big model to generate six enhanced corpora: subtask-tool, tool-subtask, tool-tool description, tool description-tool, subtask-tool description, and tool description-subtask, forming a tool matching corpus.
4. The AI-GIS system based on a multi-agent fine-tuning language model as described in claim 1, characterized in that, In the agent service module, the Phi-3-small-128k-instruct model is used as the first base model.
5. The AI-GIS system based on a multi-agent fine-tuning language model as described in claim 1, characterized in that, In the agent service module, the Llama-3.1-8B model is used as the second base model.
6. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it can realize the AI-GIS system based on a multi-agent fine-tuning language model as described in any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the AI-GIS system based on a multi-agent fine-tuning language model as described in any one of claims 1 to 5.
8. A computer electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to, when executing the computer program, implement the AI-GIS system based on a multi-agent fine-tuning language model as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Automatic data modeling and optimizing system and method fusing knowledge graph and ChatBI
CN120994636A
Forest management data processing method driven by large language model
CN120994908A