A multi-agent map association question answering system and question answering method

By using a multi-agent question-answering system that combines the BERT model and a large language model, dynamic querying of geospatial information is achieved, solving the accuracy problem of existing question-answering systems in dynamic geospatial information processing and improving the efficiency and accuracy of queries.

CN122086960APending Publication Date: 2026-05-26BEIJING NORMAL UNIV AT ZHUHAI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610563801.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-27
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing question-and-answer systems cannot provide accurate answers when processing dynamic queries related to real-time geospatial information, especially when dynamic spatial relationships change due to changes in traffic conditions and planning adjustments, resulting in low accuracy.

Method used

A multi-agent map-based question-answering system is adopted, including a front-end agent, a supervisor agent, a database interaction agent, and a map reasoning agent. The system extracts intent and slot information through a fine-tuned BERT model, combines a large language model for task allocation and data querying, and uses a map application programming interface to obtain geospatial relationship data for reasoning operations.

Benefits of technology

It improves the execution efficiency and fault tolerance of multi-step spatial query tasks, ensures the accuracy and reliability of the answers, and can adapt to dynamic geospatial changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122086960A_ABST
    Figure CN122086960A_ABST
Patent Text Reader

Abstract

This invention relates to the field of data processing technology and discloses a map-related question-answering system and method based on a multi-agent approach. The system uses a fine-tuned BERT model to extract intent and slot information from user questions and passes this information to a supervisor agent controlled by a large language model. The supervisor agent assigns this information to a database interaction agent, which performs a database query and returns the query results to the supervisor agent. If the current result directly answers the user's question, the supervisor agent replies with the answer. Otherwise, the supervisor agent passes the user's question, intent, slot information, and latitude and longitude information obtained from the database query to a map reasoning agent, which performs a map query. When the user's question involves reasoning, this agent performs the final reasoning and returns the reasoned answer to the supervisor agent, which then returns it to the user. This invention utilizes multiple agents to perform the task of answering questions, greatly improving the accuracy of question answers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a map association question-answering system, question-answering method, terminal, and computer-readable storage medium based on multi-agent systems. Background Technology

[0002] With the development of deep learning and pre-trained language model technologies, intelligent question answering systems have made significant progress in semantic understanding, multi-turn dialogue, and information retrieval. Current mainstream question answering systems rely on large language models and can generate relatively accurate responses to general knowledge-based questions. In question answering scenarios involving geospatial information, some systems answer user queries about location relationships or commuting times by pre-calculating straight-line distances between geographical locations or retrieving statically stored travel data.

[0003] However, existing question-answering systems have significant shortcomings in handling dynamic queries related to real-time geospatial information. On the one hand, the knowledge reserves of large language models are limited by the time range and coverage of their training data. When users ask for real-time attribute data of specific geographic entities, the models cannot provide accurate answers and may even generate false information that does not match the actual situation. On the other hand, most existing map question-answering solutions rely on pre-calculated and stored static spatial data, making it difficult to adapt to dynamic changes in spatial relationships caused by factors such as changes in traffic conditions and planning adjustments. This results in low accuracy in answering spatial relationship questions that require real-time calculation or dynamic reasoning (such as comparing the actual travel time from multiple locations to the same destination).

[0004] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0005] The main objective of this invention is to provide a map-related question-answering system and method based on multi-agent systems, aiming to solve the problem that existing question-answering systems are difficult to combine with dynamic map services and external databases, and have low accuracy when answering questions that require real-time geospatial reasoning.

[0006] To achieve the above objectives, the present invention provides a map association question answering system based on multiple agents. The map association question answering system based on multiple agents includes: a front-end agent, a supervisor agent, a database interaction agent, and a map reasoning agent; the front-end agent is unidirectionally connected to the supervisor agent, and the supervisor agent is bidirectionally connected to both the database interaction agent and the map reasoning agent. The front-end intelligent agent is used to receive natural language questions input by the user, perform semantic parsing on the natural language questions, and extract intent information and slot information from the natural language questions; The supervisory agent is used to receive and send the natural language question, the intent information, and the slot information to the database interaction agent. The database interaction agent is used to generate a structured query statement based on the received natural language question, intent information and slot information, query an external database based on the structured query statement, and return the query results to the supervisor agent; The supervisory agent is also used to determine whether the query result meets the preset answer output conditions based on the large language model. If the answer output conditions are met, the final reply information is generated and output to the user terminal based on the query result. If the answer output conditions are not met, a second decision instruction is generated and the natural language question, the intent information, the slot information and the query result are sent to the map reasoning agent. The map reasoning agent is used to call the map application programming interface to obtain geospatial relationship data based on the received natural language question, intent information, slot information and query results, perform reasoning operations based on the geospatial relationship data to generate a reasoning answer, and return the reasoning answer to the supervisor agent; The supervisory agent is also used to integrate the reasoning answers into a final response message and output it to the user.

[0007] Optionally, in the multi-agent map association question answering system, the foreground agent includes a fine-tuned BERT model, which is used to perform sequence labeling on the natural language question and extract intent information and slot information from the natural language question. The intent information corresponds to a category label of a predefined intent classification, and the slot information corresponds to the entity value of a predefined slot.

[0008] Optionally, in the multi-agent-based map association question-answering system, the database interaction agent includes a table retrieval unit and a query statement generation unit; The table retrieval unit is used to generate a retrieval summary based on the received natural language question, intent information, and slot information, and to retrieve relevant data table structures in the database schema based on the retrieval summary using the best matching algorithm. The query statement generation unit is used to generate a structured query statement for the external database based on the relevant data table structure, the intent information and the slot information through a large language model, and execute the structured query statement to obtain the query result; The query results include attribute information and latitude and longitude coordinates.

[0009] Optionally, in the multi-agent-based map association question answering system, the map reasoning agent includes a programming interface selection unit, a parameter construction unit, and a reasoning decision unit. The programming interface selection unit is used to determine the name of the map application programming interface to be invoked based on the received natural language question, intent information and slot information; The parameter construction unit is used to extract the latitude and longitude coordinate information from the received query results, fill the latitude and longitude coordinate information into the parameter template corresponding to the name of the map application programming interface, generate an interface call instruction, and call the corresponding map application programming interface according to the interface call instruction to obtain geospatial relationship data. The reasoning decision unit is used to compare and calculate the multiple spatial distance values ​​based on the logical relationship represented by the natural language question, the intent information, and the slot information when the map application programming interface returns multiple spatial distance values, and generate the reasoning answer including the judgment of extreme value relationship.

[0010] Optionally, in the multi-agent-based map association question answering system, the map reasoning agent further includes a fault-tolerant retry unit; The fault-tolerant retry unit has a preset retry threshold. When the call to the map application programming interface fails, the fault-tolerant retry unit is used to control the map inference agent to regenerate the application programming interface parameters or reselect the application programming interface name for a second attempt to call it, provided that the retry threshold is not exceeded. When the number of failed calls exceeds the retry threshold, the fault-tolerant retry unit generates a task execution failure status report and sends it to the supervisor agent.

[0011] Optionally, in the multi-agent-based map association question-answering system, the supervisor agent includes a task allocation unit, an answer judgment unit, and a monitoring and decision-making unit; The task allocation unit is used to send the natural language question, the intent information, and the slot information to the database interaction agent; The answer judgment unit is used to determine whether the information contained in the query result meets the preset answer output conditions; The monitoring and decision-making unit is used to receive task execution failure status reports returned by the database interaction agent or the map reasoning agent, and when the task execution failure status report is received, it triggers the large language model to re-evaluate the task allocation path. If the failure is determined to be due to an incorrect task allocation object, it generates an instruction to send the corresponding data to another agent module.

[0012] Furthermore, to achieve the above objectives, the present invention also provides a question-answering method for a multi-agent map association question-answering system, wherein the question-answering method includes: The front-end intelligent agent receives natural language questions input by the user, performs semantic parsing on the natural language questions, and extracts intent information and slot information from the natural language questions; The supervisory agent receives and sends the natural language question, the intent information, and the slot information to the database interaction agent. The database interaction agent generates a structured query statement based on the received natural language question, intent information, and slot information, queries an external database based on the structured query statement, and returns the query results to the supervisor agent. The supervisor agent determines whether the query result meets the preset answer output conditions based on the large language model. If the answer output conditions are met, the agent generates the final response information based on the query result and outputs it to the user. If the answer output conditions are not met, the agent generates a second decision instruction and sends the natural language question, the intent information, the slot information, and the query result to the map reasoning agent. The map reasoning agent, based on the received natural language question, intent information, slot information, and query results, calls the map application programming interface to obtain geospatial relationship data, performs reasoning operations based on the geospatial relationship data to generate a reasoning answer, and returns the reasoning answer to the supervisor agent; The supervising agent integrates the reasoning answers into a final response message and outputs it to the user.

[0013] Optionally, the question-answering method of the multi-agent map association question-answering system further includes: When the supervisor agent receives the natural language question, the intent information, and the slot information, it sends the natural language question, the intent information, and the slot information to the map reasoning agent. When the map reasoning agent determines that the query result is missing in the received data, it initiates an information retrieval request to the database interaction agent. The database interaction agent responds to the information acquisition request and returns the query results obtained from the query to the map reasoning agent. After the map reasoning agent completes the application programming interface call and reasoning operation based on the query results, it sends the final reasoning answer to the supervisor agent.

[0014] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a question-answering program of a multi-agent map association question-answering system stored in the memory and executable on the processor, wherein when the question-answering program of the multi-agent map association question-answering system is executed by the processor, it implements the steps of the question-answering method of the multi-agent map association question-answering system as described above.

[0015] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a question-answering program for a multi-agent map association question-answering system, and when the question-answering program for the multi-agent map association question-answering system is executed by a processor, it implements the steps of the question-answering method for the multi-agent map association question-answering system as described above.

[0016] In this invention, the system utilizes a fine-tuned BERT model to extract intent and slot information from user questions and passes this information to a supervisory agent controlled by a large language model. The supervisory agent then assigns the information to a database interaction agent, which performs a database query and returns the results to the supervisory agent. If the current result directly answers the user's question, the supervisory agent provides the answer. Otherwise, the supervisory agent passes the user's question, intent, slot information, and latitude / longitude information obtained from the database query to a map reasoning agent, which performs a map query. When the user's question involves reasoning, the agent performs the final reasoning and returns the reasoned answer to the supervisory agent, which then returns it to the user. This invention improves the execution efficiency and fault tolerance of multi-step spatial query tasks by using external tools to obtain dynamic data, ensuring accurate and reliable answers. Attached Figure Description

[0017] Figure 1 This is the overall architecture diagram of the multi-agent map association question answering system of the present invention; Figure 2 This is a flowchart of a preferred embodiment of the question-answering method of the multi-agent map association question-answering system of the present invention; Figure 3 This is another workflow diagram of the map reasoning agent in the question answering method of the multi-agent map association question answering system of the present invention; Figure 4 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0019] To address the problems in the existing technology, this embodiment provides a map association question-answering system based on multi-agent systems, such as... Figure 1 As shown, the multi-agent map association question answering system includes: a front-end agent, a supervisor agent, a database interaction agent, and a map reasoning agent; the front-end agent is unidirectionally connected to the supervisor agent, and the supervisor agent is bidirectionally connected to both the database interaction agent and the map reasoning agent. The front-end intelligent agent is used to receive natural language questions input by the user, perform semantic parsing on the natural language questions, and extract intent information and slot information from the natural language questions; The supervisory agent is used to receive and send the natural language question, the intent information, and the slot information to the database interaction agent. The database interaction agent is used to generate a structured query statement based on the received natural language question, intent information and slot information, query an external database based on the structured query statement, and return the query results to the supervisor agent; The supervisory agent is also used to determine whether the query result meets the preset answer output conditions based on the large language model. If the answer output conditions are met, the final reply information is generated and output to the user terminal based on the query result. If the answer output conditions are not met, a second decision instruction is generated and the natural language question, the intent information, the slot information and the query result are sent to the map reasoning agent. The map reasoning agent is used to call the map application programming interface to obtain geospatial relationship data based on the received natural language question, intent information, slot information and query results, perform reasoning operations based on the geospatial relationship data to generate a reasoning answer, and return the reasoning answer to the supervisor agent; The supervisory agent is also used to integrate the reasoning answers into a final response message and output it to the user.

[0020] Understandably, this invention provides a multi-agent map-based question-answering system. For a user's question, this system first utilizes a fine-tuned BERT (Bidirectional Encoder Representations from...) Transformers (a type of bidirectional encoder) model is used to extract intent and slot information from the user's question. This intent and slot information is then passed to a supervisor agent controlled by a large language model. The supervisor agent, upon receiving the question, combines it with the user's question and the intent and slot information submitted by the foreground agent to determine task allocation. Typically, the task is first assigned to an agent responsible for interacting with the database (also controlled by a large language model). This agent performs the database query and returns the results to the supervisor agent (the results might include latitude and longitude, green space ratio, etc., of the location mentioned in the user's question). At this point, the supervisor agent needs to decide whether the current result can answer the user's question. If the result can directly answer the user's question, the supervisor agent replies with the answer. Otherwise, the supervisor agent passes the user's question, intent, slots, and the latitude and longitude information obtained from the database query to a map reasoning agent, which performs the map query. If the user's question involves reasoning, this agent performs the final reasoning and returns the reasoned answer to the supervisor agent, who then returns the answer to the user.

[0021] Furthermore, the foreground intelligent agent includes a fine-tuned BERT model, which is used to perform sequence labeling on the natural language question and extract intent information and slot information from the natural language question. The intent information corresponds to the category label of a predefined intent classification, and the slot information corresponds to the entity value of a predefined slot.

[0022] Understandably, the foreground agent is configured with a fine-tuned BERT model. This BERT model undergoes supervised fine-tuning training using a corpus labeled with intent category tags and slot entity boundary tags, based on general pre-trained parameters. After training, the BERT model receives a natural language question input by the user, performs word-by-word sequence labeling on the question, and outputs the intent category probability distribution and slot entity start and end position markers for each word.

[0023] During the inference phase, the fine-tuned BERT model transforms the natural language question into a sequence of vector representations, and performs classification prediction on each lexical unit through a sequence labeling layer. Specifically, the portion corresponding to the predefined intent classification system outputs the overall intent information of the natural language question, such as "attribute query" or "spatial relationship query"; the portion corresponding to the predefined slot system outputs the individual entity fragments appearing in the natural language question and their corresponding slot types, such as location names and organization names extracted from the question as specific values ​​for the slot information. This intent and slot information is then sent to the lead agent as a structured basis for subsequent task decomposition and tool invocation. Through the sequence labeling capabilities of the BERT model, the lead agent can accurately transform unstructured natural language input into a structured semantic representation.

[0024] Furthermore, the database interactive intelligent agent includes a table retrieval unit and a query statement generation unit; The table retrieval unit is used to generate a retrieval summary based on the received natural language question, intent information, and slot information, and to retrieve relevant data table structures in the database schema based on the retrieval summary using the best matching algorithm. The query statement generation unit is used to generate a structured query statement for the external database based on the relevant data table structure, the intent information and the slot information through a large language model, and execute the structured query statement to obtain the query result; The query results include attribute information and latitude and longitude coordinates.

[0025] It is understood that the database interaction agent internally includes a table retrieval unit and a query statement generation unit. The table retrieval unit receives natural language questions, intent information, and slot information from the supervisor agent. First, it generates a retrieval summary text based on this information. Then, it uses the BM25 algorithm (Best Matching 25, a classic keyword relevance scoring algorithm) to retrieve data table structures related to the current query from the schema definition of the external database. The BM25 algorithm scores the relevance of table names and field descriptions based on term frequency and inverse document frequency, thereby selecting the target data table most likely to store the required data.

[0026] After acquiring the relevant data table structure, the query statement generation unit inputs the natural language question, intent information, slot information, and retrieved data table structure information into the large language model. The large language model then generates a query statement conforming to the syntax of a structured query language based on semantic correspondences. This query statement includes the target field name, the data table name, and a query condition expression constructed based on the slot information. The generated structured query statement is then sent to an external database for execution, and the execution result is the attribute information and latitude / longitude coordinates of the target geographic entity.

[0027] The database interaction agent integrates the above execution results into a query result and returns it to the supervisor agent. The query result contains two types of data: one is attribute information, i.e., the static feature data of the target geographic entity stored in the database; the other is latitude and longitude coordinate information, i.e., the spatial location coordinate data of the target geographic entity. These two types of data together constitute the query result, which is used by the supervisor agent for subsequent judgment or forwarded to the map reasoning agent.

[0028] Furthermore, the map reasoning agent includes a programming interface selection unit, a parameter construction unit, and a reasoning decision unit; The programming interface selection unit is used to determine the name of the map application programming interface to be invoked based on the received natural language question, intent information and slot information; The parameter construction unit is used to extract the latitude and longitude coordinate information from the received query results, fill the latitude and longitude coordinate information into the parameter template corresponding to the name of the map application programming interface, generate an interface call instruction, and call the corresponding map application programming interface according to the interface call instruction to obtain geospatial relationship data. The reasoning decision unit is used to compare and calculate the multiple spatial distance values ​​based on the logical relationship represented by the natural language question, the intent information, and the slot information when the map application programming interface returns multiple spatial distance values, and generate the reasoning answer including the judgment of extreme value relationship.

[0029] Understandably, the map reasoning agent receives natural language questions, intent information, slot information, and query results sent by the supervisor agent. This agent is also controlled by a large model. For the user question, intent, slot, and latitude and longitude obtained from the database, delivered by the supervisor agent, it first considers the name of the map API to be called and the parameters to be passed in. Then, it generates the interface name and parameter names for the corresponding API (Application Programming Interface). Some questions may require multiple API calls; in this case, the agent needs to break down the question, generate multiple call parameters, and call them one by one to obtain the results. For some questions, such as "Which is closer to Elementary School X: Community A, Community B, or Community C?", the API can only provide the distances from the three locations to the destination. The agent also needs to perform corresponding reasoning to obtain the closest community.

[0030] Specifically, the programming interface selection unit analyzes the spatial operation requirements contained in the received natural language question, intent information, and slot information to determine the name of the map application programming interface to be called. For example, when the intent information indicates that the travel time between two locations needs to be obtained, a route planning interface is selected; when the intent information indicates that the location coordinates of a location need to be obtained, a geocoding interface is selected.

[0031] The parameter construction unit extracts the latitude and longitude coordinates of the target geographic entity from the received query results and fills this information into the parameter template corresponding to the selected map application programming interface name, generating a complete interface call instruction. For complex queries that require multiple calls to the map application programming interface, the parameter construction unit breaks down the problem into multiple sub-call steps, generates corresponding parameter combinations for each, and executes the calls sequentially to obtain geospatial relationship data for each part.

[0032] After the map application programming interface returns multiple spatial distance values ​​or travel time values, the reasoning and decision-making unit compares and performs calculations on the returned values ​​based on the comparative logic relationships represented by the natural language question, intent information, and slot information, generating a reasoning answer that includes judgments on extreme value relationships. For example, when the question involves comparing the distances from multiple starting points to the same destination, the reasoning and decision-making unit sorts the returned values, determines the option with the shortest distance or the least time, and returns this judgment result as the reasoning answer to the supervisor agent.

[0033] Furthermore, the map reasoning agent also includes a fault-tolerant retry unit; The fault-tolerant retry unit has a preset retry threshold. When the call to the map application programming interface fails, the fault-tolerant retry unit is used to control the map inference agent to regenerate the application programming interface parameters or reselect the application programming interface name for a second attempt to call it, provided that the retry threshold is not exceeded. When the number of failed calls exceeds the retry threshold, the fault-tolerant retry unit generates a task execution failure status report and sends it to the supervisor agent.

[0034] It is understood that the map inference agent in this application is equipped with a fault-tolerant retry unit, which has a preset retry threshold. During the process of the map inference agent calling the map application programming interface, if the call fails due to reasons such as incorrect interface name selection, incorrect parameter format, network communication abnormalities, or temporary unavailability of the interface server, the fault-tolerant retry unit intervenes. The fault-tolerant retry unit first determines whether the current number of retries has reached the preset retry threshold. If the threshold has not been reached, it proceeds to the error analysis and retry process.

[0035] The fault-tolerant retry unit controls the large language model in the map inference agent to analyze the reasons for failure and take corresponding corrective measures based on the analysis results. If the failure is due to an improper selection of the application programming interface (API) name, the API name to be called is redefined; if the failure is due to an error in parameter construction, the latitude and longitude coordinate information is re-extracted or the parameter filling format is adjusted to generate a corrected API call instruction. After the correction is completed, the fault-tolerant retry unit instructs the map inference agent to call the map API again with the corrected parameters and accumulates the number of retries. When the cumulative number of failed API calls for the same task reaches or exceeds the preset retry threshold, the fault-tolerant retry unit determines that the task cannot be completed under the current conditions through the retry mechanism. At this time, the fault-tolerant retry unit stops the retry process, generates a task execution failure status report containing the failure reason and the number of retries performed, and sends the status report to the supervisor agent. Through the above mechanism, the map inference agent can automatically recover when encountering occasional call errors, while avoiding the waste of system resources or excessive response delays caused by infinite retries.

[0036] In other words, the map agent will also encounter errors when calling APIs. Upon encountering an error, it will first determine whether the task does not belong to it (e.g., the supervisor has not provided the latitude and longitude information required to call the tool). If it does not belong to it, it will immediately report the error to the supervisor so that the supervisor can make a new decision. If it does belong to its task, it will not report the error to the supervisor directly, but will use the remaining number of attempts (which is predefined to avoid endless thinking when encountering errors) to rethink (e.g., whether it is caused by incorrect parameters or incorrect interface name selection), and call the API again. Only when all attempts have been used up and still no answer can be obtained will it report the error to the supervisor. This decision-making process avoids the problem of permanent irreversibility caused by a "careless" mistake, thus improving the fault tolerance of the agent.

[0037] Furthermore, the supervisory agent includes a task allocation unit, an answer judgment unit, and a monitoring and decision-making unit; The task allocation unit is used to send the natural language question, the intent information, and the slot information to the database interaction agent; The answer judgment unit is used to determine whether the information contained in the query result meets the preset answer output conditions; The monitoring and decision-making unit is used to receive task execution failure status reports returned by the database interaction agent or the map reasoning agent, and when the task execution failure status report is received, it triggers the large language model to re-evaluate the task allocation path. If the failure is determined to be due to an incorrect task allocation object, it generates an instruction to send the corresponding data to another agent module.

[0038] Understandably, the supervisory agent includes a monitoring and decision-making unit to monitor the execution status of the database interaction agent and the map reasoning agent. During the execution of assigned tasks by each agent module, if a task cannot be completed due to reasons such as a mismatch between the task type and the agent's capabilities, a lack of necessary input parameters, or internal processing anomalies, the corresponding agent module will generate a task execution failure report and return it to the supervisory agent. The monitoring and decision-making unit receives this report and identifies the occurrence of the task execution failure event.

[0039] When the monitoring and decision-making unit receives a task execution failure report, it triggers the large language model in the supervisor agent to re-evaluate the current task allocation path. Based on the original natural language question, intent information, slot information, and the failure reason description included in the failure report, the large language model analyzes whether the failure is due to an incorrect task allocation target selection or because the required data cannot be obtained. If the analysis determines that the failure is due to an incorrect task allocation target—meaning the current task should have been executed by another agent module—the monitoring and decision-making unit generates a task reassignment instruction.

[0040] The task reassignment instruction is used to instruct the input data originally assigned to the current agent module to be resent to another agent module. For example, if the supervisor agent mistakenly assigns a task requiring a database query to the map reasoning agent, and the map reasoning agent returns a failure report due to inability to access the database, the monitoring and decision-making unit will generate an instruction to resend the natural language question, intent information, and slot information to the database interaction agent for execution. Through this mechanism, the system has the ability to recover from task assignment errors, avoiding the interruption of the entire question-and-answer process due to a single decision error.

[0041] In other words, when the supervisor agent assigns a task incorrectly, such as assigning a task that originally belonged to the database agent to the map agent, the map agent, unable to resolve the issue due to its available tools, will report the error to the supervisor. Upon receiving the error, the supervisor will make a new decision, such as reassigning the task to the database agent. This new decision will correct the original incorrect decision path into the correct one. In another scenario, since the supervisor manages two agents, several situations may arise: (1) The database agent completes the task correctly, while the map agent fails to complete it. Since only an incomplete answer is obtained, the supervisor will analyze that the current chain of evidence is incomplete and cannot answer the user's question. The supervisor will report to the user that the question cannot be answered and provide the reason for the inability to answer. (2) The database agent is unable to complete the task, which prevents it from advancing the task allocation. The supervisor will also analyze that the current task cannot be advanced, report to the user that the question cannot be answered, and provide the reason for the inability to answer. (3) The database agent returns the correct answer, which is the final answer to the question. However, due to the supervisor's wrong decision, it is assigned to the map agent. At this time, the map agent cannot answer and reports the error to the supervisor. When the supervisor makes a new decision, it finds that the answer has been obtained and will reply to the user instead of making further decisions.

[0042] like Figure 2 As shown, based on the multi-agent map association question-answering system described in the above embodiments, the present invention also provides a question-answering method for the multi-agent map association question-answering system, the question-answering method for the multi-agent map association question-answering system comprising the following steps: Step S10: The front-end intelligent agent receives the natural language question input by the user, performs semantic parsing on the natural language question, and extracts the intent information and slot information from the natural language question.

[0043] In this embodiment, the front-end agent receives natural language questions input by the user through an interactive interface. These questions are submitted in text form and may involve geographic entity attribute queries or spatial relationship queries. The front-end agent is internally configured with a fine-tuned BERT model. This model undergoes supervised fine-tuning using a corpus set labeled with intent category tags and slot entity boundary tags, based on general pre-trained parameters.

[0044] Furthermore, upon receiving the natural language question, the BERT model segments the input text and converts it into a sequence of vector representations. A sequence labeling layer then performs classification prediction for each word. For the overall intent classification task, the model determines the intent category of the current question based on the output vector with a special classification label, outputting intent information. For the slot filling task, the model identifies the start and end positions of each entity segment in the text and maps the identified entity segments to predefined slot types, outputting slot information. This intent information and slot information together constitute a structured semantic representation of the natural language question. After the foreground agent completes parsing, it sends the original natural language question along with the extracted intent and slot information to the supervisor agent.

[0045] Step S20: The supervisor agent receives and sends the natural language question, the intent information, and the slot information to the database interaction agent.

[0046] Specifically, the supervisor agent receives natural language questions, intent information, and slot information from the foreground agent. The supervisor agent has a built-in large language model as its decision-making core. Upon receiving this information, the supervisor agent uses the natural language questions, intent information, and slot information as initial task parameters and sends them to the database interaction agent. During this process, the supervisor agent tracks the task execution status, recording the assigned agent module identifier and the sending timestamp, so as to receive return results or handle exceptions in subsequent processes.

[0047] Step S30: The database interaction agent generates a structured query statement based on the received natural language question, intent information, and slot information, queries an external database based on the structured query statement, and returns the query results to the supervisor agent.

[0048] In this embodiment, the database interaction agent receives natural language questions, intent information, and slot information sent by the supervisor agent. This module internally includes a table retrieval unit and a structured query statement generation unit.

[0049] The table retrieval unit generates a retrieval summary text based on the received information and performs a relevance search in the schema definition of the external database using the BM25 algorithm. By calculating the term frequency-inverse document frequency score between the table name and field description and the retrieval summary, it selects the data table structure most relevant to the current query.

[0050] Furthermore, the structured query generation unit inputs the natural language question, intent information, slot information, and retrieved data table structure information into the large language model. Based on semantic correspondence, the large language model maps the intent information and slot information to database query semantics, generating a query statement that conforms to the syntax of the structured query language. This query statement includes the target field to be queried, the data table name, and a query condition expression constructed based on the slot information. After generating the statement, the database interaction agent sends the query statement to an external database for execution, obtains the attribute information and latitude / longitude coordinates of the target geographic entity, and integrates the above information into the query results, returning them to the supervisor agent.

[0051] Step S40: The supervisor agent determines whether the query result meets the preset answer output conditions based on the large language model. If the answer output conditions are met, the agent generates the final response information based on the query result and outputs it to the user terminal. If the answer output conditions are not met, the agent generates a second decision instruction and sends the natural language question, the intent information, the slot information, and the query result to the map reasoning agent.

[0052] Specifically, the supervisor agent receives the query results returned by the database interaction agent. The large language model within the supervisor agent analyzes the query results to determine whether they meet preset answer output conditions. These conditions include: the intent information of the current question corresponds to the attribute query category, and the query results contain attribute information of the target geographic entity.

[0053] If the above conditions are met, it indicates that the current query can be answered with only static data, without further spatial calculations. The supervisor agent directly generates the final response information based on the query results and outputs it to the user. If the answer output conditions are not met, it indicates that the intent information of the current question corresponds to the spatial relationship query category, and the query results only contain latitude and longitude coordinates but lack spatial relationship calculation results, making it impossible to directly answer the user's question. In this case, the supervisor agent sends the natural language question, intent information, slot information, and query results together to the map reasoning agent.

[0054] Step S50: The map reasoning agent, based on the received natural language question, intent information, slot information, and query results, calls the map application programming interface to obtain geospatial relationship data, performs reasoning operations based on the geospatial relationship data to generate a reasoning answer, and returns the reasoning answer to the supervisor agent.

[0055] In this embodiment, the map inference agent receives natural language questions, intent information, slot information, and query results sent by the supervisor agent. First, based on the received natural language questions, intent information, and slot information, it analyzes the spatial operation requirements contained therein to determine the name of the map application programming interface to be invoked. For example, when the intent information indicates a need to obtain travel time between two locations, a route planning interface is selected.

[0056] Furthermore, the map inference agent extracts the latitude and longitude coordinates of the target geographic entity from the query results and fills this information into the parameter template corresponding to the selected interface name, generating a complete interface call instruction. For complex queries requiring multiple interface calls, the map inference agent breaks down the problem into multiple sub-call steps, generates corresponding parameter combinations for each, and executes the calls sequentially to obtain the geospatial relationship data for each sub-step. After the interface returns data, the map inference agent compares and performs calculations on the returned multiple values ​​based on the comparative logic relationships represented by the natural language question, intent information, and slot information, generating an inference answer that includes extreme value relationship judgments, and returns this inference answer to the supervisor agent.

[0057] Step S60: The supervisory agent integrates the reasoning answers into a final response message and outputs it to the user terminal.

[0058] In this embodiment, the supervisor agent receives the reasoned answer returned by the map reasoning agent. This reasoned answer has undergone spatial calculation and comparative reasoning processing by the map reasoning agent and contains conclusive information that directly answers the user's question. The supervisor agent integrates the reasoned answer, converting it into a natural language expression format adapted to the user interface, generating the final response information. During the integration process, the supervisor agent can appropriately organize the reasoned answer according to the question format of the original natural language question, ensuring its clarity, completeness, and consistency with the dialogue context. After integration, the supervisor agent outputs the final response information to the user, completing the full response process to the user's question.

[0059] If an exception occurs in any previous execution step that results in the inability to obtain a valid answer, the supervisory agent will generate a corresponding prompt as the final response output, explaining to the user why it could not answer.

[0060] Furthermore, the question-and-answer method also includes: When the supervisor agent receives the natural language question, the intent information, and the slot information, it sends the natural language question, the intent information, and the slot information to the map reasoning agent. When the map reasoning agent determines that the query result is missing in the received data, it initiates an information retrieval request to the database interaction agent. The database interaction agent responds to the information acquisition request and returns the query results obtained from the query to the map reasoning agent. After the map reasoning agent completes the application programming interface call and reasoning operation based on the query results, it sends the final reasoning answer to the supervisor agent.

[0061] It is understood that there may be multiple cooperative modes among the multiple agents in this application, and this application only proposes one feasible solution, such as... Figure 3 As shown, in another implementation, the supervisor agent can directly delegate the task to the map reasoning agent. The map reasoning agent will "request help" from the database interaction agent. After the database interaction agent returns the answer to the request to the map reasoning agent, the map reasoning agent will perform reasoning again based on the answer to the request, obtain the final reasoning result, and then return the final answer to the supervisor agent.

[0062] Specifically, after receiving the natural language question, intent information, and slot information, the supervisor agent no longer calls the database interaction agent first, as per the default procedure. Instead, it directly sends the information to the map inference agent. Upon receiving the information, the map inference agent first analyzes it to determine if the current task involves spatial operations requiring a call to the map application programming interface (API). When the map inference agent determines that the necessary latitude and longitude coordinates for calling the map API are missing from the received data, it proactively initiates an information retrieval request to the database interaction agent. This request carries the natural language question, intent information, and slot information so that the database interaction agent can determine the specific geographic entity to be queried. After responding to the request, the database interaction agent generates a structured query statement based on the received information, retrieves the corresponding attribute information and latitude and longitude coordinates from the external database, and directly returns the query results to the map inference agent. After obtaining the query results, the map inference agent extracts the latitude and longitude coordinates and continues with subsequent steps such as interface name selection, parameter construction, interface calling, and inference calculations. Finally, it sends the generated inference answer to the supervisor agent to complete the output. This scheme changes the task allocation order, demonstrating another implementation path for flexible collaboration among multiple agents.

[0063] The beneficial effects of this invention are as follows: by decoupling database queries and map service calls through multi-agent collaboration, real-time geospatial data is dynamically acquired and inference is performed, solving the problem that static knowledge bases cannot answer dynamic spatial queries, and significantly improving the accuracy of question answering and the fault tolerance of the system.

[0064] Furthermore, such as Figure 4 As shown, based on the above-mentioned multi-agent map association question answering system and question answering method, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 4 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0065] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media array (SMC), secure digital card (SD), flash memory card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a question-answering program 40 based on a multi-agent map association question-answering system. This question-answering program 40 can be executed by the processor 10 to implement the question-answering method of the multi-agent map association question-answering system in this application.

[0066] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the question-and-answer method of the multi-agent map association question-and-answer system.

[0067] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-screen liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visualized patient interface. The components of the terminal communicate with each other via a system bus.

[0068] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a question-answering program for a multi-agent map association question-answering system, and the question-answering program for the multi-agent map association question-answering system, when executed by a processor, implements the steps of the question-answering method for the multi-agent map association question-answering system as described above.

[0069] In summary, this invention provides a multi-agent map-related question-answering system and method. The system utilizes a fine-tuned BERT model to extract intent and slot information from user questions and passes this information to a supervisor agent controlled by a large language model. The supervisor agent then assigns the information to a database interaction agent, which performs a database query and returns the results to the supervisor agent. If the current result directly answers the user's question, the supervisor agent provides the answer. Otherwise, the supervisor agent passes the user's question, intent, slot information, and latitude and longitude information obtained from the database query to a map reasoning agent, which performs a map query. When the user's question involves reasoning, this agent performs the final reasoning and returns the reasoned answer to the supervisor agent, who then returns it to the user. This invention improves the execution efficiency and fault tolerance of multi-step spatial query tasks and ensures accurate and reliable answers by calling external tools to obtain dynamic data.

[0070] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.

[0071] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.

[0072] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A map-based question-answering system based on multi-agent interaction, characterized in that, The multi-agent map association question answering system includes: a front-end agent, a supervisor agent, a database interaction agent, and a map reasoning agent; the front-end agent is unidirectionally connected to the supervisor agent, and the supervisor agent is bidirectionally connected to both the database interaction agent and the map reasoning agent. The front-end intelligent agent is used to receive natural language questions input by the user, perform semantic parsing on the natural language questions, and extract intent information and slot information from the natural language questions; The supervisory agent is used to receive and send the natural language question, the intent information, and the slot information to the database interaction agent. The database interaction agent is used to generate a structured query statement based on the received natural language question, intent information and slot information, query an external database based on the structured query statement, and return the query results to the supervisor agent; The supervisory agent is also used to determine whether the query result meets the preset answer output conditions based on the large language model. If the answer output conditions are met, the final reply information is generated and output to the user terminal based on the query result. If the answer output conditions are not met, a second decision instruction is generated and the natural language question, the intent information, the slot information and the query result are sent to the map reasoning agent. The map reasoning agent is used to call the map application programming interface to obtain geospatial relationship data based on the received natural language question, intent information, slot information and query results, perform reasoning operations based on the geospatial relationship data to generate a reasoning answer, and return the reasoning answer to the supervisor agent; The supervisory agent is also used to integrate the reasoning answers into a final response message and output it to the user.

2. The map association question-answering system based on multi-agent technology according to claim 1, characterized in that, The foreground agent includes a fine-tuned BERT model, which is used to perform sequence labeling on the natural language question and extract intent information and slot information from the natural language question. The intent information corresponds to the category label of a predefined intent classification, and the slot information corresponds to the entity value of a predefined slot.

3. The map association question-answering system based on multi-agent technology according to claim 1, characterized in that, The database interactive intelligent agent includes a table retrieval unit and a query statement generation unit; The table retrieval unit is used to generate a retrieval summary based on the received natural language question, intent information, and slot information, and to retrieve relevant data table structures in the database schema based on the retrieval summary using the best matching algorithm. The query statement generation unit is used to generate a structured query statement for the external database based on the relevant data table structure, the intent information and the slot information through a large language model, and execute the structured query statement to obtain the query result; The query results include attribute information and latitude and longitude coordinates.

4. The multi-agent map association question-answering system according to claim 3, characterized in that, The map reasoning agent includes a programming interface selection unit, a parameter construction unit, and a reasoning decision unit. The programming interface selection unit is used to determine the name of the map application programming interface to be invoked based on the received natural language question, intent information and slot information; The parameter construction unit is used to extract the latitude and longitude coordinate information from the received query results, fill the latitude and longitude coordinate information into the parameter template corresponding to the name of the map application programming interface, generate an interface call instruction, and call the corresponding map application programming interface according to the interface call instruction to obtain geospatial relationship data. The reasoning decision unit is used to compare and calculate the multiple spatial distance values ​​based on the logical relationship represented by the natural language question, the intent information, and the slot information when the map application programming interface returns multiple spatial distance values, and generate the reasoning answer including the judgment of extreme value relationship.

5. The multi-agent map association question-answering system according to claim 1, characterized in that, The map reasoning agent also includes a fault-tolerant retry unit; The fault-tolerant retry unit has a preset retry threshold. When the call to the map application programming interface fails, the fault-tolerant retry unit is used to control the map inference agent to regenerate the application programming interface parameters or reselect the application programming interface name for a second attempt to call it, provided that the retry threshold is not exceeded. When the number of failed calls exceeds the retry threshold, the fault-tolerant retry unit generates a task execution failure status report and sends it to the supervisor agent.

6. The map association question-answering system based on multi-agent technology according to claim 1, characterized in that, The supervisory agent includes a task allocation unit, an answer judgment unit, and a monitoring and decision-making unit; The task allocation unit is used to send the natural language question, the intent information, and the slot information to the database interaction agent; The answer judgment unit is used to determine whether the information contained in the query result meets the preset answer output conditions; The monitoring and decision-making unit is used to receive task execution failure status reports returned by the database interaction agent or the map reasoning agent, and when the task execution failure status report is received, it triggers the large language model to re-evaluate the task allocation path. If the failure is determined to be due to an incorrect task allocation object, it generates an instruction to send the corresponding data to another agent module.

7. A question-answering method based on the multi-agent map association question-answering system according to any one of claims 1-6, characterized in that, The question-and-answer method includes: The front-end intelligent agent receives natural language questions input by the user, performs semantic parsing on the natural language questions, and extracts intent information and slot information from the natural language questions; The supervisory agent receives and sends the natural language question, the intent information, and the slot information to the database interaction agent. The database interaction agent generates a structured query statement based on the received natural language question, intent information, and slot information, queries an external database based on the structured query statement, and returns the query results to the supervisor agent. The supervisor agent determines whether the query result meets the preset answer output conditions based on the large language model. If the answer output conditions are met, the agent generates the final response information based on the query result and outputs it to the user. If the answer output conditions are not met, the agent generates a second decision instruction and sends the natural language question, the intent information, the slot information, and the query result to the map reasoning agent. The map reasoning agent, based on the received natural language question, intent information, slot information, and query results, calls the map application programming interface to obtain geospatial relationship data, performs reasoning operations based on the geospatial relationship data to generate a reasoning answer, and returns the reasoning answer to the supervisor agent; The supervising agent integrates the reasoning answers into a final response message and outputs it to the user.

8. The question-answering method of the multi-agent map association question-answering system according to claim 7, characterized in that, The question-and-answer method also includes: When the supervisor agent receives the natural language question, the intent information, and the slot information, it sends the natural language question, the intent information, and the slot information to the map reasoning agent. When the map reasoning agent determines that the query result is missing in the received data, it initiates an information retrieval request to the database interaction agent. The database interaction agent responds to the information acquisition request and returns the query results obtained from the query to the map reasoning agent. After the map reasoning agent completes the application programming interface call and reasoning operation based on the query results, it sends the final reasoning answer to the supervisor agent.

9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a question-answering program for a multi-agent map association question-answering system stored in the memory and executable on the processor. When the question-answering program for the multi-agent map association question-answering system is executed by the processor, it implements the steps of the question-answering method for the multi-agent map association question-answering system as described in any one of claims 7-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a question-answering program for a multi-agent map association question-answering system, which, when executed by a processor, implements the steps of the question-answering method for a multi-agent map association question-answering system as described in any one of claims 7-8.

Citation Information

Patent Citations

  • Geographic knowledge complex question and answer method based on space-time agent architecture

    CN120745840A

  • AgenticRAG-based customer service multi-agent collaborative question and answer method and system

    CN121031771A

  • Map class query demand processing method and device, electronic equipment and storage medium

    CN121071195A