Geographic knowledge complex question and answer method based on space-time agent architecture
By combining the spatiotemporal intelligent agent architecture with LLM, geographic multimodal perception and tool calling, the problem of insufficient information recognition and reasoning of large language models in complex geographic question and answering is solved, multi-source information processing and professional answer generation are realized, and the question and answer capabilities in the field of natural resource planning are improved.
Patent Information
- Application Number
- CN202511183697.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-10-03
AI Technical Summary
Existing large language models (LLMs) have difficulty understanding specific regions and spatial relationships when processing complex geographic questions and answers. They lack multimodal input support and cannot call external tools to obtain real-time data, resulting in insufficient accuracy and professionalism in geographic reasoning question answering.
It adopts a spatiotemporal agent-based architecture, combines LLM with geographic multimodal perception, knowledge graph and tool calling, and realizes multi-step reasoning and answer generation through natural language parsing, multimodal geographic entity recognition, WKT format generation, knowledge graph retrieval and spatial computing tool chain orchestration.
It improves the accuracy and professionalism of geographic question answering, can process multi-source information, perform causal reasoning, call external tools for spatial calculations, and provide more intelligent and reliable question answering support.
Smart Images

Figure CN120745840A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large language models, and specifically to a complex question-answering method for geographical knowledge based on a spatiotemporal agent architecture. Background Art
[0002] Currently, the application of Large Language Models (LLMs) in assisting natural resource planning analysis faces numerous challenges, particularly their difficulty understanding spatiotemporal information. While LLMs excel at general question answering, they often struggle with data related to specific regions, spatial relationships, and planning domains. Currently, relying solely on existing LLMs is insufficient to meet the high accuracy and expertise required for geographic question answering in natural resource planning.
[0003] According to existing technologies such as the knowledge graph-based intelligent question-answering system described in Chinese patent document CN114780697A, the disclosed technical solution improves the geographic intelligence of question-answering to a certain extent by converting user questions into structured queries on the knowledge base and introducing coarse-grained geographic location representation in the offline knowledge graph generation process. However, although the knowledge graph constructed in this solution takes into account the representation of geographic spatial location to a certain extent, it uses a mapping relationship between the subgraph in the complete knowledge graph and the keywords of the target sub-area. This is only effective under the business constraints of special spatial topological relationships such as power grids. In addition, the representation granularity of spatial objects is too coarse, the relationship types are not fully covered, and there is a lack of hierarchy between relationships. Therefore, it is difficult to directly migrate to strong GIS scenarios such as natural resource planning, and it is difficult to achieve the deep requirements for geographic spatial insights.
[0004] As can be seen from the above existing technologies, traditional solutions primarily rely on single-text semantic parsing and static knowledge base queries. They do not support multimodal input and do not call external computing tools to obtain real-time data or perform complex spatial analysis. This limits existing technologies when handling complex geographic reasoning questions and answers. Summary of the Invention
[0005] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide a method for complex geographical knowledge question and answer based on a spatiotemporal agent architecture to solve the problems raised in the above-mentioned background technology. The present invention proposes a new "spatial agent" architecture, which innovatively integrates "LLM+geographic multimodal perception+knowledge graph+tool call" to establish an intelligent system suitable for complex geographical questions and answers. It can accurately identify geographic entities and obtain corresponding data, perform multi-step reasoning based on causal logic, select the correct method to complete spatial calculations, and finally give a reasonable and well-founded answer. Through this architecture, the pain points of the existing technology in handling complex geographical questions and answers, such as incomplete question input recognition, inaccurate reasoning steps, and false answer basis, can be effectively solved, providing more intelligent and reliable question and answer support for fields such as natural resource planning.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a complex question-answering method for geographic knowledge based on a spatiotemporal agent architecture, comprising the following contents:
[0007] S1. Natural language parsing: Accurately understand the user's intention and the information contained in the question;
[0008] S2. Multimodal geographic entity recognition: processing non-text data contained in user input;
[0009] S3, WKT format generation and prompt injection: After the multimodal geographic entity recognition is completed, the identified main geographic entities are converted into the standard WKT format;
[0010] S4. Knowledge graph retrieval enhancement: The system automatically generates query statements based on the question and answer topics and entities analyzed in the previous steps to retrieve background knowledge from the knowledge graph;
[0011] S5. Spatial computing tool chain orchestration: LLM generates a solution after combining multimodal information, WKT geometry, and related data resources associated with the knowledge graph. The solution lists the tools or functions that need to be called and their execution order. This series of tools uses the model context protocol.
[0012] S6. During answer generation and response: Summarize the results, submit them to the big model for integration, and give professional responses.
[0013] Furthermore, in step S1, the natural language parsing module receives the user's natural language question, the system preprocesses the text content, and retrieves the task background knowledge from the business knowledge base. If the user provides pictures or map annotations, these non-text inputs will be transferred to the subsequent multimodal recognition module for processing.
[0014] Furthermore, the natural language parsing module introduces a natural resource planning professional knowledge base. When receiving user input, the system will retrieve the professional knowledge base, rewrite and expand the user-input questions to make them more detailed and clear task requirements. These rewritten task requirements will be injected into the large model in the form of a standard prompt word framework, thereby guiding the large model to focus on the task and ensure the focus and completeness of the task.
[0015] Furthermore, in step S2, the non-text data contained in the user input is processed by the modal geographic entity recognition module. According to the task requirements parsed by the natural language in the first step, the remote sensing image processing and interpretation algorithm or the vector spatial data algorithm tool is intelligently selected and applied to map these raw data into data forms related to the task requirements.
[0016] Furthermore, the modal geographic entity recognition module has a built-in large model for automatic code writing to handle the process of understanding input data. In the Code agent, post training is performed based on the general programming large model to produce the CodeLlama baseline model.
[0017] Furthermore, the training method for producing the Code Llama baseline model uses LoRA fine-tuning, and the training tasks include the following:
[0018] Image preprocessing: including image cropping, denoising, and enhancement;
[0019] Feature extraction: extracting features from multispectral or hyperspectral images;
[0020] Spatial analysis: including buffer analysis and spatial overlay;
[0021] Object classification and extraction: remote sensing image target recognition and classification extraction;
[0022] Data format conversion: including converting raster data into vector data.
[0023] Furthermore, in step S5, the master agent integrates two different reasoning modes, including: ReAct and ReWOO.
[0024] Furthermore, for known tasks, the ReWOO model fine-tunes the basic large model based on the SOP in the existing industry knowledge base;
[0025] For unknown tasks, the ReAct mode is executed, that is, thinking and planning are performed after each action and each tool response to decide which tool to use next.
[0026] Furthermore, the large model fine-tuning method used in step S6 includes the following: feeding the "retrieval-context" to the model during the training phase, rather than just inserting it into the prompt during inference; simultaneously adding interference documents and "correct document + original quotation segment" labels to allow the model to learn to ignore irrelevant content, extract key sentences, and cite them in the Chain-of-Thought.
[0027] Furthermore, it also includes the management of typical question and answer materials in the natural resources industry. The basic LLM is used to automatically generate question and answer pairs based on the original documents, and then manually verify them, extract irrelevant parts of the answers, retain only professional insights, and adjust the professional terminology used in the responses. Finally, 2-4 interference items are constructed for each set of questions and answers. The entire fine-tuning process is completed through the created loss function to ensure that the intelligent agent can gain insight into the responses that have a causal relationship with the target question from the results output by many subtasks.
[0028] Beneficial effects of the present invention:
[0029] 1. This complex geographic knowledge question-answering method, based on a spatiotemporal agent architecture, integrates remote sensing image processing and GIS spatial computing techniques with LLM, enabling the question-answering system to simultaneously process multiple sources of information, including text, images, and maps. A specialized module is used to identify geographic entities in images and maps, transforming geographic visual information into geographic knowledge representations that can be reasoned with text.
[0030] 2. In order to enable LLM to have spatial reasoning capabilities, this complex question-answering method for geographic knowledge based on a spatiotemporal agent architecture converts the identified geographic entities into the WKT (Well-Known Text) format, describes the spatial information in a unified manner, and dynamically injects this information into the prompt context of the large language model. By explicitly providing precise geometric boundaries, coordinates and other information, the model is given the ability to "see" the shapes and relationships of spatial objects, helping it to understand input questions and perform causal reasoning more accurately. At the same time, the system uses the domain knowledge graph that describes the distribution of external data resources to perform retrieval enhancement on the model: relevant background knowledge (such as planning indicators and historical data) is retrieved from the knowledge graph based on the question, and this knowledge is integrated into the thinking process of the LLM to make up for the model's shortcomings in professional domain knowledge. This graph-enhanced prompt effectively reduces the knowledge blind spots of closed pre-trained models.
[0031] 3. This approach to answering complex geographic knowledge questions, based on a spatiotemporal agent architecture, empowers the LLM to automatically access external tools, forming a multi-agent collaborative spatiotemporal agent system, a crucial approach for solving complex geographic questions in natural resource planning. Through its pre-designed agent architecture, the LLM can plan the problem-solving steps similar to a human expert, invoking appropriate GIS analysis functions or computational tools to perform spatial operations. For example, when calculating the intersection of two regions, the agent can automatically invoke a GIS library to perform overlay analysis; when path planning is required, it can call a road network service to calculate the optimal route. The LLM controls the entire process, while specialized tools perform the specific computations. This leverages the model's language understanding and overall reasoning capabilities while also leveraging the precise computational power of external tools to verify and enrich the model's reasoning. This automated toolchain orchestration significantly enhances the capabilities of the language model, ensuring that every step of reasoning is supported by data and that every processing step can be fact-checked. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is the overall framework diagram of the spatiotemporal intelligent agent of the present invention;
[0033] Figure 2 This is a framework diagram of the master control agent of the present invention;
[0034] Figure 3 This is a framework diagram of the knowledge retrieval agent of the present invention;
[0035] Figure 4 This is a framework diagram of the decision-making auxiliary intelligent agent of the present invention;
[0036] Figure 5 This is a framework diagram of the Code intelligent body of the present invention;
[0037] Figure 6 This is a diagram of the collaborative working process of each module of the present invention;
[0038] Figure 7 A schematic diagram of the system operation effect in an embodiment of the present invention;
[0039] Figure 8 Visual presentation of question and answer results in an embodiment of the present invention;
[0040] Figure 9 This is a flow chart of the natural language parsing of the present invention;
[0041] Figure 10 This is a schematic diagram of the multimodal geographic entity recognition principle in an embodiment of the present invention;
[0042] Figure 11 Flowchart of WKT format generation and prompt injection of the present invention;
[0043] Figure 12This is the enhanced flow chart for knowledge graph retrieval of the present invention;
[0044] Figure 13 This is a schematic diagram of the spatial computing tool chain of the present invention;
[0045] Figure 14 Schematic diagram for answer generation and response in the present invention. DETAILED DESCRIPTION
[0046] In order to make the technical means, creative features, objectives and effects achieved by the present invention easier to understand, the present invention is further described below in conjunction with specific implementation methods.
[0047] See also Figures 1 to 14 The present invention provides the following technical solutions: a complex question-answering method for geographic knowledge based on a spatiotemporal agent architecture, wherein the overall framework of the method is as follows: Figure 1 The system consists of multiple modules, each of which works together to gradually convert user questions into correct answers.
[0048] The system includes multiple intelligent agent structures. This embodiment explains the role and use cases of each department in the architecture.
[0049] 1. Master Agent
[0050] refer to Figure 2 The main control agent mainly includes a planning and decision-making module and a memory module. It is responsible for perceiving multimodal inputs with geographic information and problems, perceiving existing tools and algorithm interfaces, splitting the problem-solving process into multiple steps, and scheduling different other agents to collaboratively complete tasks. Finally, the integrated results are returned to the user and the next round of input is accepted.
[0051] 2. Knowledge Retrieval Agent
[0052] refer to Figure 3 The knowledge retrieval agent mainly includes document retrieval and data retrieval modules. It is responsible for receiving user questions in the original input delivered by the master agent (except the input geographic information data), searching the document knowledge base for background knowledge related to natural resource planning business, as well as data resources related to these background knowledge that can participate in calculations, and then handing it over to the master agent to expand and improve the original questions.
[0053] For example, if the user inputs: "I want to know about the situation in XX area", the knowledge retrieval intelligent system will combine with the knowledge base to expand the question into five major themes: "three-line control of national land space planning + natural resource background + ecological environment + social economy + risk and disaster prevention", and locate which data resources in the database are related to "XX area".
[0054] The original question is automatically expanded to a more complete content. The following is an example of the expanded question package received by the master agent:
[0055]
[0056]
[0057] 3. Decision-making Assistance Agent
[0058] refer to Figure 4 The decision-making auxiliary intelligent agent mainly includes the SOP module and the semantic graph module, which is responsible for matching each expanded question with the SOP (standard operating procedure) in the knowledge base one by one, and then splitting the solution process of each problem into a tool call chain one by one; if the text of the user's question contains clear and specific geographical relationship terms, the corresponding geographical entity object is accurately found through the semantic graph module (optional).
[0059] For example, in response to the above question, "What is the area and proportion of the current land use structure (construction land, agricultural land, and unused land) in XX City?", this intelligent agent breaks down the problem-solving into the continuous calling of two tools in the tool set: geographic entity filtering → geographic entity area statistics.
[0060] The implementation process is to give the list of prompt words in the tool set to the intelligent agent, and then the intelligent agent infers: Which tools should be called when answering the question "What is the area and proportion of the current land use structure (construction land, agricultural land, unused land) in XX City?"
[0061] The following table shows an example of a tool set:
[0062] Table 1 Tool collection examples
[0063]
[0064] Example of prompt word template (taking geo_filter as an example):
[0065]
[0066]
[0067] The self-describing structure allows the agent to understand how to call these tools. Then, at runtime, the agent automatically matches the tool chain based on the processing steps and fills in the tool input parameters.
[0068] 4. Code Agent
[0069] refer to Figure 5, the Code agent is mainly responsible for automatically generating Python code to interpret geographical information based on the data and questions input by the user, and completing the information extraction task. When the existing tools cannot meet the requirements, real-time expansion is carried out.
[0070] The collaborative working process of each module is as Figure 6 shown in the schematic diagram of the system operation effect, such as Figure 7 and Figure 8 shown.
[0071] This embodiment also provides the key points of each key technology as follows:
[0072] 1. Natural language parsing (function: expand task background knowledge, clarify task requirements):
[0073] Refer to Figure 9 , the natural language parsing module is the entry point of the entire question-and-answer system, and its core task is to accurately understand the user's intention and the information contained in the question. This module receives the user's natural language question, which may contain a pure text description or may be accompanied by multimodal information such as pictures and maps. First, the system will preprocess the text content and retrieve the task background knowledge from the business knowledge base. If the user provides picture or map annotations, these non-text inputs will be handed over to the subsequent multimodal recognition module for processing.
[0074] The necessity of this module lies in that the mechanism of "expanding background knowledge and clarifying task requirements" is an important step in solving complex problems, that is, to eliminate the "information gap" of the LLM in terms of professional knowledge. The complexity of the questions input by users often lies in that the initial questions are coarse-grained and simplified, and it is difficult for general large models to fully understand the potential ambiguities. This solution introduces a professional knowledge base for natural resource planning. When receiving user input, the system will retrieve this professional knowledge base, rewrite and expand the user's input questions to make them more detailed and clear task requirements. These rewritten task requirements will be injected into the large model in the form of a standard prompt framework, so as to guide the large model to focus its attention on specific tasks or multiple related tasks, ensuring the focus and integrity of the tasks.
[0075] Example of the prompt framework for background knowledge injection:
[0076] <Goal> Rewrite the user question and the knowledge base return result into one or more simple questions
[0077] <User input>{$USER_QUERY}<User input>
[0078] <Knowledge base return information>{$KNOWLEDGE_BASE_CONTENT}< / Knowledge base return information>
[0079] …
[0080] Through the above prompt injection method, the user input "I want to know the situation in XX area" can be expanded into multiple questions related to natural resource planning business.
[0081] 2. Multimodal geographic entity recognition (role: understanding input data):
[0082] refer to Figure 10 ,
[0083] Geographic knowledge Q&A is different from regular Q&A. In addition to describing geographic entities through natural language, it often relies on user input. For example, users can take a screenshot of a map, circle the key points of interest, and then send it to the intelligent agent: {Please analyze the planned land use within the red circle in the figure}.
[0084] The multimodal geographic entity recognition module is responsible for processing non-text data contained in user input, particularly vector (DLG) or raster (image) data, which is common in the field of geographic information. Based on the task requirements identified in the first step of natural language analysis, remote sensing image processing and interpretation algorithms or vector spatial data algorithm tools are intelligently selected and applied to map this raw data into data forms relevant to the task requirements. For example, for remote sensing imagery, the system may identify geographic features such as roads, water bodies, and buildings; for map data, it may parse the boundaries of user-defined areas and annotated points of interest.
[0085] While the system can pre-install specialized data processing tools and automate the processing of input data, tools using the MCP (Model Context) protocol may not be natively available but rather interact via APIs, meaning input data may need to be transferred to a third party. Furthermore, geographic information is bulky, making this type of data transfer less cost-effective. While the pre-processing of input data is relatively simple (primarily focused on remote sensing identification and feature extraction), we have also built in a large, automated code-writing model to handle the process of understanding input data.
[0086] In the Code agent, we conduct post training based on the general programming model to produce a new professional programming model.
[0087] Baseline Model: Code Llama
[0088] Training tasks include:
[0089] Image preprocessing: such as image cropping, denoising, and enhancement.
[0090] Feature extraction: Extracting specific features from multispectral or hyperspectral imagery.
[0091] Spatial analysis: such as buffer analysis and spatial overlay.
[0092] Object classification and extraction: remote sensing image target recognition and classification extraction.
[0093] Data format conversion: such as converting raster data into vector data.
[0094] Training method: LoRA fine-tuning
[0095] Training data example:
[0096] #Task 1: Read GeoTIFF file and display
[0097]
[0098] #Task 2: Calculate NDVI
[0099]
[0100] #Task 3: Land Cover Classification
[0101] from sklearn.ensemble import RandomForestClassifier
[0102] from sklearn.model_selection import train_test_split
[0103] from sklearn.metrics import accuracy_score
[0104] X=...#feature matrix
[0105] y=...#Tag
[0106] X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2)
[0107] clf=RandomForestClassifier(n_estimators=100)
[0108] clf.fit(X_train,y_train)
[0109] y_pred = clf.predict(X_test)
[0110] accuracy=accuracy_score(y_test,y_pred)
[0111] print(f'Accuracy:{accuracy}')
[0112] #Task 4: Extract features from shapefile
[0113] import geopandas as gpd
[0114] gdf=gpd.read_file('path / to / shapefile.shp')
[0115] print(gdf.columns)
[0116] names = gdf['name']
[0117] gdf.plot()
[0118] #Example 5: Change Detection
[0119]
[0120] Finally, the Code agent sends the task to the fine-tuned Code Llama model, generates code, creates a virtual runtime environment, performs calculations, and outputs results.
[0121] 3. WKT format generation and prompt injection (purpose: preliminary prompts of possible calculation methods):
[0122] WKT format generation and prompt injection are designed to enhance the spatial reasoning capabilities of the Large Language Model (LLM). After multimodal geographic entity recognition is completed, the identified key geographic entities are converted into the standard WKT (Well-Known Text) format. WKT is a text markup language used to describe the coordinate structure of geometric shapes such as points, lines, and surfaces. For example, the boundary of a planning area can be represented as a corresponding polygon WKT string. This precise geometric information is then cleverly injected into the LLM prompt context.
[0123] After the WKT prompt word is injected, the task is converted into a more precise executable task. The example is as follows:
[0124] The following is the precise boundary of the target planning unit (in WKT format). Please use this geometric information to complete the tasks listed in your answer:
[0125]
[0126] Task List:
[0127] 1. Estimate the total area of the planning unit (in square kilometers) and explain the basis for the calculation;
[0128] 2. Determine whether the unit overlaps with the published urban development boundary of XX City;
[0129] 3. If there is overlap, please list the conflicting points that require priority verification;
[0130] 4. Establish a simplest tool pipeline (based on geo_filter→area_stats→spatial_overlay) and give the key parameters of each tool.
[0131] This process is to ensure that LLM can obtain definite and unambiguous geographical boundaries, rather than vague descriptions such as "the approximate scope of XX main city".
[0132] 4. Knowledge graph retrieval enhancement (function: establish a complete relationship between input data and other related data):
[0133] Before officially starting a calculation, it's common to encounter situations where the original semantics of the user's question don't include all the relevant input information. This means that calculations in natural resource planning often involve multidimensional data. Based on the expanded task, we need to identify additional data resources that should be included in the calculation and determine which computational tools are needed.
[0134] The knowledge graph here serves as a semantic network database that labels global data resources. It stores a large number of data sets, geographic entities and their relationships in the field of natural resource planning, such as the population, resource data, planning indicators, etc. of each region. The system needs to automatically generate query statements (such as SPARQL or Cypher statements) based on the question and answer topics and entities parsed in the previous steps, and retrieve background knowledge that may be used from the knowledge graph. For example, if the question involves "population density and land use planning in a certain area", the system will search for data resources on the population, area and related planning parameters of the area, and hand them over to the main control agent. (The goal of knowledge enhancement here is different from that of the knowledge enhancement in the first step. Here, the goal is to enhance the data resources involved in the calculation, while the first step is to enhance the comprehensive understanding of the task).
[0135] 5. Spatial computing tool chain arrangement (existing tool selection, parameter alignment or dynamic encoding):
[0136] This process is driven by the Large Language Model (LLM) carried by the master agent. It dynamically plans and invokes a series of external professional spatial analysis tools based on the problem requirements to complete the necessary calculations and processing. Combining multimodal information, WKT geometry, and relevant data resources associated with the knowledge graph, the LLM generates a solution that lists the required tools or functions and their execution order. Furthermore, this suite of tools utilizes the MCP (Model Context) protocol, enabling dynamic expansion and upgrades of computational tools.
[0137] The master agent integrates two different reasoning modes: ReAct (reasoning and action) and ReWOO (reasoning without observation).
[0138] ReWOO mode (known tasks): For known tasks, the base model is fine-tuned based on SOPs (standard operating procedures, consisting of manually annotated question-answer pairs) from an existing industry knowledge base. This allows the model to eliminate the dependency of action planning on tool outputs, generating all execution steps in one go. This approach has the advantage of avoiding tool reuse, reducing the storage and maintenance of intermediate results, and improving efficiency.
[0139] ReAct Mode (Unknown Tasks): For unknown tasks (not listed in the SOP), the ReAct mode is executed, which involves "thinking" and planning after each action and tool response to determine which tool to use next. Although this mode may require repeated storage of intermediate results and maintenance of short-term memory due to replanning, it can obtain new toolchain combinations for unknown tasks, achieve effective knowledge discovery, and demonstrate stronger generalization and problem-solving capabilities.
[0140] 6. Answer generation and response (generating expert-level responses with professional insights):
[0141] The previous work has completed most of the processing process. Finally, the results need to be summarized and handed over to the large model for integration to give a professional response. The results output by the tool may contain some "interference" data that is related to the user's intention but meaningless to industry insights. At this time, it is difficult for the basic large model to focus on specific professional insights. It either selectively skips important information or gives a general answer, which makes it difficult to reflect the characteristics of expert insights. Here we use a new large model fine-tuning method: feed the "retrieval-context" to the model during the training phase, rather than just stuffing prompts into it during reasoning; simultaneously add interference documents (distractor) and "correct document + original quote segment" labels to let the model learn to ignore irrelevant content, extract key sentences and cite them in Chain-of-Thought. The result is: the model inherits domain knowledge and is robust to excluding irrelevant content in the search results. XXXXXXXXXX
[0142] For the governance of typical question-and-answer materials in the natural resources industry, the basic LLM is used to automatically generate question-and-answer pairs based on the original documents. These pairs are then manually verified, and irrelevant parts of the answers are extracted, retaining only professional insights. The professional terminology used in the responses is adjusted, and finally 2-4 interference items are constructed for each set of questions and answers (experiments have shown that if the number of interference items is greater than 5, it will affect the training convergence speed). A new loss function is designed to complete the entire fine-tuning process to ensure that the intelligent agent can "see" the responses that have a "causal" relationship with the target question from the results output by many subtasks, rather than forcibly integrating responses that only have a "correlation" relationship together.
[0143] The key fine-tuning strategy is to set the training objective to minimize the CE loss of the generated sequence, and to include thought chaining processes and references to the relevant responses output by multiple tools in the reply sequence.
[0144] The basic principles, main features and advantages of the present invention are shown and described above. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention.
[0145] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A complex question-answering method for geographic knowledge based on a spatiotemporal agent architecture, characterized by: Includes the following: S1. Natural language parsing: Accurately understand the user's intention and the information contained in the question; S2. Multimodal geographic entity recognition: processing non-text data contained in user input; S3, WKT format generation and prompt injection: After the multimodal geographic entity recognition is completed, the identified main geographic entities are converted into the standard WKT format; S4. Knowledge graph retrieval enhancement: The system automatically generates query statements based on the question and answer topics and entities analyzed in the previous steps to retrieve background knowledge from the knowledge graph; S5. Spatial computing tool chain orchestration: LLM generates a solution after combining multimodal information, WKT geometry, and related data resources associated with the knowledge graph. The solution lists the tools or functions that need to be called and their execution order. This series of tools uses the model context protocol. S6. During answer generation and response: Summarize the results, submit them to the big model for integration, and give professional responses.
2. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 1, characterized in that: In step S1, the natural language parsing module receives the user's natural language question, the system preprocesses the text content, and retrieves the task background knowledge from the business knowledge base. If the user provides pictures or map annotations, these non-text inputs will be transferred to the subsequent multimodal recognition module for processing.
3. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 2, characterized in that: The natural language parsing module introduces a natural resource planning professional knowledge base. When receiving user input, the system will retrieve the professional knowledge base, rewrite and expand the user's input questions to make them more detailed and clear task requirements. These rewritten task requirements will be injected into the large model in the form of a standard prompt word framework, thereby guiding the large model to focus on the task and ensure the focus and completeness of the task.
4. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 1, characterized in that: In step S2, the non-text data contained in the user input is processed by the modal geographic entity recognition module. According to the task requirements parsed by the natural language in the first step, the remote sensing image processing and interpretation algorithm or vector spatial data algorithm tool is intelligently selected and applied to map these raw data into data forms related to the task requirements.
5. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 4, characterized in that: The modal geographic entity recognition module has a built-in large model for automatic code writing to handle the process of understanding input data. In the Code agent, post training is performed based on the general programming large model to produce the Code Llama baseline model.
6. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 5, characterized in that: The training method for the Code Llama baseline model uses LoRA fine-tuning, and the training tasks include the following: Image preprocessing: including image cropping, denoising, and enhancement; Feature extraction: extracting features from multispectral or hyperspectral images; Spatial analysis: including buffer analysis and spatial overlay; Object classification and extraction: remote sensing image target recognition and classification extraction; Data format conversion: including converting raster data into vector data.
7. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 1, characterized in that: In step S5, the master agent integrates two different reasoning modes, including ReAct and ReWOO.
8. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 7, characterized in that: For known tasks, the ReWOO model fine-tunes the basic large model based on the SOP in the existing industry knowledge base; For unknown tasks, the ReAct mode is executed, that is, thinking and planning are performed after each action and each tool response to decide which tool to use next.
9. The method for complex geographic knowledge question answering based on spatiotemporal agent architecture according to claim 1 is characterized in that ,The large model fine-tuning method adopted in step S6 includes the ,following: Feed the "retrieval-context" to the model during the training phase, rather than just inserting it into the prompt during inference; simultaneously add interference documents and "correct document + original quotation segment" labels to allow the model to learn to ignore irrelevant content, extract key sentences, and cite them in the Chain-of-Thought.
10. The method for complex geographic knowledge question answering based on a spatiotemporal agent architecture according to claim 1, characterized in that: It also includes the management of typical question and answer materials in the natural resources industry. It uses basic LLM to automatically generate question and answer pairs based on the original documents, and then manually verifies them, extracts irrelevant parts of the answers, retains only professional insights, and adjusts the professional terminology used in the responses. Finally, 2-4 interference items are constructed for each set of questions and answers. The entire fine-tuning process is completed through the created loss function to ensure that the intelligent agent can gain insight into the responses that have a causal relationship with the target question from the results output by many subtasks.
Citation Information
Patent Citations
Intelligent question answering system based on knowledge graph
CN114780697A
Geographic knowledge graph construction method and device, and storage medium
CN116484015A
Task-based dialogue method, storage medium and computer equipment
CN118377886A
Large language model knowledge question-answering method and system fused with multi-modal knowledge graph
CN118627628A
Construction method of geographic knowledge question-answering system based on knowledge graph
CN118963717A
Cited By
Automatic land utilization optimization method and system based on large language model
CN121328837A
Space-time task processing method and system and storage medium
CN121349705A
Map association question-answering system and question-answering method based on multiple agents
CN122086960A