Question and answer method and device based on multiple agents, medium, equipment and program product

By dynamically allocating agent resources through a multi-agent architecture, the system addresses the inefficiencies and lack of flexibility in existing agent question-answering systems when handling different types of questions. This results in efficient and accurate question-answering responses, improving the system's adaptability and resource utilization efficiency.

CN121542390AActive Publication Date: 2026-02-17BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511882572.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-12
Publication Date
2026-02-17
Estimated Expiration
2045-12-12

AI Technical Summary

Technical Problem

Existing intelligent agent question answering systems cannot effectively balance processing efficiency, resource consumption, and response success rate when faced with different types of questions, and they also lack flexibility and adaptability.

Method used

A multi-agent architecture is adopted, in which the first agent analyzes the problem type, the second agents with different capabilities are dynamically allocated for planning, forming an executor set, and the third agent calls tools to generate response content. Combined with a two-layer memory bank, the planning efficiency and accuracy are improved.

Benefits of technology

It enables efficient and accurate responses to different types of questions, dynamically adjusts resource allocation, and improves the flexibility and scalability of the question-and-answer system to adapt to complex and ever-changing application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542390A_ABST
    Figure CN121542390A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-agent-based question and answer method and device, a medium, equipment and a program product, and relates to the technical field of agents and artificial intelligence. The question and answer method comprises the steps that a target type to which a first target question belongs is obtained through a first agent; planning based on the first target problem through a second agent corresponding to the target type to obtain a target plan, the target plan comprising an executor set for realizing each subtask and a tool calling step for calling an associated tool by a third agent in the executor set to realize the corresponding subtask; the target plan is executed, a tool associated with a third agent is called through the third agent in the executor set according to the tool calling step of the corresponding subtask to achieve the subtask, the calling result of the tool is used for generating reply content of the first target question, and different agents achieve processing of different nodes in the question and answer. And the whole scheme has higher flexibility and expandability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of intelligent agents and artificial intelligence, and in particular, to a multi-agent based question and answer method, device, medium, equipment and program product. BACKGROUND

[0002] With the development of artificial intelligence technology, intelligent agents are gradually applied to various fields. For example, in a question and answer scenario, a user can input a question to an intelligent agent in the form of natural language, and the intelligent agent can output corresponding reply content.

[0003] However, although there are schemes for implementing question and answer based on intelligent agents in the related art, these schemes still need to be improved. SUMMARY

[0004] This summary is provided to introduce a selection of concepts that are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed technology, nor is it intended to be used to limit the scope of the claimed technology.

[0005] In a first aspect, the present disclosure provides a multi-agent based question and answer method, comprising: analyzing, by a first intelligent agent, a first target question obtained to obtain a target type to which the first target question belongs, wherein different types of questions have different complexity levels; planning, by a second intelligent agent corresponding to the target type, based on the first target question, to obtain a target plan for answering the first target question, wherein different types of second intelligent agents have different planning capabilities, the target plan includes at least one set of executors for implementing sub-tasks, and at least one third intelligent agent in the at least one set of executors calls an associated tool to implement a corresponding sub-task in a tool calling step; executing the target plan to call the tool associated with the at least one third intelligent agent to implement the sub-task according to the tool calling step corresponding to the sub-task by at least one third intelligent agent in the set of executors, and the calling result of the tool is used to generate reply content of the first target question.

[0006] In a second aspect, the present disclosure provides a multi-agent based question and answer device, comprising: an analysis module configured to analyze a first target question obtained by a first intelligent agent to obtain a target type to which the first target question belongs, wherein different types of questions have different complexity levels; a planning module, configured to plan, by a second agent corresponding to the target type, based on the first target question, to obtain a target plan for answering the first target question, wherein the second agents corresponding to different types have different planning capabilities, the target plan includes at least one performer set for implementing each subtask, and at least one third agent in the at least one performer set calls an associated tool to implement a corresponding subtask in a tool calling step; an execution module, configured to execute the target plan, so that at least one third agent in the performer set calls a tool associated with the at least one third agent to implement the subtask according to the tool calling step corresponding to the subtask, and a calling result of the tool is used to generate a reply content of the first target question.

[0007] In a third aspect, the present disclosure provides a computer readable medium having a computer program stored thereon, the computer program being executed by a processing device to implement the steps of the question and answer method in the first aspect.

[0008] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device having a computer program stored thereon; a processing device configured to execute the computer program in the storage device to implement the steps of the question and answer method in the first aspect.

[0009] In a fifth aspect, the present disclosure provides a computer program product comprising a computer program, the computer program being executed by a processor to implement the steps of the question and answer method in the first aspect.

[0010] The higher the decision cost of the second agent, the higher the planning complexity of the second agent, and the lower the planning complexity of the second agent. The second agent with low capability can accurately plan the plan of the simple problem. Therefore, for different types of problems, the target plan for answering the first target question is obtained by using the second agent corresponding to different types, the processing logic of human handling different types of problems is simulated, the matching between the decision cost and the problem type is realized under the premise of obtaining the accurate target plan, and the processing efficiency, resource consumption and reply success rate and other performances in the question and answer are balanced. Different agents are used to realize the processing of different nodes in the question and answer, that is, the type analysis of the first target question, the planning of the target plan corresponding to the first target question, and the execution of the target plan, so that the decoupling of different nodes in the question and answer is realized. In addition, the performer set can be dynamically determined, and the overall scheme has higher flexibility and scalability.

[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF DRAWINGS

[0012] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The same or similar components have the same or similar reference numbers throughout the drawings. It should be understood that the drawings are not necessarily to scale, with emphasis being placed upon illustrating the principles of the embodiments of the present disclosure. In the drawings: Figure 1 is a schematic diagram of an application architecture for implementing a multi-agent based question answering method according to an embodiment of the present disclosure; Figure 2 is a flowchart of a multi-agent based question answering method according to an embodiment of the present disclosure; Figure 3 is a schematic diagram of a process for implementing a multi-agent based question answering method according to an embodiment of the present disclosure; Figure 1 is a schematic diagram of a process for implementing a multi-agent based question answering method according to an embodiment of the present disclosure; Figure 4 is a schematic diagram of a process for revising a target plan according to an embodiment of the present disclosure; Figure 5 is a schematic diagram of a process for updating a first memory bank according to an embodiment of the present disclosure; Figure 6 is a block diagram of a multi-agent based question answering device according to an embodiment of the present disclosure; Figure 7 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0013] Embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings. While several embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the present disclosure to those skilled in the art. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of the present disclosure.

[0014] It should be understood that each of the steps recited in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0015] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising, but not limited to." The term "based on" is "based, at least in part, on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related definitions will be given in the description below.

[0016] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and do not limit the order or interdependence of the functions performed by these devices, modules or units.

[0017] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one" or "multiple" should be understood as "one or more" unless otherwise explicitly indicated in the context.

[0018] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of the messages or information.

[0019] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.

[0020] For example, in response to receiving the active request of the user, the user is sent prompt information to explicitly prompt the user that the operation requested to be performed will require obtaining and using the personal information of the user. Thus, the user can voluntarily choose whether to provide personal information to the software or hardware such as electronic device, application program, server or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt information.

[0021] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending prompt information to the user may, for example, be a pop-up window manner, and the prompt information may be presented in the form of text in the pop-up window. In addition, the pop-up window may also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0022] It can be understood that the above notification and user authorization process is only illustrative, and does not limit the implementation manner of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0023] At the same time, it can be understood that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solution should comply with the requirements of the relevant laws and regulations and relevant provisions.

[0024] An agent refers to a system, hardware or program that can autonomously perform a task on behalf of a user or other system by designing its workflow and using available tools. When receiving a question, an agent usually includes a plan planning stage and a plan execution stage for the question to obtain the reply content of the question. Generally, one agent is pre-configured to implement the plan planning stage, and another agent is pre-configured to implement the plan execution stage. However, the pre-configured cooperation mode is too rigid to adapt to complex and variable application scenarios, affecting the efficiency and flexibility of question and answer.

[0025] Figure 1 is a schematic diagram of an application architecture for implementing a multi-agent-based question and answer method according to an embodiment of the present disclosure, referring to Figure 1 The application architecture includes a user layer and an agent system. The user layer is configured to provide a user to input a first target question and display the first target question and the reply content of the first target question generated by the agent system.

[0026] The agent system includes a coordinator layer, a planner layer, an executor layer and a tool layer. A first agent in the coordinator layer is configured to receive a user input first target question, analyze the first target question, obtain a target type to which the first target question belongs, and distribute the first target question to a second agent of a corresponding type based on the target type. The planner layer includes second agents of different types, which are configured to plan based on the first target question of the corresponding type to obtain a target plan of the first target question. The executor layer includes third agents associated with different tools. The second agent dynamically assembles an executor set for executing each subtask in the target plan based on the target plan. The third agent in the executor set calls the associated tool to perform the corresponding subtask according to the tool calling step of the subtask. The calling result of the tool is used to generate the reply content of the first target question.

[0027] Figure 2 is a flowchart of a multi-agent-based question and answer method according to an embodiment of the present disclosure. The multi-agent-based question and answer method can be applied to an electronic device, which can include a user layer in an application architecture as shown in Figure 1 The electronic device can establish a communication connection with an agent system as shown in Figure 1 to implement the multi-agent-based question and answer method. Referring to Figure 2 The multi-agent-based question and answer method can include steps 210, 220 and 230.

[0028] In step 210, the first target question obtained is analyzed by the first agent to obtain a target type to which the first target question belongs, wherein the complexity of different types of questions is different.

[0029] In some embodiments, the agent system establishing a communication connection with the electronic device can provide an interactive interface for the user to input a question, which can provide an information input box and an information display box for displaying the historical dialogue between the user and the agent system. A sending control is set in the information input box, through which the user can send the user-input question to the first agent and display it in the information display box.

[0030] It should be understood that different types of questions have different levels of complexity, for example, the first target question can be a simple question, a medium question and a complex question, and the complexity of the simple question, the medium question and the complex question increases in turn. The second agent implementing the planning of the question of different complexity is different, and the second agent with low planning ability can still plan an accurate plan when facing a simple question, and for a complex question, a second agent with high planning ability is needed to execute planning to obtain an accurate plan.

[0031] In some embodiments, the first agent can analyze the first target question, and based on the analysis result, obtain an initial plan defining key steps and dependency relationships for generating reply content of the first target question, and based on the key steps and dependency relationships, the judgment of the target type to which the first target question belongs can be implemented. For example, simple questions, medium questions and complex questions can be defined in advance, for example, the key steps and dependency relationships of simple questions, medium questions and complex questions are defined, and then the prompt word template is constructed based on the definition of the question. Fill the first target question into the prompt word template to obtain the corresponding prompt word, and the first agent can determine the target type to which the first target question belongs based on the prompt word.

[0032] In some embodiments, the above analysis includes intent recognition, and based on the intent recognition result, the initial plan described above can be determined. The first agent can implement intent recognition of the first target question in the following manner: rewriting the first target question input by the user in combination with the historical dialogue; obtaining context information of the rewritten first target question and extracting entities of the rewritten first target question; determining the intent of the first target question based on the context information and the entities. Rewriting the first target question through the historical dialogue can ensure the integrity of the user's intent; through entity extraction, the accuracy of intent recognition can be improved.

[0033] In some embodiments, contextual information about the rewritten first target question can be obtained through various means. For example, contextual information can be obtained based on a terminology database, web search, and the retrieval of example questions. The terminology database stores explanations of terms associated with specific terms; these explanations can be found within the database to identify terms relevant to the first target question. Web search involves searching the internet for information related to the first target question. Example questions can aid in intent determination. Retrieving context through multiple means increases the diversity of context and improves the accuracy of intent recognition.

[0034] In step 220, a second agent corresponding to the target type plans based on the first target problem to obtain a target plan for answering the first target problem. The second agents corresponding to different types have different planning capabilities. The target plan includes at least one set of executors to implement each sub-task, and at least one third agent in the at least one set of executors to call the tool invocation step of the associated tool corresponding to the sub-task.

[0035] In step 230, the target plan is executed so that at least one third agent in the executor set invokes the tool associated with the at least one third agent according to the tool invocation step of the corresponding subtask to implement the subtask, and the tool invocation result is used to generate the response content of the first target question.

[0036] In some embodiments, the subtasks in the target plan may have dependencies, which determine whether the subtasks are executed in parallel or sequentially.

[0037] Figure 3 It is a method based on the embodiments shown in this disclosure. Figure 1 The diagram illustrates the process of implementing a multi-agent question-answering application architecture. The user submits a first target question to the coordinator layer through the user layer. The first agent in the coordinator layer analyzes the first target question to determine its target type. Based on the target type, the first agent schedules the first target question to a corresponding second agent in the planner layer, enabling the second agent to plan a target plan based on the first target question. Figure 3 In this model, agent 1 corresponds to complex problems, agent 2 to medium-difficulty problems, and agent 3 to simple problems. Further, the third agent in the executor set invokes the associated tools to execute the corresponding sub-tasks in the target plan, thereby generating a response to the first target problem. When dynamically creating the executor set, at least one executor set can be created based on the task requirements of the sub-tasks, for example... Figure 3 It can dynamically create executor set A, executor set B, and executor set.

[0038] The higher the capability of the second agent, the higher the decision-making cost. As mentioned above, a more capable second agent is better suited for planning complex problems, while a less capable one is better suited for planning simple problems. Therefore, when facing different types of problems, using second agents corresponding to different types yields target plans for answering the primary target question. This simulates the human processing logic for different types of problems, achieving a match between decision-making costs and problem types while obtaining accurate target plans. This balances performance in question-and-answer processing, including processing efficiency, resource consumption, and response success rate. Different agents handle different nodes in the question-and-answer process: analyzing the type of the primary target question, planning the target plan corresponding to the primary target question, and executing the target plan. This decouples different nodes in the question-and-answer process. Furthermore, at least one set of executors for each subtask is dynamically created. Based on the task requirements of the subtask, a third agent with the corresponding tool-calling capability is selected to implement the subtask, thus making the overall solution more flexible and scalable.

[0039] In some embodiments, the question-answering method described above may further include the following steps: retrieving a target historical plan that perfectly matches the first target question from a first memory bank by a first agent, wherein the thought chain of the historical question corresponding to the target historical plan is the same as the thought chain of the first target question; determining that the first agent has retrieved a target historical plan that perfectly matches the first target question; and executing the target historical plan.

[0040] The thought chain describes the reasoning steps for achieving question answering. Each reasoning step corresponds to a subtask and how to call tools to achieve the subtask. Based on this thought chain, the second agent can further generate the corresponding target plan.

[0041] Since the thought process is the same, the final plan generated will also be the same. Therefore, we can skip the planning of the target plan and directly execute the target historical plan that perfectly matches the first target problem to improve response efficiency and thus improve user experience.

[0042] For example, the following method can be used to determine that the first agent has retrieved a target historical plan that perfectly matches the first target problem: the first agent compares the thought chain of the first target problem with the thought chain of the historical problem in the first memory bank in multiple dimensions to obtain the comparison results of the historical problem in each dimension; it is determined that the comparison results of the historical problem in all dimensions represent a match; and it is determined that the first agent has retrieved a target historical plan that perfectly matches the first target problem.

[0043] It is understandable that the comparison results across all dimensions indicate that the historical plan corresponding to the matched historical problem is the target historical plan that perfectly matches the first target problem. As an example, these dimensions could include the object of analysis, analysis time, analysis dimensions, and analysis depth within the thought process.

[0044] In this way, by comparing multiple dimensions, the accuracy of retrieving target historical plans can be improved.

[0045] In some embodiments, the question-answering method may further include the following steps: retrieving a strategy matching the first target question from a second memory bank by a first agent, wherein the historical question corresponding to the strategy is similar to the first target question; further, step 220 may be implemented by: determining that the first agent has not retrieved a target historical plan that fully matches the first target question, but has retrieved a strategy that matches the first target question; and using a second agent corresponding to the target type to plan based on the strategy and the first target question to obtain a target plan for answering the first target question.

[0046] In this context, strategy is not simply factual knowledge, but a higher level of knowledge. For example, factual knowledge can generally only answer what, but it is difficult to answer how to do it or how to do it well, while strategy can reflect how to do it or how to do it well.

[0047] It should be noted that in the question-answering domain, although the questions may differ, the planning process for similar questions can share similarities, thus enabling planning through analogical reasoning. Therefore, strategies corresponding to similar questions, i.e., experience, can be acquired, and this knowledge can provide suggestions for solving new problems to the second agent, thereby improving the efficiency of planning.

[0048] In some embodiments, the second memory stores the query vector of the problem and the corresponding policy. The second memory can be constructed by: acquiring memory data of the response content of the problem generated by the agent system, which is stored in a third memory; processing the memory data to obtain the policy and query vector corresponding to the problem; and storing the policy and query vector corresponding to the problem in the second memory.

[0049] In this embodiment, the aforementioned problem can be a problem input by the first intelligent agent that has successfully generated a corresponding response.

[0050] In this embodiment, the third memory bank can be a structured event log database or a time-series database, which stores the complete process of the second agent implementing the above plan for each problem. This includes the second agent acquiring the problem, each step (i.e., each subtask) in the target plan planned by the second agent for the problem, the set of executors, each tool call of the executor set, errors encountered during the call, reflections, and the final response content, etc., which are complete data for question answering. This data is the basic data for policy learning. That is, by processing the memory data in the third memory bank, an abstract, generalized policy and the corresponding query vector are obtained.

[0051] In this embodiment, after receiving the first target question, the second agent acquires the corresponding features and constructs a query vector based on these features to retrieve a strategy that matches the first target question. For example, if the first target question is "fix a slow-running Python program", a query vector for the first target question can be constructed. This query vector could be "find the most efficient solution strategy related to 'application performance optimization' and 'Python language'". Based on this query vector, the corresponding query vector can be retrieved, and the strategy corresponding to the query vector can be used as the strategy that matches the first target question.

[0052] Furthermore, the second agent, based on the retrieved strategies that match the first objective problem, and in conjunction with relevant information about the first objective problem, plans to obtain the objective plan for the first objective problem. For example, for the strategy "first analyze performance and locate the bottleneck function," the second agent, in conjunction with relevant information about the first objective problem, such as the deployment environment, generates the objective plan for the first objective problem.

[0053] By utilizing the above method, a second-level memory bank, consisting of two independent layers—a second memory bank and a third memory bank—is used to replace the traditional memory bank that can only store factual knowledge. The addition of a second memory bank that stores strategies provides the second agent with higher-level knowledge for solving new problems, enabling the second agent to plan without starting from scratch, thus improving the efficiency and accuracy of the second agent's planning.

[0054] In some embodiments, the second agent plans at least one set of executors and corresponding tool invocation steps to implement each subtask step by step. Therefore, the above step 230 can be implemented in the following way: when the second agent has planned at least one set of executors for a subtask and the tool invocation steps of the at least one set of executors to implement the corresponding subtask, at least one third agent in the at least one set of executors invokes the tool associated with at least one third agent to implement the subtask according to the tool invocation steps of the corresponding subtask.

[0055] By using the above methods, planning and execution can be carried out simultaneously, thereby improving the efficiency of question and answering.

[0056] In some embodiments, prompt words can be set to prompt time-consuming execution steps to be planned in advance, thus solving the bottleneck effect.

[0057] In some embodiments, the above question-answering method may further include the following steps: obtaining the tool call result of the subtask and evaluating the tool call result to obtain an evaluation result; generating a reflection report of the evaluation result if the evaluation result indicates that the target plan needs to be modified, wherein the reflection report includes the reasons for the need to modify the target plan; modifying the target plan according to the reflection report by a second agent to obtain an updated target plan; and executing the updated target plan.

[0058] Figure 4 This is a schematic diagram illustrating a process for modifying a target plan according to an embodiment of the present disclosure. (Refer to...) Figure 4 After the second agent initially plans the target plan for the first objective problem, it executes the corresponding sub-tasks in the target plan through the third agent in the executor set. That is, the third agent calls the associated tools to execute the sub-task according to the tool call steps corresponding to the sub-task, and then obtains the tool call result. The tool call result of the sub-task is obtained and the execution result is evaluated to obtain the evaluation result. If the evaluation result is failure, partial success or low efficiency, it is determined that the target plan needs to be revised. Furthermore, a reflection report of the evaluation result is generated. The second agent revises the target plan according to the reflection report to obtain a new target plan, and returns to the steps of executing the sub-tasks in the target plan, that is, to execute the sub-tasks in the new target plan. If the evaluation result is other, it is determined that the target plan does not need to be revised, and the other unexecuted sub-tasks in the target plan continue to be executed. This cycle continues until the response to the first objective problem is obtained.

[0059] It should be noted that the new target plan is a new question-and-answer plan designed to address the problems identified in the evaluation results and achieve the primary objective. The entire question-and-answer process forms a closed loop of execution, evaluation, reflection, and replanning, which enables the intelligent agent system to exhibit high robustness and adaptability in the face of unexpected errors, dynamic environmental changes, or inefficiencies.

[0060] In some embodiments, the step of planning based on a policy and a first target problem by a second agent corresponding to the target type to obtain a target plan for answering the first target problem may include: determining a thought chain based on a policy and a first target problem by a first model in the second agent corresponding to the target type, and simultaneously performing other operations during the determination of the thought chain; and obtaining a target plan for answering the first target problem by a second model in the second agent according to the thought chain.

[0061] The first model is a reasoning-based model that can think logically to arrive at a thought chain. However, this thinking process is time-consuming, especially when dealing with complex problems. Therefore, to improve question-and-answer efficiency, other operations can be performed simultaneously during the thinking process. These other operations could be those related to generating response content, such as knowledge retrieval involved in generating the response. The second model is a logical framework based on thought chains that quickly outputs a target plan.

[0062] In the above way, in the planning of the second intelligent agent, the first model capable of deep thinking is first used to construct the thought chain. On this basis, the second model is used to quickly transform the thought chain into an executable target plan based on the logical framework of the constructed thought chain. That is, the first model and the second model are used to collaboratively generate the target plan, thereby balancing the accuracy and efficiency of question answering.

[0063] In some embodiments, the above question-and-answer method may further include the following steps: obtaining a second target question, a target plan corresponding to the second target question, and a thought chain corresponding to the second target question; and writing the second target question, the target plan corresponding to the second target question, and the thought chain corresponding to the second target question into a first memory bank.

[0064] Here, the second objective problem may include a pre-configured problem. For example, the pre-configured problem could be a high-frequency problem preset by the operator. The explanation and description of the objective plan and thought process corresponding to the pre-configured problem can refer to the explanation and description of the objective plan and thought process of the first objective problem mentioned above; this embodiment will not elaborate further. This method supports the operator to preset problems, allowing the intelligent agent system to update its first memory bank.

[0065] Here, the second objective question can include the first objective question that needs to be written into the first memory. As an example, the first objective question to be written into the first memory could be the question corresponding to the high-quality thought chain and high-quality response content planned by the second agent. As an example, prompt words can be set to determine whether the thought chain and response content planned by the agent system for the first objective question meet the criteria of being high-quality. This approach allows the agent system to automatically evaluate the planned thought chain and response content, selecting thought chains that meet expectations for updating the first memory.

[0066] Figure 5 This is a schematic diagram illustrating a process for updating a first memory bank according to an embodiment of this disclosure. (Refer to...) Figure 5It can set up scheduled tasks to read pre-configured questions from operators, generate the thought process and target plan for that question, and write them into the first memory bank to achieve rapid Q&A for anticipated high-concurrency questions. For the first target question raised by the user, it recalls the target historical plan from the first memory bank. If it matches, it directly executes the target historical plan to generate the response content for the first target question. If it does not match, it executes the planning and execution of the target plan for the first target question. Furthermore, it determines whether the target plan and thought process corresponding to the first target question need to be written into the first memory bank, that is, whether the response content and thought process of the first target question are high-quality response content and high-quality thought process. If it is determined that the response content of the first target question is high-quality response content and the thought process of the first target question is high-quality thought process, it is determined that the target plan and thought process of the first target question need to be written into the first memory bank, and the writing is executed.

[0067] Based on the same concept, this disclosure also provides a multi-agent question-answering device. Figure 6 This is a block diagram illustrating a multi-agent question-answering device according to an embodiment of the present disclosure, with reference to... Figure 6 The multi-agent question-answering device 600 includes: Analysis module 601 is used to analyze the first target problem obtained by the first intelligent agent to obtain the target type to which the first target problem belongs, wherein the complexity of different types of problems is different; Planning module 602 is used to plan based on the first target problem by using a second agent corresponding to the target type to obtain a target plan for answering the first target problem. The second agents corresponding to different types have different planning capabilities. The target plan includes at least one set of executors to implement each sub-task, and at least one third agent in the at least one set of executors to call associated tools to implement the corresponding sub-tasks. The first execution module 603 is used to execute the target plan, so that at least one third agent in the executor set calls the tool associated with the at least one third agent according to the tool calling step corresponding to the sub-task to implement the sub-task, and the tool calling result is used to generate the response content of the first target question.

[0068] Optionally, the multi-agent question-answering device 600 further includes: The first retrieval module is used to retrieve a target historical plan that completely matches the first target problem from the first memory bank through the first intelligent agent, wherein the thought chain of the historical problem corresponding to the target historical plan is the same as the thought chain of the first target problem; The determination module is used to determine the target historical plan retrieved by the first agent that completely matches the first target problem; The second execution module is used to execute the target historical plan.

[0069] Optionally, the multi-agent question-answering device 600 further includes: The second retrieval module is used to retrieve, through the first agent, a strategy that matches the first target problem from the second memory bank, wherein the historical problem corresponding to the strategy is similar to the first target problem; The planning module 602 includes: The determination submodule is used to determine that the first agent has not retrieved a target historical plan that completely matches the first target problem, but has retrieved a strategy that matches the first target problem; The planning submodule is used to plan, through a second agent corresponding to the target type, based on the strategy and the first target question, to obtain a target plan for answering the first target question.

[0070] Optionally, the second intelligent agent progressively plans at least one set of executors to implement each of the sub-tasks and the corresponding tool invocation steps, and the first execution module 603 is further configured to: When the second agent has planned at least one set of executors for a subtask and the at least one set of executors has invoked the associated tool to implement the tool invocation step corresponding to the subtask, at least one third agent in the at least one set of executors invokes the tool associated with the at least one third agent to implement the subtask according to the tool invocation step corresponding to the subtask.

[0071] Optionally, the multi-agent question-answering device 600 further includes: The first acquisition module is used to acquire the tool call result of the subtask and evaluate the tool call result to obtain an evaluation result; The reflection module is used to generate a reflection report on the evaluation results when the evaluation results indicate that the target plan needs to be revised, wherein the reflection report includes the reasons for the need to revise the target plan; The correction module is used to correct the target plan based on the reflection report by the second intelligent agent to obtain an updated target plan; The third execution module is used to execute the updated target plan.

[0072] Optionally, the determining module is further configured to: The first intelligent agent compares the thought chain of the first target problem with the thought chain of historical problems in the first memory bank in multiple dimensions to obtain the comparison results of the historical problems in each dimension. The historical issues were determined to be matched in all dimensions of the comparison results. It is determined that the first agent retrieves a target historical plan that perfectly matches the first target problem.

[0073] Optionally, the second memory is constructed in the following manner: Acquire memory data of the response content to the questions generated by the intelligent agent system, wherein the memory data is stored in a third memory bank; The memory data is processed to obtain the strategy and query vector corresponding to the problem; The strategy corresponding to the problem and the queried vector are stored in the second memory.

[0074] Optionally, the planning submodule is further used for: A thought chain is determined based on the strategy and the first target problem using a first model in a second agent corresponding to the target type, wherein other operations are performed simultaneously during the determination of the thought chain; The second model in the second agent obtains a target plan for answering the first target question based on the thought chain.

[0075] Optionally, the multi-agent question-answering device 600 further includes: The second acquisition module is used to acquire the second target problem, the target plan corresponding to the second target problem, and the thought process corresponding to the second target problem; The writing module is used to write the second target problem, the target plan corresponding to the second target problem, and the thought chain corresponding to the second target problem into the first memory bank.

[0076] The implementation methods of each module of the multi-agent question-answering device 600 can be referred to the above method embodiments, and will not be repeated here.

[0077] Based on the same concept, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the above-described multi-agent question-answering method.

[0078] Based on the same concept, this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described multi-agent question-answering method.

[0079] Based on the same concept, this disclosure also provides an electronic device that may include: A storage device on which computer programs are stored; A processing device is used to execute a computer program stored in a storage device to implement the steps of the above-described multi-agent question-answering method.

[0080] The following is for reference. Figure 7 The diagram illustrates a structural schematic of an electronic device 700 suitable for implementing embodiments of the present disclosure. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0081] like Figure 7 As shown, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0082] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 700 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0083] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.

[0084] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0085] In some implementations, electronic devices can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communications (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0086] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0087] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the aforementioned one or more programs, the electronic device causes the following: First, an intelligent agent analyzes a first target question to determine the target type to which the first target question belongs, wherein different types of questions have different levels of complexity; second, an intelligent agent corresponding to the target type plans based on the first target question to obtain a target plan for answering the first target question, wherein the second intelligent agent corresponding to different types has different planning capabilities, and the target plan includes at least one set of executors for implementing each sub-task, and at least one third intelligent agent in the at least one set of executors calls associated tools to implement the corresponding sub-tasks via tool-calling steps; third, the target plan is executed so that at least one third intelligent agent in the executor set calls the tools associated with the at least one third intelligent agent according to the tool-calling steps corresponding to the sub-tasks to implement the sub-tasks, and the tool-calling results are used to generate a response to the first target question.

[0088] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0089] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0090] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the modules are not necessarily limiting in certain circumstances; for example, an analysis module can also be described as "a module that analyzes a first target problem obtained by a first intelligent agent."

[0091] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0092] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0093] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0094] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0095] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.

Claims

1. A multi-agent based question answering method, characterized by, The method comprises the following steps: analyzing the first target question by the first intelligent agent to obtain a target type to which the first target question belongs, wherein different types of questions have different complexity levels; planning based on the first target question by a second intelligent agent corresponding to the target type to obtain a target plan for answering the first target question, wherein different types of second intelligent agents have different planning capabilities, the target plan includes at least one performer set for implementing each subtask, and at least one third intelligent agent in the at least one performer set calls an associated tool to implement a tool calling step corresponding to the subtask; executing the target plan to call the tool associated with the at least one third intelligent agent to implement the subtask according to the tool calling step corresponding to the subtask by at least one third intelligent agent in the performer set, and the calling result of the tool is used to generate the reply content of the first target question.

2. The question and answer method of claim 1, wherein, The method further comprises the following steps: retrieving a target historical plan completely matching the first target question from a first memory bank by the first intelligent agent, wherein the thought chain of a historical question corresponding to the target historical plan is the same as the thought chain of the first target question; determining that the first intelligent agent retrieves the target historical plan completely matching the first target question; executing the target historical plan.

3. The question and answer method of claim 2, wherein, The method further comprises the following steps: retrieving a strategy matching the first target question from a second memory bank by the first intelligent agent, wherein a historical question corresponding to the strategy is similar to the first target question; The planning based on the first target question by the second intelligent agent corresponding to the target type to obtain the target plan for answering the first target question comprises the following steps: determining that the first intelligent agent does not retrieve the target historical plan completely matching the first target question, and retrieves the strategy matching the first target question; planning based on the strategy and the first target question by the second intelligent agent corresponding to the target type to obtain the target plan for answering the first target question.

4. The question answering method of claim 1, wherein, The second intelligent agent gradually plans at least one performer set for implementing each subtask and a tool calling step corresponding to the subtask, and the executing the target plan to call the tool associated with the at least one third intelligent agent to implement the subtask according to the tool calling step corresponding to the subtask by at least one third intelligent agent in the performer set comprises the following steps: in the case that the second intelligent agent plans at least one performer set for one subtask and the at least one performer set calls an associated tool to implement a tool calling step corresponding to the subtask, calling the tool associated with the at least one third intelligent agent to implement the subtask according to the tool calling step corresponding to the subtask by at least one third intelligent agent in the at least one performer set.

5. The question answering method of claim 1, wherein, The method further comprises the following steps: obtaining a tool invocation result of the subtask, and evaluating the tool invocation result to obtain an evaluation result; generating a reflection report of the evaluation result in a case where the evaluation result represents that the target plan needs to be corrected, wherein the reflection report includes a reason why the target plan needs to be corrected; correcting the target plan by the second agent according to the reflection report to obtain an updated target plan; executing the updated target plan.

6. The question and answer method of claim 2, wherein, The determining that the first agent retrieves a target historical plan completely matching the first target problem includes: comparing, by the first agent, a thought chain of the first target problem with thought chains of historical problems in the first memory bank in multiple dimensions to obtain comparison results of the historical problems in each dimension; determining that the comparison results of the historical problems in all the dimensions represent matching; determining that the first agent retrieves a target historical plan completely matching the first target problem.

7. The question and answer method of claim 3, wherein, The second memory bank is constructed by: obtaining memory data of reply content of a question generated by an agent system, wherein the memory data is stored in a third memory bank; processing the memory data to obtain a strategy corresponding to the question and a queried vector; storing the strategy corresponding to the question and the queried vector in the second memory bank.

8. The question and answer method of claim 3, wherein, The planning, by the second agent corresponding to the target type, based on the strategy and the first target question to obtain a target plan for answering the first target question includes: determining, by a first model in the second agent corresponding to the target type, a thought chain based on the strategy and the first target question, wherein other operations are synchronously performed in the process of determining the thought chain; obtaining, by a second model in the second agent, a target plan for answering the first target question according to the thought chain.

9. The question answering method of claim 2, wherein, The question and answer method further includes: obtaining a second target question, a target plan corresponding to the second target question, and a thought chain corresponding to the second target question; writing the second target question, the target plan corresponding to the second target question, and the thought chain corresponding to the second target question into the first memory bank.

10. A multi-agent based question answering apparatus, characterized by comprising: including: an analysis module configured to analyze, by a first agent, a first target question obtained to obtain a target type to which the first target question belongs, wherein different types of questions have different complexity levels; a planning module configured to plan, by a second agent corresponding to the target type, based on the first target question to obtain a target plan for answering the first target question, wherein different types of second agents have different abilities to plan the plan, the target plan includes at least one executor set for implementing each subtask, and at least one third agent in the at least one executor set calls an associated tool to implement a tool invocation step of a corresponding subtask; The first execution module is configured to execute the target plan, so that at least one third intelligent agent in the set of executors invokes a tool associated with the at least one third intelligent agent to implement a subtask according to a tool calling step corresponding to the subtask, and a calling result of the tool is used to generate a reply content of the first target question.

11. A computer readable medium having stored thereon a computer program, characterized in that The computer program, when executed by a processing device, implements the steps of the question and answer method according to any one of claims 1-9.

12. An electronic device, comprising: The computer program, when executed by a processing device, implements the steps of the question and answer method according to any one of claims 1-9. The computer program, when executed by a processing device, implements the steps of the question and answer method according to any one of claims 1-9. The computer program, when executed by a processing device, implements the steps of the question and answer method according to any one of claims 1-9.

13. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Problem processing method and device based on multiple agents and product

    CN118672782A

  • Question processing method and device based on artificial intelligence, computer equipment and medium

    CN119202156A

  • Financial question and answer method, system and equipment based on multi-agent interaction and medium

    CN119539095A

  • Industrial field knowledge question answering method and device, equipment, storage medium and product

    CN120086316A

  • Intelligent agent question and answer method and device fusing different large models, medium and product

    CN120353909A