Question and answer agent working method and device, computer equipment and readable storage medium
By using a dual-agent asynchronous architecture, the second agent re-analyzes the question-and-answer tasks and response results of the first agent, thus solving the problems of prolonged response time and low question-and-answer accuracy in existing dialogue systems and achieving fast and accurate question-and-answer responses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-07
AI Technical Summary
The increased response time of existing dialogue systems leads to a decrease in user experience, and the existing self-correction mechanisms of intelligent agents cannot effectively improve the accuracy of question and answer.
A dual-agent asynchronous architecture is adopted. The first agent quickly provides the response results, and the second agent re-analyzes the question-and-answer task and the response results to update the knowledge base and prompt word library of the first agent, so as to improve the accuracy of question and answer.
While ensuring rapid response, the accuracy and user experience of the question-and-answer system were improved. By using the strategies of the second intelligent agent to refine information and optimize the knowledge base and prompt word library of the first intelligent agent, the accuracy of question-and-answer task processing was enhanced.
Smart Images

Figure CN121809685A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a question and answer intelligent agent working method and device, computer equipment and readable storage medium. BACKGROUND
[0002] With the development of artificial intelligence technology, the dialogue system based on intelligent agents has been favored by more and more users; in order to improve the accuracy of the reply content of the inquiry question provided by the dialogue system to the user, the related technology provides a real-time reflection scheme for the reply content, which specifically realizes the instant correction of the reply content output to the user before output by continuously monitoring the dialogue process, and the related dialogue system usually includes dialogue analysis module, error detection module and instant correction module, etc. These modules run in a synchronous manner, which will cause the response time of the whole dialogue system to be prolonged, and the user experience is reduced. SUMMARY
[0003] Therefore, it is necessary to provide a question and answer intelligent agent working method, device, computer equipment, computer readable storage medium and computer program product capable of improving the response efficiency of the dialogue system in view of the above technical problems.
[0004] In a first aspect, the present application provides a question and answer intelligent agent working method, the question and answer intelligent agent includes a first intelligent agent and a second intelligent agent in communication, and the method includes:
[0005] In the case of receiving a question and answer task, input the question and answer task to the first intelligent agent, and output the reply result of the first intelligent agent for the question and answer task;
[0006] Input the question and answer task and the reply result to the second intelligent agent, and receive the output content of the second intelligent agent;
[0007] In the case that the output content of the second intelligent agent includes strategy improvement information, update the knowledge base and prompt word library of the first intelligent agent based on the strategy improvement information.
[0008] In one of the embodiments, the method further includes: in the case that the output content of the second intelligent agent includes correction information for the reply result, output the update result of the second intelligent agent for the reply result.
[0009] In one of the embodiments, the case that the output content of the second intelligent agent includes correction information for the reply result, output the update result of the second intelligent agent for the reply result, includes:
[0010] In a case where the second agent's output content includes correction information for the reply result, the second agent generates an updated result for the reply result based on the correction information and a preset correction dialogue.
[0011] In one of the embodiments, the inputting the question and answer task and the reply result to the second agent includes:
[0012] The question and answer task and the reply result are input to the second agent to drive the second agent to analyze the accuracy of the question and answer task and the reply result based on a preconfigured knowledge base and a prompt word library, and obtain an analyzed output content.
[0013] In one of the embodiments, after the output of the second agent's updated result for the reply result, the method further includes:
[0014] In a case where a similar task of the question and answer task is received within a preset time period, the similar task is input to the second agent; wherein the task processing capability of the second agent is higher than that of the first agent;
[0015] A reply result for the similar task is output based on the second agent.
[0016] In one of the embodiments, after the output of the second agent's updated result for the reply result, the method further includes:
[0017] In a case where at least one of the question and answer task, the reply result and the updated result includes a preset keyword within a preset time period, the question and answer task is input to the second agent, and the output content of the second agent is waited.
[0018] In one of the embodiments, in a case where the question and answer task is received, the question and answer task is input to the first agent, and a reply result for the question and answer task of the first agent is output, including:
[0019] In a case where the question and answer task is received, the question and answer task is input to the first agent based on a first process, and a reply result for the question and answer task of the first agent is output;
[0020] The question and answer task and the reply result are input to the second agent, and the output content of the second agent is received. In a case where the output content of the second agent includes strategy improvement information, the knowledge base and the prompt word library of the first agent are updated based on the strategy improvement information, including:
[0021] input the question and answer task and the reply result to a second agent based on a second process, and receive output content of the second agent, and in a case where the output content of the second agent includes strategy improvement information, update a knowledge base and a prompt word library of the first agent based on the strategy improvement information.
[0022] In a second aspect, the present application further provides a question and answer agent working device, the question and answer agent including a first agent and a second agent in communication, and the device includes:
[0023] a first question and answer module configured to, in a case where a question and answer task is received, input the question and answer task to a first agent, and output a reply result of the first agent for the question and answer task;
[0024] a second question and answer module configured to input the question and answer task and the reply result to a second agent, and receive output content of the second agent;
[0025] a feedback optimization module configured to, in a case where the output content of the second agent includes strategy improvement information, update a knowledge base and a prompt word library of the first agent based on the strategy improvement information.
[0026] In a third aspect, the present application further provides a computer device including a memory and a processor, the memory storing a computer program, and the processor, when executing the computer program, implements the following steps:
[0027] in a case where a question and answer task is received, input the question and answer task to a first agent, and output a reply result of the first agent for the question and answer task;
[0028] input the question and answer task and the reply result to a second agent, and receive output content of the second agent;
[0029] in a case where the output content of the second agent includes strategy improvement information, update a knowledge base and a prompt word library of the first agent based on the strategy improvement information.
[0030] In a fourth aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the following steps:
[0031] in a case where a question and answer task is received, input the question and answer task to a first agent, and output a reply result of the first agent for the question and answer task;
[0032] input the question and answer task and the reply result to a second agent, and receive output content of the second agent;
[0033] In a case where the output content of the second agent includes strategy improvement information, updating the knowledge base and the prompt word library of the first agent based on the strategy improvement information.
[0034] In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the following steps:
[0035] In a case where the question and answer task is received, inputting the question and answer task to the first agent and outputting a reply result of the first agent for the question and answer task;
[0036] Inputting the question and answer task and the reply result to the second agent and receiving output content of the second agent;
[0037] In a case where the output content of the second agent includes strategy improvement information, updating the knowledge base and the prompt word library of the first agent based on the strategy improvement information.
[0038] The question and answer agent working method, the device, the computer device, the computer readable storage medium and the computer program product provided by the present application have the following advantages. The question and answer agent working method inputs the question and answer task to the first agent and outputs a reply result of the first agent for the question and answer task in a case where the question and answer task is received, so as to quickly provide the user with the reply result for the question and answer task through the first agent, improve the efficiency of the user obtaining the reply result, and thus improve the user experience. Further, the question and answer task and the reply result are input to the second agent, and output content of the second agent is received. In a case where the output content of the second agent includes strategy improvement information, the knowledge base and the prompt word library of the first agent are updated based on the strategy improvement information. In this way, the question and answer task and the corresponding reply result processed by the first agent are analyzed and processed again by the second agent, so that in a case where it is analyzed and identified that the reply result is inaccurate, the second agent processes the related question and answer task again, and obtains output content at least including how to optimize the first agent to improve the reply strategy accuracy of the first agent for the related question and answer task. In a case where the output content corresponding to the analysis result includes strategy improvement information, the knowledge base and the prompt word library of the first agent are updated based on the strategy improvement information, which is beneficial to improving the processing accuracy of the first agent for similar question and answer tasks in the future. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained from these drawings without creative labor.
[0040] Figure 1 An application environment diagram of the question and answer agent working method in an embodiment;
[0041] Figure 2 A flowchart of the question and answer agent working method in an embodiment;
[0042] Figure 3 A data flow diagram of the question and answer task processing system in an embodiment;
[0043] Figure 4 A structural block diagram of the question and answer agent working device in an embodiment;
[0044] Figure 5 An internal structure diagram of the computer device in an embodiment. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0046] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "a plurality of" used in the present application refers to two or more. The term "and / or" used in the present application refers to one of the schemes, or any combination of a plurality of schemes.
[0047] With the development of the dialogue system technology in the field of artificial intelligence, for the self-correction and reflection mechanism of the agent, two schemes are mainly used in the related art, which are real-time reflection and simple post-prompting.
[0048] The real-time reflection is specifically achieved by continuously monitoring the dialogue process to realize instant correction of the dialogue content, that is, the dialogue content is analyzed in real time in the background to output the most accurate reply to the user. The related system usually includes a dialogue analysis module, an error detection module and an instant correction module, which run in a synchronous manner, resulting in prolonged overall response time.
[0049] The simple post-prompting is specifically that the related system generates supplementary content only when the user actively triggers the "supplementary questioning or continuous improvement of question and answer" function, lacking a systematic error detection mechanism.
[0050] For the real-time reflection and simple post-prompting schemes used in the related art, the applicant has found that the real-time reflection scheme significantly increases system delay due to the need to instantly process a large number of computing tasks, which seriously affects user experience; the simple post-prompting scheme can only handle single output correction, and users do not feel the intelligence of the intelligent agent, which also affects user experience.
[0051] Therefore, in order to solve the problems in the related art, the embodiments of the present application provide a question and answer intelligent agent working method, which can be applied to an application environment as shown in Figure 1 The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server.
[0052] Specifically, the server 104 can input the question and answer task to the first intelligent agent and output the reply result of the first intelligent agent to the question and answer task when receiving the question and answer task input by the user; then, the server 104 inputs the question and answer task and the reply result to the second intelligent agent and receives the output content of the second intelligent agent; when the output content of the second intelligent agent includes strategy improvement information, the server 104 updates the knowledge base and the prompt word library of the first intelligent agent based on the strategy improvement information; the server 104 analyzes and processes the question and answer task and the corresponding reply result processed by the first intelligent agent through the second intelligent agent, and optimizes and updates the knowledge base and the prompt word library of the first intelligent agent based on the strategy improvement information when the output content corresponding to the analysis result includes the strategy improvement information, which is beneficial to improving the processing accuracy of the first intelligent agent for similar question and answer tasks in the future.
[0053] Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0054] In one exemplary embodiment, such as Figure 2 As shown, a method for operating a question-answering agent is provided, which includes a first agent and a second agent for communication, and the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 203. Wherein:
[0055] Step 201: Upon receiving a question-and-answer task, input the question-and-answer task into the first intelligent agent and output the first intelligent agent's response to the question-and-answer task.
[0056] Specifically, the question-answering task can be any question input by the user seeking an answer; this application does not limit the type of question. The question-answering task can be based on user input using natural language, and can be a question, a statement, or a command. The user-inputted question-answering task may contain vague, colloquial, typos, or incomplete information.
[0057] Each response corresponds to a question-and-answer task, meaning there is a one-to-one semantic mapping relationship between the response and the question-and-answer task. The response is the direct and complete answer provided by the first agent after analyzing and processing the corresponding question-and-answer task.
[0058] The first intelligent agent is a data processing module included in an artificial intelligence system. It can receive natural language questions (question-answering tasks) posed by users as input, and after internal understanding and reasoning, generate an answer (response result) that is semantically consistent with the question, accurate in content, and compliant in form as output.
[0059] For example, when the server receives a question-and-answer task input by the user, it will input the question-and-answer task into the first agent in the artificial intelligence system, so that the first agent can analyze and process the question-and-answer task and output the first agent's direct and complete response to the question-and-answer task.
[0060] Step 202: Input the question-and-answer task and the response results into the second intelligent agent, and receive the output of the second intelligent agent.
[0061] The second intelligent agent is a data processing module in the artificial intelligence system that is different from the first intelligent agent. It can be used to analyze and process the matching degree of a set of question-and-answer tasks and response results processed by the first intelligent agent.
[0062] For example, while the server outputs the response results for the question-and-answer task to the first intelligent agent, or later, it may further input the set of question-and-answer tasks and response results into the second intelligent agent. The second intelligent agent can then analyze the matching degree of the set of question-and-answer tasks and response results and, based on the analysis results, obtain the output content that needs to be output to the first intelligent agent at least.
[0063] The output may include, for example, at least policy improvement information for optimizing the first agent's knowledge base and prompt word library. This policy improvement information can at least be used to update the first agent's knowledge base, prompting the first agent to update the relevant prompt word library based on the knowledge base, thereby improving the accuracy of the first agent's subsequent processing of received question-and-answer tasks.
[0064] Among them, the knowledge base is a database or document collection that stores factual and structured information and serves as the "content source" for the agent to answer questions; the prompt word library is a collection that stores instructional and guiding text templates and is used to control the large language model, serving as the agent's "behavior controller".
[0065] Step 203: If the output of the second agent includes policy improvement information, update the knowledge base and prompt word library of the first agent based on the policy improvement information.
[0066] In this process, the second agent analyzes the matching degree of a set of question-and-answer tasks and response results. If the analysis result indicates that the matching degree of the set of question-and-answer tasks and response results is lower than the preset matching degree, it means that the accuracy of the relevant response results provided by the first agent to the user has room for optimization. At this time, the second agent can be used to analyze and process the question-and-answer task again to obtain a new response result with higher accuracy. Furthermore, based on the content related to the set of question-and-answer tasks and the new response results, the second agent will conduct a reason analysis on the low accuracy of the relevant question-and-answer tasks and (old) response results. Through the reason analysis results, at least the output content on how to optimize the first agent to improve the accuracy of the first agent's response strategy for the relevant question-and-answer tasks can be obtained. If the output content corresponding to the analysis results includes strategy improvement information, the knowledge base and prompt word library of the first agent will be optimized and updated based on the strategy improvement information.
[0067] The question-answering agent working method provided in this application targets a question-answering agent comprising a first agent and a second agent in communication. This method, upon receiving a question-answering task, inputs the task to the first agent and outputs the first agent's response to the task, thereby quickly providing the user with a response to the question-answering task through the first agent, improving the efficiency of the user receiving the response and thus enhancing the user experience. Furthermore, the method inputs the question-answering task and the response to the second agent and receives the output of the second agent. If the output of the second agent includes policy improvement information, the method updates the first agent based on the policy improvement information. A first agent has a knowledge base and a prompting word library. A second agent then re-analyzes the question-and-answer tasks and corresponding responses processed by the first agent. If the analysis identifies inaccurate responses, the second agent reprocesses the relevant question-and-answer tasks, producing outputs that at least include information on how to optimize the first agent to improve the accuracy of its response strategies for related question-and-answer tasks. If the analysis outputs include strategy improvement information, the first agent's knowledge base and prompting word library are further optimized and updated based on this information, which helps improve the accuracy of the first agent in handling similar question-and-answer tasks in the future.
[0068] In an exemplary embodiment, the question-answering agent working method provided in this application further includes: when the output content of the second agent includes correction information for the response result, outputting the updated result of the second agent for the response result.
[0069] The second agent can output two types of results (two other outputs besides the aforementioned "policy improvement information"), specifically: ending the process and providing correction information for the responses output by the first agent. Specifically, for example, if the second agent's analysis of the matching degree between a set of question-and-answer tasks and responses shows a matching degree equal to or higher than a preset matching degree, the corresponding output can be ending the process; if the second agent's analysis of the matching degree between a set of question-and-answer tasks and responses shows a matching degree lower than a preset matching degree, the corresponding output can be relevant correction information.
[0070] The correction information can be composed of the second agent finding errors and proposing improvement suggestions based on a set of question-and-answer tasks and response results.
[0071] Among them, the question-and-answer task, the response result, and the update result can be associated with the dialogue ID (identification) based on the timestamp to avoid the problem of timing disorder in asynchronous processing.
[0072] For example, after the server inputs a set of question-and-answer tasks and response results into the second agent, it can obtain the analysis and processing results (output content) of the second agent for the set of question-and-answer tasks and response results. If the output content includes correction information for the response results, it indicates that the matching degree of the set of question-and-answer tasks and response results is lower than the preset matching degree, that is, the response results are not accurate enough and there is room for optimization. The server can further drive the second agent to update the response results output to the user by the first agent in combination with the correction information to obtain the updated results corresponding to the question-and-answer tasks.
[0073] In this embodiment, by including correction information for the response results in the output of the second agent, the updated results of the second agent are output. This allows the second agent to re-analyze the question-and-answer task and corresponding response results processed by the first agent. If inaccurate response results are identified, the second agent proactively and promptly provides updated results for the question-and-answer task and outputs them to the user, ensuring that the user receives more accurate results within a certain timeframe. The processing of the question-and-answer task by the first and second agents is asynchronous, which helps ensure the system's data processing performance.
[0074] For example, the task processing capability of the second intelligent agent can be optionally configured to be higher than that of the first intelligent agent. That is, the question-answering system (question-answering intelligent agent) provided in this application is equivalent to simultaneously including a first intelligent agent and a second intelligent agent. Although the data processing capability of the first intelligent agent is slightly weaker than that of the second intelligent agent, it can provide the user with timely response results on the question-answering task, so that the user can quickly get the answer to the input question and ensure the user's interactive experience. Then, without affecting the user's ability to continue to input new questions to the first intelligent agent, the second intelligent agent is used to reprocess and analyze the question-answering task and response results processed by the first intelligent agent. If the analysis results show that the response results of the question-answering task are not accurate enough, the second intelligent agent processes the question-answering task and outputs a second response result (updated result) on the same question-answering task to the user. In this way, on the basis of quickly outputting the answer to the user on the question through the first intelligent agent, the accuracy of the output answer is re-analyzed in the background, and an updated answer is actively output to the user when needed, so as to ensure that the user obtains an accurate answer to the question within a certain period of time.
[0075] In an exemplary embodiment, when the output content of the second intelligent agent includes correction information for the response result, the above steps include outputting an updated result of the second intelligent agent for the response result, which is generated by the second intelligent agent based on the correction information and a preset correction script.
[0076] Among them, the preset correction script is set in advance based on the needs. For example, it could be "I'm sorry, there were some problems with the reply result for 'a certain Q&A task' just now. It is now corrected to...". In other words, the preset correction script is mainly used to let users know which previous Q&A task the proactively provided "updated result" is for. On this basis, it can further let users know what the specific errors in the previously provided reply result were.
[0077] For example, if the server includes correction information for the response result in the output of the second agent, it indicates that the accuracy of the first agent's response result for the relevant question-and-answer task is insufficient and there is room for optimization. Therefore, the server can generate an updated result for the response result based on the correction information and preset correction scripts through the second agent and output the updated result to the user.
[0078] In this embodiment, after the second agent analyzes a set of question-and-answer tasks and response results and obtains correction information, it can output the updated results of the question-and-answer tasks to the user by combining the correction information with preset correction statements, so that the user can clearly know which previous question-and-answer task the updated results are for.
[0079] In an exemplary embodiment, the above steps of inputting the question-and-answer task and the response result into the second intelligent agent include: inputting the question-and-answer task and the response result into the second intelligent agent to drive the second intelligent agent to analyze the accuracy of the question-and-answer task and the response result based on a pre-configured knowledge base and a prompt word library, and obtain the analyzed output content.
[0080] Among them, the pre-configured knowledge base is a database or document collection that stores factual and structured information and serves as the "content source" for the agent to answer questions; the prompt word library is a collection that stores instructional and guiding text templates and is used to control the large language model, serving as the agent's "behavior controller".
[0081] The pre-configured prompt library can be a set of structured prompt templates pre-designed, organized, and stored by developers and / or domain experts. It guides the second agent to generate more accurate, reliable, and business-compliant answers for different question-and-answer tasks. The pre-configured prompt library can improve the accuracy and professionalism of the second agent's output for question-and-answer tasks.
[0082] For example, when the server inputs the question-and-answer task and response results processed by the first agent into the second agent, it can drive the second agent to perform an accuracy analysis on the received set of question-and-answer tasks and response results based on a pre-configured prompt word library, and obtain and output the analyzed output content through the accuracy results.
[0083] For example, if the second agent's analysis of the accuracy of a set of question-and-answer tasks and response results shows an accuracy equal to or higher than a preset accuracy, the corresponding output can be "End Process." This indicates that after analyzing and processing a set of question-and-answer tasks and response results, the second agent finds that the response results provided by the first agent currently have no room for optimization. Conversely, if the second agent's analysis of the accuracy of a set of question-and-answer tasks and response results shows an accuracy lower than a preset accuracy, the corresponding output can be relevant correction information. This indicates that after analyzing and processing a set of question-and-answer tasks and response results, the second agent finds that the response results provided by the first agent have room for optimization. The correction information is used to drive the second agent to generate updated results for the response results based on the correction information and preset correction scripts, and outputs the updated results to the user.
[0084] In this embodiment, by controlling the second agent to analyze the accuracy of question-and-answer tasks and response results based on a pre-configured prompt dictionary, it is beneficial to improve the accuracy and professionalism of the second agent's analysis of a set of question-and-answer tasks and response results. This allows the first and second agents to work together to quickly provide users with answers to question-and-answer tasks within a certain time period, while ensuring the accuracy of the answers provided. This improves the user experience of the question-and-answer system that includes both the first and second agents.
[0085] In an exemplary embodiment, after the second agent updates the response result in the above steps, the question-answering agent working method provided in this application further includes: if a similar task is received within a preset time period, inputting the similar task to the second agent; and outputting a response result for the similar task based on the second agent. The task processing capability of the second agent provided in this application can be higher than that of the first agent; that is, compared to the first agent, the second agent takes longer to process the same received question-answering task, but obtains a more accurate answer.
[0086] The preset time period can be set by the developer of the question-and-answer system, which includes both a first agent and a second agent, or it can be set by the user. This application does not limit this. The duration of the preset time period can be, for example, 3 minutes, 5 minutes, 10 minutes, 30 minutes, 1 hour, etc.
[0087] For example, if the server identifies that a user has asked a similar question-and-answer task within a preset time period, it means that the user is very likely not satisfied with the response results related to the previous question-and-answer task. In this case, in order to provide the user with a more accurate answer about the similar task, the server can choose to directly input the similar task into the second agent. The second agent, which has a higher task processing capability, will directly process and analyze the similar task and output the response result about the similar task.
[0088] In this embodiment, when a similar task to a question-and-answer task is received within a preset time period, the similar task can be directly processed and analyzed by a second intelligent agent with higher task processing capabilities. This ensures the accuracy of the response results about the similar task output to the user by the question-and-answer system, which includes the first and second intelligent agents, and also allows the user to experience the intelligence of the agents (the first and second intelligent agents), thereby improving the user experience.
[0089] In one exemplary embodiment, if the server detects that the number of times the same question-and-answer task is received exceeds a preset number within a preset time period, it inputs the question-and-answer task to a second agent; the second agent then outputs a response result for the similar task. The same question-and-answer task can refer to a question-and-answer task with a similarity greater than 95%, meaning that the same question-and-answer task does not necessarily need to be completely identical.
[0090] In an exemplary embodiment, if the server detects that a user has triggered a re-answer operation for a certain question-and-answer task within a preset time period, it inputs the question-and-answer task into a second intelligent agent; and the second intelligent agent outputs a response result for a similar task.
[0091] Both of the above-described embodiments can improve the accuracy of the responses to questions and answers from the question-and-answer system, allowing users to experience the intelligence of the agent and thus enhancing the user experience.
[0092] In an exemplary embodiment, after the second agent updates the response result in accordance with the above steps, the question-answering agent working method provided in this application further includes: if at least one of the question-answering task, response result and update result is identified within a preset time period, including preset keywords, the question-answering task is input to the second agent, and the output content of the second agent is waited for.
[0093] Among them, the preset keywords can be designed and organized in advance by developers and / or domain experts; they can be used to judge the importance and rigor of related questions and answers.
[0094] The specific duration of the preset time period can be set according to needs, such as within 30 minutes, 2 hours, 5 hours, or 1 day after the update results of a question-and-answer task are output to the user. This avoids situations where the user no longer needs the updated results for a particular question-and-answer task after a long period of time, and also avoids wasting data processing resources for the second intelligent agent.
[0095] For example, after the server outputs the updated response results to the user's second agent, if within a preset time period, the server identifies that at least one of a question-and-answer task and its related response and update results includes preset keywords, it indicates that the question-and-answer task is of very high importance and rigor in the relevant field, and it is necessary to ensure that the response and update results obtained by the user regarding the question-and-answer task are very accurate. Considering that the first and second agents are constantly being improved and updated to enhance their performance, the server can then input the question-and-answer task back into the second agent and wait for the output content from the second agent.
[0096] In this embodiment, if at least one of a question-and-answer task and its related response and update results is found to include preset keywords within a preset time period, the question-and-answer task is analyzed and processed again by a second intelligent agent to ensure that the user can get more accurate answers to the relevant question-and-answer task in a timely manner, thereby improving the user experience.
[0097] It should also be noted that this application uses preset keywords to assess the importance and rigor of relevant questions and answers because some researchers and technicians may use the question-answering agent working method provided in this application. In scientific and technical research, the requirements for the rigor and accuracy of technical answers are extremely high. In order to ensure that relevant researchers and technicians can obtain more accurate answers to the question-answering task as the second agent is continuously updated and improved, this application proposes the execution step of "when at least one of the question-answering task, response result, and update result is identified within a preset time period, including preset keywords, the question-answering task is input into the second agent, and the output content of the second agent is awaited."
[0098] In an exemplary embodiment, the above steps of inputting the question-and-answer task to the first intelligent agent and outputting the response result of the first intelligent agent to the question-and-answer task include: inputting the question-and-answer task to the first intelligent agent to drive the first intelligent agent to combine a pre-configured knowledge base and a prompt word library to output the response result of the first intelligent agent to the question-and-answer task.
[0099] For example, when the server inputs a question-and-answer task into the first agent, it can instruct the first agent to combine a pre-configured knowledge base and a prompt word library to process and analyze the received question-and-answer task in order to obtain a response result for the question-and-answer task, and output the response result to the user.
[0100] In this embodiment, the question-and-answer task is processed and analyzed by the knowledge base and prompt word library pre-configured by the first intelligent agent, which helps to improve the accuracy of the output response results.
[0101] Figure 3 This is a data flow diagram of a question-answering task processing system (question-answering system) provided in an embodiment of this application. Please refer to it. Figure 2 Reference Figure 3 The “main agent” is equivalent to the first intelligent agent, the “shadow agent” is equivalent to the second intelligent agent, and the “user query” is equivalent to the “question-answering task”.
[0102] Figure 3The diagram shows that the main agent receives user queries and, in conjunction with its pre-configured prompt word library (containing prompt words related to the user query) and knowledge base, generates an answer to the user query, which is then output to the user. Next, the dialogue management module collects user queries and corresponding answers and outputs them to the shadow agent. The shadow agent checks whether the main agent's answer to the user query is correct. If correct (yes), the process ends; if incorrect (no), it identifies errors in the answer, proposes improvements, and sends policy modification suggestions to the main agent's knowledge base. The shadow agent then regenerates the answer to the user query and, combined with proactive dialogue, outputs it to the user.
[0103] The Shadow Agent can integrate a large-scale error correction model, a large-scale answer generation model, and a large-scale prompt word optimization model.
[0104] Please continue to refer to Figure 3 The process connected to the main agent via a first arrow pattern is equivalent to the first process, and the process connected to the shadow agent via a second arrow pattern is equivalent to the second process. Based on this, in an exemplary embodiment, the above steps, upon receiving a question-and-answer task, input the question-and-answer task to the first agent and output the first agent's response to the question-and-answer task, include: upon receiving a question-and-answer task, inputting the question-and-answer task to the first agent based on the first process and outputting the first agent's response to the question-and-answer task; inputting the question-and-answer task and response to the second agent and receiving the output content of the second agent, and if the output content of the second agent includes policy improvement information, updating the first agent's knowledge base and prompt word library based on the policy improvement information, includes: inputting the question-and-answer task and response to the second agent based on the second process and receiving the output content of the second agent, and if the output content of the second agent includes policy improvement information, updating the first agent's knowledge base and prompt word library based on the policy improvement information.
[0105] In this embodiment, the asynchronous execution of tasks related to the first intelligent agent and tasks related to the second intelligent agent is achieved through the first process and the second process. This is equivalent to adopting a master-slave dual-intelligent agent asynchronous architecture design. By using the shadow agent (Agent) delayed startup strategy, the best balance between question-and-answer response speed, detection accuracy, and intelligence is achieved without affecting the interaction between the master intelligent agent and the user.
[0106] Specifically, the question-answering task processing system provided in this application is an agent self-correction system based on asynchronous processing, particularly suitable for multi-turn dialogue scenarios requiring a balance between response speed and answer accuracy. This technical solution primarily addresses the performance conflict between real-time reflection and post-event correction in existing agent systems. In other words, this application aims to provide an agent reflection mechanism that balances response speed and correction effectiveness, achieving systematic error detection through asynchronous processing while avoiding the latency issues associated with real-time reflection. Based on this, the question-answering agent working method provided in this application focuses not only on error correction in the current dialogue history but also on optimizing prompts, which helps to further improve the overall intelligence level of the agent.
[0107] Regarding the question-answering agent working method provided in this application, it can be combined with Figure 3 An exemplary implementation is provided as follows: The main agent receives the user's input "Who is Li Bai?" and outputs "Li Bai is an American poet"; then, the shadow agent receives "Who is Li Bai?" and "Li Bai is an American poet", and obtains "Li Bai is not American, but Chinese" based on the error correction model. Then, it combines the answer generation model and proactive dialogue generation to generate and output to the user "Sorry, there was a problem with my answer just now. Li Bai is not American, but a great poet of the Tang Dynasty in ancient China"; before the main agent receives the output "Sorry, there was a problem with my answer just now. Li Bai is not American, but a great poet of the Tang Dynasty in ancient China" from the shadow agent, the main agent may also perform a question-and-answer session, for example, receiving the user's input "What day of the week is it today?" and outputting "Today is Sunday".
[0108] In summary, the question-answering intelligent agent working method provided in this application adopts a dual-agent asynchronous architecture design. Specifically, it employs a process isolation architecture between the main agent and the shadow agent to achieve physical isolation between dialogue interaction and error detection. Its unique dynamic triggering mechanism includes three triggering conditions: dialogue round threshold, high-risk keywords, and user signals. The technology of accurately associating timestamps and dialogue IDs in the shared storage area can solve the problem of timing disorder in asynchronous processing. Compared with related technologies, most solutions in related technologies adopt single-dimensional detection (such as fact-checking only) or qualitative judgment (such as rule matching). This system focuses on error correction in the current dialogue history and also pays attention to the optimization of prompt words, further improving the overall intelligence level of the intelligent agent.
[0109] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0110] Based on the same inventive concept, this application also provides a question-answering agent working device for implementing the question-answering agent working method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more question-answering agent working device embodiments provided below can be found in the limitations of the question-answering agent working method above, and will not be repeated here.
[0111] In one exemplary embodiment, such as Figure 4 As shown, a question-answering intelligent agent working device 400 is provided. The question-answering intelligent agent includes a first intelligent agent and a second intelligent agent that communicate with each other. The device includes: a first question-answering module 41, a second question-answering module 42, and a feedback optimization module 43, wherein:
[0112] The first question-and-answer module 41 is used to input the question-and-answer task into the first intelligent agent when a question-and-answer task is received, and to output the response result of the first intelligent agent to the question-and-answer task.
[0113] The second question-and-answer module 42 is used to input the question-and-answer task and the response result into the second intelligent agent, and to receive the output content of the second intelligent agent;
[0114] The feedback optimization module 43 is used to update the knowledge base and prompt word library of the first agent based on the policy improvement information when the output of the second agent includes policy improvement information.
[0115] In an exemplary embodiment, the feedback optimization module 43 is further configured to output an updated result of the second agent for the response result if the output content of the second agent includes correction information for the response result.
[0116] In an exemplary embodiment, the feedback optimization module 43 is used to output an updated result of the second intelligent agent for the response result when the output content of the second intelligent agent includes correction information for the response result. Specifically, it is used to output an updated result of the second intelligent agent for the response result generated by the second intelligent agent based on the correction information and preset correction script when the output content of the second intelligent agent includes correction information for the response result.
[0117] In an exemplary embodiment, the second question-answering module 42 is used to input the question-answering task and the response result into the second intelligent agent. Specifically, it is used to input the question-answering task and the response result into the second intelligent agent to drive the second intelligent agent to analyze the accuracy of the question-answering task and the response result based on a pre-configured knowledge base and prompt word library, and obtain the analyzed output content.
[0118] In an exemplary embodiment, after the feedback optimization module 43 outputs the updated result of the second agent in response to the reply result, the second question-answering module 42 is further configured to input the similar task to the second agent when a similar task is received within a preset time period; wherein, the task processing capability of the second agent is higher than that of the first agent; the feedback optimization module 43 is further configured to output the reply result for the similar task based on the second agent.
[0119] In an exemplary embodiment, after the feedback optimization module 43 outputs the updated result of the second agent in response to the reply result, it is further configured to: if at least one of the question-and-answer task, reply result and update result is identified within a preset time period, including preset keywords, input the question-and-answer task to the second agent, and wait for the output content of the second agent.
[0120] In an exemplary embodiment, the first question-answering module 41 is used to input the question-answering task to the first intelligent agent and output the response result of the first intelligent agent to the question-answering task when a question-answering task is received. Specifically, it is used to: input the question-answering task to the first intelligent agent based on the first process when a question-answering task is received, and output the response result of the first intelligent agent to the question-answering task; the feedback optimization module 43 is used to input the question-answering task and the response result to the second intelligent agent and receive the output content of the second intelligent agent. If the output content of the second intelligent agent includes policy improvement information, it updates the knowledge base and prompt word library of the first intelligent agent based on the policy improvement information. Specifically, it is used to: input the question-answering task and the response result to the second intelligent agent based on the second process and receive the output content of the second intelligent agent. If the output content of the second intelligent agent includes policy improvement information, it updates the knowledge base and prompt word library of the first intelligent agent based on the policy improvement information.
[0121] Each module in the aforementioned question-answering intelligent agent working device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0122] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as question-and-answer tasks, response results, correction information, and update results. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a question-and-answer intelligent agent working method.
[0123] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0124] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0125] Upon receiving a question-and-answer task, the task is input into the first agent, and the first agent's response to the question-and-answer task is output.
[0126] Input the question-and-answer task and the response results into the second intelligent agent, and receive the output of the second intelligent agent;
[0127] If the output of the second agent includes policy improvement information, the knowledge base and prompt word library of the first agent are updated based on the policy improvement information.
[0128] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0129] Upon receiving a question-and-answer task, the task is input into the first agent, and the first agent's response to the question-and-answer task is output.
[0130] Input the question-and-answer task and the response results into the second intelligent agent, and receive the output of the second intelligent agent;
[0131] If the output of the second agent includes policy improvement information, the knowledge base and prompt word library of the first agent are updated based on the policy improvement information.
[0132] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0133] Upon receiving a question-and-answer task, the task is input into the first agent, and the first agent's response to the question-and-answer task is output.
[0134] Input the question-and-answer task and the response results into the second intelligent agent, and receive the output of the second intelligent agent;
[0135] If the output of the second agent includes policy improvement information, the knowledge base and prompt word library of the first agent are updated based on the policy improvement information.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0137] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0138] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0139] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for operating a question-answering intelligent agent, characterized in that, The question-answering agent includes a first agent and a second agent for communication, and the method includes: Upon receiving a question-and-answer task, the question-and-answer task is input into the first intelligent agent, and the response result of the first intelligent agent to the question-and-answer task is output. The question-and-answer task and the response results are input to the second intelligent agent, and the output of the second intelligent agent is received. If the output of the second agent includes policy improvement information, the knowledge base and prompt word base of the first agent are updated based on the policy improvement information.
2. The method according to claim 1, characterized in that, The method further includes: If the output of the second agent includes correction information for the response result, the second agent outputs an updated result for the response result.
3. The method according to claim 2, characterized in that, When the output of the second agent includes correction information for the response result, the updated result of the second agent for the response result is output, including: If the output of the second agent includes correction information for the response result, the second agent outputs an updated result for the response result generated by the second agent based on the correction information and a preset correction script.
4. The method according to claim 2, characterized in that, After outputting the updated result of the second agent in response to the reply, the method further includes: If a similar task to the question-and-answer task is received within a preset time period, the similar task is input to the second intelligent agent; wherein the task processing capability of the second intelligent agent is higher than that of the first intelligent agent. The second agent outputs a response result for the similar task.
5. The method according to claim 2, characterized in that, After outputting the updated result of the second agent in response to the reply, the method further includes: If at least one of the question-and-answer task, the response result, and the update result is identified within a preset time period, including a preset keyword, the question-and-answer task is input to the second intelligent agent, and the output content of the second intelligent agent is awaited.
6. The method according to claim 1, characterized in that, The step of inputting the question-and-answer task and the response result into the second intelligent agent includes: The question-and-answer task and the response result are input into the second intelligent agent, which then analyzes the accuracy of the question-and-answer task and the response result based on a pre-configured knowledge base and prompt word library, and obtains the analyzed output content.
7. The method according to claim 1, characterized in that, Upon receiving a question-and-answer task, the step of inputting the question-and-answer task into a first intelligent agent and outputting the first intelligent agent's response to the question-and-answer task includes: Upon receiving a question-and-answer task, the question-and-answer task is input to the first intelligent agent based on the first process, and the response result of the first intelligent agent to the question-and-answer task is output. The question-and-answer task and the response result are input to the second agent, and the output of the second agent is received. If the output of the second agent includes policy improvement information, the knowledge base and prompt word library of the first agent are updated based on the policy improvement information, including: The question-and-answer task and the response result are input to the second agent through the second process, and the output of the second agent is received. If the output of the second agent includes policy improvement information, the knowledge base and prompt word library of the first agent are updated based on the policy improvement information.
8. A question-answering intelligent agent working device, characterized in that, The question-answering agent includes a first agent and a second agent for communication; the device includes: The first question-and-answer module is used to input the question-and-answer task into the first intelligent agent when a question-and-answer task is received, and to output the response result of the first intelligent agent to the question-and-answer task. The second question-and-answer module is used to input the question-and-answer task and the response result into the second intelligent agent, and to receive the output content of the second intelligent agent; The feedback optimization module is used to update the knowledge base and prompt word library of the first agent based on the policy improvement information when the output content of the second agent includes policy improvement information.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.