Assistant dialogue response method and device, equipment and storage medium
By generating and updating metadata of dynamic context in the assistant dialogue system, the problems of information coherence and focus in long conversations are solved, the accuracy and coherence of assistant responses are achieved, and the user experience is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING PROSBOR INVESTMENT CONSULTING CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-09
AI Technical Summary
Existing assistant dialogue systems struggle to maintain the coherence, consistency, and focus of information during long conversations. This is mainly because static context mechanisms cannot reflect the dynamic changes in the dialogue process, or sliding window mechanisms cause the loss of key information in the early stages, leading to assistant responses deviating from the main thread.
By generating metadata at the end of each round of dialogue, updating the dynamic context of the previous round of dialogue, including strategic, focus, and memory layer information, and generating assistant responses based on the latest metadata and historical dialogues, the system ensures the persistent memory of key information.
It improves the accuracy of assistant responses, maintains the coherence and focus of information in long conversations, avoids focus drift, and enhances the user experience.
Smart Images

Figure CN122173602A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to an assistant dialogue response method, apparatus, device and storage medium. Background Technology
[0002] Assistant dialogue systems are widely used in the information technology industry, especially in the form of mobile applications for smartphones and tablets. Assistant dialogue systems can include computer-based agents with human-centered interfaces for accessing, processing, managing, and delivering information. Currently, assistant dialogue systems interact with their users using natural language to simulate intelligent conversations and provide personalized assistance. With the increasing application of large language models in dialogue systems and intelligent assistants, context management in long conversations and multi-turn interactions has become a key bottleneck affecting user experience.
[0003] Currently, mainstream large language models manage context in two main ways: one is by using static prompt words, and the other is by using a fixed-length long context window. Existing methods struggle to maintain the coherence, consistency, and focus of information in continuous dialogue. Summary of the Invention
[0004] This application provides an assistant dialogue response method, apparatus, device, and storage medium. By updating the dynamic context of the dialogue, it enables persistent memory of key information in long dialogues, thereby improving the accuracy of the generated assistant responses.
[0005] In a first aspect, embodiments of this application provide an assistant dialogue response method, the method comprising: At the end of the Nth round of dialogue, metadata for the Nth round of dialogue is generated; the metadata for any round of dialogue includes a summary of the current round of dialogue and an assessment of the impact of the current round of dialogue on the dynamic context; based on the metadata of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue is updated to obtain the dynamic context of the Nth round of dialogue; in response to user input in the N+1th round of dialogue, an assistant response in the N+1th round of dialogue is generated based on the dynamic context of the Nth round of dialogue, the historical dialogues in the dialogue window, and the corresponding metadata.
[0006] Using the above method, the dynamic context of the (N-1)th round of dialogue is updated based on the metadata of the Nth round of dialogue to obtain the dynamic context of the Nth round of dialogue. In response to the user input in the N+1th round of dialogue, the assistant's response in the N+1th round of dialogue is generated based on the dynamic context of the Nth round of dialogue, the historical dialogue in the dialogue window, and the corresponding metadata. In this way, by updating the dynamic context of the dialogue, the persistent memory of key information in long dialogues is achieved, thereby improving the accuracy of the generated assistant responses.
[0007] In one alternative implementation, the dynamic context of any round of dialogue includes strategic layer information and focus layer information; the strategic layer information is used to record key information of the entire dialogue; the focus layer information is used to record key information of the current dialogue. Based on the metadata of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue is updated, including: Based on the strategic layer influence in the metadata of the Nth round of dialogue, update the strategic layer information in the dynamic context of the (N-1)th round of dialogue; based on the focus layer continuity in the metadata of the Nth round of dialogue, update the focus layer information in the dynamic context of the (N-1)th round of dialogue.
[0008] Using the above method, the dynamic context of any round of dialogue includes strategic layer information and focus layer information. By updating the strategic layer information and focus layer information, the dynamic context used in each round of dialogue includes key information of the entire dialogue and key information of the current dialogue, thereby improving the accuracy of the assistant's response generated in each round of dialogue.
[0009] In one optional implementation, the dynamic context of any round of dialogue further includes memory layer information; the memory layer information is used to record key information of historical dialogues beyond the dialogue window; the method further includes: If, at the end of the Nth round of dialogue, there are more historical dialogues to be discarded than the dialogue window, then the key information of the historical dialogues to be discarded is determined; based on the key information of the historical dialogues to be discarded, the memory layer information of the dynamic context of the (N-1)th round of dialogue is updated.
[0010] Using the above method, when there are historical dialogues to be discarded that exceed the dialogue window, key information is extracted from the historical dialogues to be discarded, and the memory layer information of the dynamic context is updated based on the key information to achieve persistent memory of key information. This avoids the loss of key information caused by directly discarding historical information, which could lead to "focus drift" and the corresponding assistant response deviating from the main line.
[0011] In one optional implementation, the metadata of any round of dialogue further includes at least one of the following: metrics for this round of dialogue, semantic vector for this round of dialogue, entity objects for this round of dialogue, and topic for this round of dialogue; wherein, the metrics for this round of dialogue include usefulness, focus, and confidence, wherein usefulness is used to describe the degree to which this round of dialogue contributes to achieving the dialogue goal, focus is used to describe the closeness of this round of dialogue to the current topic, and confidence is used to describe the accuracy of the summary content of this round of dialogue; The assessment of the impact of this round of dialogue on the dynamic context includes strategic-level impact, focus continuity, and memory-level association. The strategic-level impact represents the influence of this round of dialogue on strategic-level information. The focus continuity represents the continuity of this round of dialogue with the current topic. The memory-level association represents the association between this round of dialogue and memory-level information.
[0012] In one alternative implementation, before updating the dynamic context of the (N-1)th round of dialogue, the method further includes: The metadata of the Nth round of dialogue is determined to meet preset conditions, which include at least one of the following: the focus continuity in the metadata of the Nth round of dialogue is a new direction, the topic in the metadata of the Nth round of dialogue has changed, the semantic vector in the metadata of the Nth round of dialogue is lower than a first preset threshold, the strategic layer influence representation in the metadata of the Nth round of dialogue has an influence, and the dynamic context of consecutive predetermined rounds has not changed.
[0013] By using the above method, the metadata of the Nth round of dialogue is judged. When it meets the preset conditions, the dynamic context of the (N-1)th round of dialogue is updated. When it does not meet the preset conditions, the dynamic context of the (N-1)th round of dialogue is updated. The dynamic context of the (N-1)th round of dialogue is directly used as the dynamic context of the Nth round of dialogue. In this way, the efficiency of generating dynamic context can be improved.
[0014] In one optional implementation, generating the metadata for the Nth round of dialogue includes: The user input of the Nth round of dialogue, the assistant response of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue, the historical dialogues in the dialogue window, and the corresponding metadata are input into the large language model, and the metadata of the Nth round of dialogue is generated based on the prompt words; the historical dialogues in the dialogue window are the latest M rounds of dialogues before the Nth round, and the metadata corresponding to the historical dialogues in the dialogue window are the M metadata corresponding to the latest M rounds of dialogues.
[0015] In one optional implementation, the memory layer information of the dynamic context of the (N-1)th round of dialogue is updated based on the key information of the historical dialogue to be discarded, including: Extract information with long-term value from the historical dialogue to be discarded as key information of the historical dialogue to be discarded; perform deduplication and condensation processing on the key information of the historical dialogue to be discarded to obtain a condensed summary corresponding to the historical dialogue to be discarded; determine the relevance degree of the condensed summary based on its relevance to the entire dialogue; add the condensed summary and its relevance degree to the memory layer information of the dynamic context of the (N-1)th round of dialogue.
[0016] By using the above method, extracting information with long-term value from the historical dialogue to be discarded as key information can improve the accuracy of key information in the historical dialogue to be discarded. Based on the correlation between the condensed summary and the entire dialogue, the correlation degree of the condensed summary is determined. The correlation degree of the condensed summary is used to characterize the condensed summary. Adding the condensed summary and its correlation degree to the memory layer information of the dynamic context of the N-1th round of dialogue can improve the accuracy of updating the memory layer information of the dynamic context of the N-1th round of dialogue.
[0017] Secondly, embodiments of this application provide an assistant dialogue response device, the device comprising: The generation module is used to generate metadata for the Nth round of dialogue at the end of the Nth round of dialogue; the metadata for any round of dialogue includes a summary of the current round of dialogue and an assessment of the impact of the current round of dialogue on the dynamic context; The update module is used to update the dynamic context of the (N-1)th round of dialogue based on the metadata of the Nth round of dialogue, so as to obtain the dynamic context of the Nth round of dialogue. The processing module is used to respond to user input in the N+1th round of dialogue and generate assistant responses in the N+1th round of dialogue based on the dynamic context of the Nth round of dialogue, the historical dialogues in the dialogue window, and the corresponding metadata.
[0018] In one optional implementation, the dynamic context of any round of dialogue includes strategic layer information and focus layer information; the strategic layer information is used to record key information of the entire dialogue; the focus layer information is used to record key information of the current dialogue; the update module is specifically used to update the strategic layer information in the dynamic context of the (N-1)th round of dialogue based on the strategic layer influence in the metadata of the Nth round of dialogue; and to update the focus layer information in the dynamic context of the (N-1)th round of dialogue based on the focus layer continuity in the metadata of the Nth round of dialogue.
[0019] In one optional implementation, the dynamic context of any round of dialogue further includes memory layer information; the memory layer information is used to record key information of historical dialogues that exceed the dialogue window, and the update module is further used to determine the key information of the historical dialogues to be discarded if there are historical dialogues to be discarded that exceed the dialogue window when the Nth round of dialogue ends; and update the memory layer information of the dynamic context of the (N-1)th round of dialogue according to the key information of the historical dialogues to be discarded.
[0020] In one optional implementation, the metadata of any round of dialogue further includes at least one of the following: metrics for this round of dialogue, semantic vector for this round of dialogue, entity objects for this round of dialogue, and topic for this round of dialogue; wherein, the metrics for this round of dialogue include usefulness, focus, and confidence, wherein usefulness is used to describe the degree to which this round of dialogue contributes to achieving the dialogue goal, focus is used to describe the closeness of this round of dialogue to the current topic, and confidence is used to describe the accuracy of the summary content of this round of dialogue; The assessment of the impact of this round of dialogue on the dynamic context includes strategic-level impact, focus continuity, and memory-level association. The strategic-level impact represents the influence of this round of dialogue on strategic-level information. The focus continuity represents the continuity of this round of dialogue with the current topic. The memory-level association represents the association between this round of dialogue and memory-level information.
[0021] In an optional implementation, the apparatus further includes a determining module, which is used to determine that the metadata of the Nth round of dialogue meets preset conditions, the preset conditions including at least one of the following: the focus continuity in the metadata of the Nth round of dialogue is a new direction, the topic in the metadata of the Nth round of dialogue has changed, the semantic vector in the metadata of the Nth round of dialogue is lower than a first preset threshold, the strategic layer influence representation in the metadata of the Nth round of dialogue has an influence, and the dynamic context of consecutive predetermined rounds has not changed.
[0022] In one optional implementation, the generation module is specifically used to input the user input of the Nth round of dialogue, the assistant response of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue, the historical dialogue in the dialogue window, and the corresponding metadata into a large language model, and generate the metadata of the Nth round of dialogue based on the prompt words; the historical dialogue in the dialogue window is the latest M rounds of dialogue before the Nth round, and the metadata corresponding to the historical dialogue in the dialogue window is the M metadata corresponding to the latest M rounds of dialogue.
[0023] In an optional implementation, the update module is further configured to extract information with long-term value from the discarded historical dialogue as key information of the discarded historical dialogue; perform deduplication and condensation processing on the key information of the discarded historical dialogue to obtain a condensed summary corresponding to the discarded historical dialogue; determine the relevance degree of the condensed summary based on its relevance to the entire dialogue; and add the condensed summary and its relevance degree to the memory layer information of the dynamic context of the (N-1)th round of dialogue.
[0024] Thirdly, embodiments of the present invention provide an assistant dialogue response device, the device comprising: a memory for storing computer programs; and a processor for executing the method described in the first aspect according to the obtained program when executing the computer program stored in the memory.
[0025] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, wherein when a computer reads and executes the computer program, the method described in the first aspect is performed.
[0026] Fifthly, embodiments of the present invention provide a computer program product that, when read and executed by a computer, causes the method described in the first aspect to be executed. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A schematic diagram of an assistant dialogue response system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating an assistant response method provided in an embodiment of this application. Figure 3 A flowchart illustrating the method for updating the memory layer information of the dynamic context of the N-1th round of dialogue provided in this application; Figure 4 A schematic diagram illustrating the internal implementation flow of the assistant dialogue response device provided in this application embodiment; Figure 5 This is a schematic diagram of the structure of the assistant dialogue response device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of an assistant dialogue response device provided in an embodiment of this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] Based on the exemplary embodiments shown in this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application. Furthermore, although the disclosures in this application are presented by way of one or more exemplary examples, it should be understood that each aspect of these disclosures can constitute a complete technical solution on its own.
[0031] Before introducing the assistant dialogue response method provided in the embodiments of this application, the background technology of the embodiments of this application will be introduced in detail for ease of understanding.
[0032] With the increasing application of large language models in dialogue systems, intelligent assistants and other scenarios, context management in long dialogues and multi-turn interactions has become a key bottleneck affecting user experience.
[0033] Currently, mainstream large language models manage context primarily through two methods. Method one uses a static context mechanism, setting a fixed system instruction as the context during dialogue initialization. This context remains unchanged throughout subsequent dialogue rounds. However, because it uses a static context, it fails to reflect dynamic changes in topics, intentions, or context during the dialogue process, thus affecting dialogue depth and coherence. This results in the generated assistant responses failing to address the core issues input by the user. Method two adds the content of each dialogue round to the context of that round to generate the context for the next round. As the number of dialogue rounds increases, the context length can become excessive. Therefore, Method two typically employs a sliding window truncation mechanism. By setting a fixed context length, when the context length exceeds this limit, the excess dialogue is discarded from the current context. This means the context for the next round includes the most recent M rounds of dialogue. Directly discarding the excess dialogue leads to the loss of early key information, easily causing "focus drift," where the corresponding assistant responses deviate from the main thread.
[0034] Based on this, this application provides a method for assistant dialogue response. Based on the metadata of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue is updated to obtain the dynamic context of the Nth round of dialogue. In response to user input in the N+1th round of dialogue, the assistant response in the N+1th round of dialogue is generated based on the dynamic context of the Nth round of dialogue, the historical dialogue in the dialogue window, and the corresponding metadata. In this way, by updating the dynamic context of the dialogue, the persistent memory of key information in long dialogues is achieved, improving the accuracy of the generated assistant response.
[0035] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of this application are applicable. It should be noted that the application scenarios described below are only for illustrating the embodiments of this application and are not intended to limit the scope. In specific implementation, the technical solutions provided by the embodiments of this application can be flexibly applied according to actual needs.
[0036] Figure 1 An exemplary schematic diagram of an assistant dialogue response system provided in an embodiment of this application is shown, such as... Figure 1 As shown, the system includes at least one terminal device 101 and at least one server 102. The terminal device 101 can be a mobile phone, tablet computer, laptop computer, desktop computer, etc., but is not limited to these. A client related to the assistant dialogue response method can be installed on the terminal device 101. The client can be software (such as a browser, instant messaging software, etc.), or a webpage, mini-program, etc. In this embodiment, the user can use the client related to the assistant dialogue response method on the terminal device 101 to upload user input for the current round of dialogue, and transmit the user input to the server 102 for analysis.
[0037] Furthermore, server 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. In this embodiment, the server 102 may be equipped with an assistant dialogue response device corresponding to the client, used to process user input initiated by the user on the client related to the assistant dialogue response method on the terminal device 101 in the current round of dialogue. According to the method provided in this embodiment, the server 102 responds to the user input in the current round of dialogue, generates an assistant response in the current round of dialogue based on the dynamic context of the previous round of dialogue, the historical dialogue in the dialogue window, and the corresponding metadata. The server 102 sends the generated assistant response to the current round of dialogue to the client related to the assistant dialogue response method on the terminal device 101, and displays the generated assistant response to the user on the client. At the end of the current round of dialogue, the server 102 generates metadata for the current round of dialogue. The metadata of any round of dialogue includes a summary of the current round of dialogue and an assessment of the impact of the current round of dialogue on the dynamic context. Based on the metadata of the current round of dialogue, the server 102 updates the dynamic context of the previous round of dialogue to obtain the dynamic context of the current round of dialogue. The context of the current round of dialogue is used in the next round of dialogue. In this way, by updating the dynamic context of the dialogue, persistent memory of key information in long dialogues is achieved, improving the accuracy of the generated assistant responses.
[0038] In some scenarios, terminal device 101 can access the network and communicate with server 102 through cellular mobile communication technology, which may include 5th generation mobile networks (5G) technology.
[0039] In other scenarios, terminal device 101 can access the network and communicate with server 102 via short-range wireless communication, which may include Wireless Fidelity (Wi-Fi) technology.
[0040] It should be noted that, Figure 1 The examples shown are merely illustrative; in reality, the number of terminal devices 101 and servers 102 is not limited and is not specifically limited in this embodiment.
[0041] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation steps as shown in the following embodiments or drawings, the method may include more or fewer operation steps based on conventional or non-inventive methods. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the device executes the method, it may be executed in the order shown in the embodiments or drawings, or in combination.
[0042] Figure 2 This is a flowchart illustrating an assistant response method provided in an embodiment of this application. This process can be executed by an assistant dialogue response device, such as... Figure 1 The assistant dialogue response device mounted on the server 102 is used to improve the accuracy of the generated assistant responses. For example... Figure 2 As shown, the process includes the following steps: Step 201: When the Nth round of dialogue ends, the assistant dialogue response device generates metadata for the Nth round of dialogue.
[0043] For example, the assistant dialogue response device inputs the user input of the Nth round of dialogue, the assistant's response of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue, the historical dialogues within the dialogue window, and the corresponding metadata into a large language model, and generates metadata for the Nth round of dialogue based on prompt words. The historical dialogues within the dialogue window are the latest M rounds of dialogue prior to the Nth round, and the metadata corresponding to the historical dialogues within the dialogue window are the M metadata items corresponding to the latest M rounds of dialogue. For example, assuming N is 10 and M is 4, the historical dialogues within the dialogue window include the 6th, 7th, 8th, and 9th rounds of dialogue, and the metadata corresponding to the historical dialogues within the dialogue window includes the metadata of the 6th, 7th, 8th, and 9th rounds of dialogue. The prompt words in the metadata generated for the Nth round of dialogue based on prompt words could be: "You are a professional dialogue analysis engine, responsible for evaluating the value of each round of dialogue and generating structured metadata." This metadata will serve as the core basis for optimizing the system context and maintaining dialogue coherence and focus. The metadata for any round of dialogue includes a summary of the dialogue and an assessment of the impact of the dialogue on the dynamic context. The dynamic context of any round of dialogue includes strategic information, focus information, and memory information.
[0044] Optionally, the metadata for any round of dialogue may also include at least one of the following: metrics for this round of dialogue, semantic vectors for this round of dialogue, entity objects for this round of dialogue, and topic for this round of dialogue; wherein, the metrics for this round of dialogue include usefulness, focus, and confidence. Usefulness describes the degree to which this round of dialogue contributes to achieving the dialogue objective, focus describes the closeness of this round of dialogue to the current topic, and confidence describes the accuracy of the summary content of this round of dialogue. The assessment of the impact of this round of dialogue on the dynamic context includes strategic-level impact, focus continuity, and memory-level association; strategic-level impact characterizes the impact of this round of dialogue on strategic-level information; focus continuity characterizes the continuity of this round of dialogue to the current topic; and memory-level association characterizes the association between this round of dialogue and memory-level information. Table 1 shows an example of the metadata for any round of dialogue. Table 1: Examples of metadata for any round of dialogue
[0045] It can be seen that the summary content in the metadata of any round of dialogue is determined based on the core key information extracted from this round of dialogue; the topic type of this round of dialogue in the metadata is a tag, used to determine the focus topic. For example, by judging the similarity between the topic tag of this round of dialogue and the topic tag of the previous round of dialogue, it is determined whether there is a focus shift in this round of dialogue; the entity object type in the metadata is a text array, used to extract specific information such as named entities, time, location, and numbers that are crucial to understanding this round of dialogue; the strategic layer impact type in the impact assessment of the dynamic context in the metadata is a Boolean value, representing the impact of this round of dialogue on strategic layer information. For example, when the strategic layer impact value of this round of dialogue is determined to be true, the strategic layer content in the dynamic context needs to be updated; the metadata's impact on the dynamic context... The focus continuity type in the impact assessment of dynamic context is enumerated, including strong continuity, weak continuity, and new direction, representing the continuity of the current conversation with the current topic. The memory layer association type in the impact assessment of dynamic context in metadata is a Boolean value, representing the association between the current conversation and memory layer information. For example, when the memory layer association value is true, it indicates that there is an association between the current conversation and memory layer information, that is, it is strongly related to the summary content of one or more historical conversations. In this case, the metadata of the current conversation also includes a memory layer association description, which is text and used to describe the association points between the current conversation and memory layer information. When the memory layer association value is false, it indicates that there is no association between the current conversation and memory layer information.
[0046] The following is an example of generating metadata for the Nth round of dialogue:
[0047] For example, suppose this is the 12th round of dialogue, and the historical dialogues within the dialogue window include the 10th and 11th rounds. The metadata corresponding to these historical dialogues includes the metadata of the 10th and 11th rounds. In this case, the input for generating the metadata for the 12th round of dialogue using a large language model includes: ##This round of dialogue The user input in the 12th round of dialogue: "The meeting is scheduled for 10:00 AM on the third day, at the 18th floor of Tower A, China World Trade Center." The assistant responded in the 12th round of dialogue: "Okay, noted: The meeting on the last day will be held at 10:00 AM on the 18th floor of Tower A, China World Trade Center." ## The dynamic context used in this round of dialogue (i.e., the dynamic context of the 11th round of dialogue) Strategic information in the dynamic context of the 11th round of dialogue: "Arrange a 3-day business trip to Beijing for the user. Time is tight, and all arrangements need to be completed efficiently." The focus-level information in the dynamic context of the 11th round of dialogue: "The details of the meeting on the morning of the third day are currently being arranged." The memory layer information in the dynamic context of the 11th round of dialogue: "The user needs to stay in Beijing for 3 days", "The user needs to book a high-speed rail ticket from Shanghai to Beijing", "The user requires a five-star hotel with convenient transportation".
[0048] ##History of conversations in the dialog window
[0049] Round 10 of the dialogue: User inputs: "There's an important client meeting on the morning of the third day, which needs to be arranged." Assistant responds: "Okay, please tell me the specific time and location requirements for the meeting."
[0050] Round 11 of dialogue: User inputs: "The meeting is roughly on the morning of the third day, the time is not yet confirmed, the location needs to be near the China World Trade Center." Assistant responds: "Understood, I will keep an eye out for meeting room resources near the China World Trade Center, please confirm the time as soon as possible."
[0051] ## Metadata of historical conversations within the dialog window
[0052] Round 10 metadata:
[0053] Round 11 metadata:
[0054] Generate metadata for the 12th round of dialogue:
[0055] Step 202: The assistant dialogue response device updates the dynamic context of the (N-1)th round of dialogue based on the metadata of the Nth round of dialogue to obtain the dynamic context of the Nth round of dialogue.
[0056] For example, the dynamic context of any round of dialogue includes strategic layer information and focus layer information, wherein strategic layer information is used to record key information of the entire dialogue, and focus layer information is used to record key information of the current dialogue.
[0057] Based on the metadata of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue is updated, including: Based on the strategic layer influence in the metadata of the Nth round of dialogue, update the strategic layer information in the dynamic context of the N-1th round of dialogue; based on the focus layer continuity in the metadata of the Nth round of dialogue, update the focus layer information in the dynamic context of the N-1th round of dialogue.
[0058] Specifically, when the assistant dialogue response device determines that the strategic layer influence in the metadata of the Nth round of dialogue is true, it updates the strategic layer information in the dynamic context of the (N-1)th round of dialogue based on the Nth round of dialogue, its corresponding metadata, and the strategic layer information in the dynamic context of the Nth round of dialogue, thus obtaining the strategic layer information in the dynamic context of the Nth round of dialogue. The strategic layer information in the dynamic context of the Nth round of dialogue can be input into a large language model. The large language model analyzes the input information, including: strategic layer information validity assessment and information integrity check. Based on the analysis results, it updates the strategic layer information in the dynamic context of the (N-1)th round of dialogue, thus obtaining the strategic layer information in the dynamic context of the Nth round of dialogue. When the assistant dialogue response device determines that the focus layer continuity in the metadata of the Nth round of dialogue is a new direction, it updates the focus layer information in the dynamic context of the (N-1)th round of dialogue based on the Nth round of dialogue, its corresponding metadata, and the focus layer information in the dynamic context of the Nth round of dialogue, thus obtaining the focus layer information in the dynamic context of the Nth round of dialogue. The focus layer information in the dynamic context of the Nth round of dialogue, the corresponding metadata of the Nth round of dialogue, and the focus layer information in the dynamic context of the Nth round of dialogue can be input into the large language model. The large language model analyzes the input information, including: accuracy assessment of focus layer information and information integrity check. Based on the above analysis results, the focus layer information in the dynamic context of the N-1th round of dialogue is updated to obtain the focus layer information in the dynamic context of the Nth round of dialogue.
[0059] The assessment of the effectiveness of strategic-level information includes: determining whether the current strategic-level information accurately reflects the overall goals of the dialogue; determining whether new long-term goals, user preferences, or constraints have emerged; and determining whether there is important information that is not covered by the current strategic-level information but requires attention. The assessment of the accuracy of focus-level information includes: determining whether the current focus-level information accurately reflects the core topics being discussed by users; determining whether new topics have emerged or old topics have ended; and determining whether there are multiple topics intertwined and requiring special handling. The information integrity check includes: checking for missing, ambiguous, or conflicting key information; and checking whether there is relevant information in the memory layer that needs to be incorporated into current considerations.
[0060] The corresponding output example is:
[0061] For example, suppose the current dialogue is the 9th round, and the historical dialogues within the dialogue window are the 7th and 8th rounds. The metadata for these historical dialogues within the dialogue window consists of the metadata for the 7th and 8th rounds. In the metadata for the 9th round, the strategic layer influence is set to true, and the focus layer continuity is set to a new direction. Therefore, the strategic layer and focus layer information in the dynamic context of the 8th round need to be updated. Input information includes: ## The dynamic context used in the 9th round of dialogue (i.e., the dynamic context of the 8th round of dialogue) Strategic level information: "Plan an efficient business trip to Beijing, focusing on meeting arrangements and travel efficiency." Focus layer information: "Discussions are underway regarding the client visit arrangements for the following afternoon." Memory layer information: "The user will stay in Beijing for 3 days," "A hotel near Wangfujing has been booked," "There is an internal company meeting on the first morning." ## Round 9 of Dialogue The user typed: "Let's postpone the visit on the afternoon of the second day. I just received notification that a government symposium will be added on the third day, which is more important." The assistant replied, "Understood, priority adjusted. Please inform me of the specific requirements and time for the government meeting." ##Historical conversations and corresponding metadata The 7th round of dialogue, metadata of the 7th round of dialogue, the 8th round of dialogue, metadata of the 8th round of dialogue.
[0062] Output content:
[0063] The strategic information in the dynamic context of the 9th round of dialogue is: "Prioritize the important government symposium on the third day, and determine the time, location, agenda, and participation requirements." The focus information in the dynamic context of the 9th round of dialogue is: "Prioritize the important government symposium on the third day, and determine the time, location, agenda, and participation requirements."
[0064] In an optional embodiment, the dynamic context of any round of dialogue further includes memory layer information; the memory layer information is used to record key information of historical dialogues beyond the dialogue window; the method further includes: If, at the end of the Nth round of dialogue, there are more historical dialogues to be discarded than the dialogue window, then the key information of the historical dialogues to be discarded is determined; based on the key information of the historical dialogues to be discarded, the memory layer information of the dynamic context of the (N-1)th round of dialogue is updated.
[0065] For example, suppose that at the end of the Nth round of dialogue, the historical dialogues in the dialogue window of the Nth round are the N-1th round dialogue and the N-2th round dialogue. At the end of the Nth round of dialogue, it is necessary to add the Nth round dialogue to the historical dialogue of the N+1th round dialogue window. At this time, it is found that the Nth round dialogue, the N-1th round dialogue, and the N-2th round dialogue exceed the length of the dialogue window. Therefore, it is necessary to discard some of the dialogues and select the latest historical dialogue, that is, the historical dialogue to be discarded is the N-2th round dialogue. At this time, it is determined that there are historical dialogues to be discarded that exceed the dialogue window at the end of the Nth round of dialogue. Then, the key information of the historical dialogue to be discarded (the key information of the N-2th round dialogue) is determined, and the memory layer information of the dynamic context of the N-1th round dialogue is updated according to the key information of the historical dialogue to be discarded.
[0066] Specifically, based on the key information of the historical dialogues to be discarded, the memory layer information of the dynamic context of the (N-1)th round of dialogue is updated. Figure 3 A flowchart illustrating the method for updating the memory layer information of the dynamic context of the (N-1)th round of dialogue provided in this application is shown below. Figure 3 As shown, the process includes: Step 301: Extract information with long-term value from the historical dialogues to be discarded as key information for the historical dialogues to be discarded.
[0067] For example, extracting information with long-term value from discarded historical conversations includes: explicit user preferences or aversions (e.g., a user says "I don't eat spicy food" or "I like a quiet environment"), confirmed key facts or decisions (e.g., a user has determined the time and place of a meeting or purchased a product), personal information provided by the user (e.g., the user's occupation, city of residence, or project name), consensus reached or to-do items in the conversation (e.g., "We agree to discuss it again next week" or "We need to apply for a budget from the finance department"), and any basic information that may be repeatedly mentioned or asked in subsequent conversations.
[0068] Step 302: Perform deduplication and condensation on the key information of the historical dialogues to be discarded to obtain a condensed summary of the historical dialogues to be discarded.
[0069] The deduplication process involves comparing the key information extracted in step 301 with the memory layer information of the dynamic context of the (N-1)th round of dialogue. If the information is the same or highly similar, it is skipped. The condensation process involves generating a highly condensed, sentence-by-sentence summary from the key information extracted in step 301 that needs to be retained, thus obtaining the condensed summary corresponding to the historical dialogue to be discarded.
[0070] Step 303: Determine the relevance of the condensed summary based on its relevance to the entire dialogue.
[0071] The relevance of the condensed summary can be categorized into five levels: Level 1, Level 2, Level 3, Level 4, and Level 5. The order of relevance is: Level 1 < Level 2 < Level 3 < Level 4 < Level 5. Level 1 indicates limited value of the condensed summary, which should only be considered for retention when there is sufficient space in the memory layer. Level 2 indicates that the condensed summary has some reference value, but the probability of it being mentioned again is low. Level 3 indicates that the condensed summary contains useful background information that may be needed in certain specific sub-topics. Level 4 indicates that important confirmed information in the condensed summary (such as time, place, and decision) is likely to be cited in subsequent conversations. Level 5 indicates that the condensed summary belongs to the user's core preferences or basic facts (such as project name and key constraints), and subsequent conversations will almost certainly involve it.
[0072] Step 304: Add the condensed summary and its relevance to the memory layer information of the dynamic context of the (N-1)th round of dialogue.
[0073] The following is an example of the memory layer information output for the dynamic context of the (N-1)th round of dialogue:
[0074] For example, suppose the historical dialogues that are about to be discarded are rounds 1-3.
[0075] ## Round 1 Dialogue
[0076] The user typed: "Hello, I would like to develop a marketing plan for my new project, 'Project Sky Dome'."
[0077] The assistant replied, "Okay, it's a pleasure to assist you. What industries and groups of people does the 'Sky Dome Project' primarily target?"
[0078] ## Round 2 Dialogue
[0079] User input: "This is a smart wearable device project aimed at high-end outdoor sports enthusiasts."
[0080] The assistant replied, "Understood. What's the approximate range of the marketing budget?"
[0081] ## Round 3 Dialogue
[0082] The user entered: "The initial budget is around 500,000 yuan. Our CEO emphasizes highlighting the product's 'reliability in extreme environments.'"
[0083] The assistant replied, "Received. I will develop a solution within a budget of 500,000, focusing on the two core points of 'high-end outdoor' and 'extreme reliability.'"
[0084] ## Memory layer information in the dynamic context used in this round
[0085] Memory layer information: "Users are advancing the 'Sky Dome Project'" and "Marketing plans need to emphasize a sense of technology."
[0086] ## Corresponding output
[0087] Optionally, in specific scenarios, an update to the dynamic context can be triggered after each round of dialogue. Specific scenarios include: scenarios with extremely high requirements for dialogue coherence, mission-critical dialogues (such as medical and financial dialogues), and establishing accurate context in the early stages of dialogue (such as the first 5 or 10 rounds of dialogue). This can improve the accuracy of the generated dynamic context, but it also brings problems such as high computational overhead and response latency.
[0088] Therefore, before updating the dynamic context of the (N-1)th round of dialogue, the following steps are also included: determining that the metadata of the Nth round of dialogue meets preset conditions, the preset conditions including at least one of the following: the focus continuity in the metadata of the Nth round of dialogue is a new direction, the topic in the metadata of the Nth round of dialogue has changed, the semantic vector in the metadata of the Nth round of dialogue is lower than a first preset threshold, the strategic layer influence representation in the metadata of the Nth round of dialogue has an influence, and the dynamic context of consecutive predetermined rounds has not changed.
[0089] By judging the metadata of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue is updated when it meets the preset conditions, and the dynamic context of the (N-1)th round of dialogue is updated when it does not meet the preset conditions. The dynamic context of the (N-1)th round of dialogue is directly used as the dynamic context of the Nth round of dialogue. In this way, the accuracy of generating dynamic context can be improved, the efficiency of generating dynamic context can be improved, and the computational overhead can be reduced.
[0090] Step 203: In response to the user input in the N+1th round of dialogue, generate the assistant's response in the N+1th round of dialogue based on the dynamic context of the Nth round of dialogue, the historical dialogues in the dialogue window, and the corresponding metadata.
[0091] Using the above method, the dynamic context of the (N-1)th round of dialogue is updated based on the metadata of the Nth round of dialogue to obtain the dynamic context of the Nth round of dialogue. In response to the user input in the N+1th round of dialogue, the assistant's response in the N+1th round of dialogue is generated based on the dynamic context of the Nth round of dialogue, the historical dialogue in the dialogue window, and the corresponding metadata. In this way, by updating the dynamic context of the dialogue, the persistent memory of key information in long dialogues is achieved, thereby improving the accuracy of the generated assistant responses.
[0092] Figure 4This is a schematic diagram of the internal implementation process of the assistant dialogue response device provided in the embodiments of this application, such as... Figure 4 As shown, taking this round of dialogue as the Nth round as an example, the specific implementation process includes: The assistant dialogue response device receives user input from the Nth round of dialogue and inputs this input into the chat model of the assistant dialogue response device. The chat model responds to the user input in the Nth round of dialogue by generating the assistant's response in the Nth round of dialogue based on the dynamic context of the (N-1)th round of dialogue, the historical dialogues within the dialogue window, and the corresponding metadata. At the end of the Nth round of dialogue, the evaluation model in the assistant dialogue response device generates metadata for the Nth round of dialogue. The steps for generating the metadata for the Nth round of dialogue are the same as those in the above embodiments and will not be repeated here. Based on the metadata of the Nth round of dialogue, the evaluation model in the assistant dialogue response device updates the dynamic context of the (N-1)th round of dialogue to obtain the dynamic context of the Nth round of dialogue. The steps for obtaining the dynamic context of the Nth round of dialogue are the same as those in the above embodiments and will not be repeated here. The dynamic context of the Nth round of dialogue generated by the evaluation model in the assistant dialogue response device is used in the N+1th round of dialogue. That is, when the N+1th round of dialogue begins, the chat model responds to the user input in the N+1th round of dialogue, and generates the assistant's response in the N+1th round of dialogue based on the dynamic context of the Nth round of dialogue, the historical dialogue within the dialogue window, and the corresponding metadata. It should be noted that the chat model and evaluation model in this application can be any model with reasoning capabilities, and no limitation is made here. In practical applications, better results can be obtained by specifically training and intervening in the evaluation model for the actual use scenario.
[0093] Based on the same technical concept, embodiments of this application provide an assistant dialogue response device 5000. Figure 5 This is a schematic diagram of the structure of the assistant dialogue response device provided in the embodiments of this application, as shown below. Figure 5 As shown, the device 5000 includes: The generation module 501 is used to generate metadata of the Nth round of dialogue at the end of the Nth round of dialogue; the metadata of any round of dialogue includes a summary of the current round of dialogue and an assessment of the impact of the current round of dialogue on the dynamic context. The update module 502 is used to update the dynamic context of the (N-1)th round of dialogue based on the metadata of the Nth round of dialogue, so as to obtain the dynamic context of the Nth round of dialogue. The processing module 503 is used to respond to user input in the N+1th round of dialogue and generate assistant response in the N+1th round of dialogue based on the dynamic context of the Nth round of dialogue, the historical dialogue in the dialogue window and the corresponding metadata.
[0094] In one optional implementation, the dynamic context of any round of dialogue includes strategic layer information and focus layer information; the strategic layer information is used to record key information of the entire dialogue; the focus layer information is used to record key information of the current dialogue; the update module 502 is specifically used to update the strategic layer information in the dynamic context of the (N-1)th round of dialogue based on the strategic layer influence in the metadata of the Nth round of dialogue; and to update the focus layer information in the dynamic context of the (N-1)th round of dialogue based on the focus layer continuity in the metadata of the Nth round of dialogue.
[0095] In one optional implementation, the dynamic context of any round of dialogue further includes memory layer information; the memory layer information is used to record key information of historical dialogues that exceed the dialogue window, and the update module 502 is further used to determine the key information of the historical dialogues to be discarded if there are historical dialogues to be discarded that exceed the dialogue window when the Nth round of dialogue ends; and to update the memory layer information of the dynamic context of the (N-1)th round of dialogue according to the key information of the historical dialogues to be discarded.
[0096] In one optional implementation, the metadata of any round of dialogue further includes at least one of the following: metrics for this round of dialogue, semantic vector for this round of dialogue, entity objects for this round of dialogue, and topic for this round of dialogue; wherein, the metrics for this round of dialogue include usefulness, focus, and confidence, wherein usefulness is used to describe the degree to which this round of dialogue contributes to achieving the dialogue goal, focus is used to describe the closeness of this round of dialogue to the current topic, and confidence is used to describe the accuracy of the summary content of this round of dialogue; The assessment of the impact of this round of dialogue on the dynamic context includes strategic-level impact, focus continuity, and memory-level association. The strategic-level impact represents the influence of this round of dialogue on strategic-level information. The focus continuity represents the continuity of this round of dialogue with the current topic. The memory-level association represents the association between this round of dialogue and memory-level information.
[0097] In an optional embodiment, the device further includes a determining module 504, which is used to determine that the metadata of the Nth round of dialogue meets preset conditions. The preset conditions include at least one of the following: the focus continuity in the metadata of the Nth round of dialogue is a new direction, the topic in the metadata of the Nth round of dialogue has changed, the semantic vector in the metadata of the Nth round of dialogue is lower than a first preset threshold, the strategic layer influence representation in the metadata of the Nth round of dialogue has an influence, and the dynamic context of consecutive predetermined rounds has not changed.
[0098] In one optional implementation, the generation module 501 is specifically used to input the user input of the Nth round of dialogue, the assistant response of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue, the historical dialogue in the dialogue window, and the corresponding metadata into a large language model, and generate the metadata of the Nth round of dialogue based on prompt words; the historical dialogue in the dialogue window is the latest M rounds of dialogue before the Nth round, and the metadata corresponding to the historical dialogue in the dialogue window is the M metadata corresponding to the latest M rounds of dialogue.
[0099] In an optional implementation, the update module 502 is further configured to extract information with long-term value from the discarded historical dialogue as key information of the discarded historical dialogue; perform deduplication and condensation processing on the key information of the discarded historical dialogue to obtain a condensed summary corresponding to the discarded historical dialogue; determine the relevance of the condensed summary based on its relevance to the entire dialogue; and add the condensed summary and its relevance to the memory layer information of the dynamic context of the (N-1)th round of dialogue.
[0100] Based on the same technological concept Figure 6 This application provides a schematic diagram of the structure of an assistant dialogue response device 6000, as shown in the embodiment of the present application. Figure 6 As shown, device 6000 includes at least one processor 601 and a memory 602 connected to at least one processor 601. In this embodiment, the specific connection medium between processor 601 and memory 602 is not limited. Figure 6 Taking the connection between processor 601 and memory 602 via a bus as an example. The bus can be divided into address bus, data bus, control bus, etc. In this embodiment of the invention, memory 602 stores instructions that can be executed by at least one processor 601. By executing the instructions stored in memory 602, the at least one processor 601 can implement the steps of the aforementioned assistant dialogue response method.
[0101] The processor 601 is the control center of the computer device, capable of connecting various parts of the computer device via various interfaces and lines. It performs resource configuration by running or executing instructions stored in the memory 602 and accessing data stored in the memory 602. Optionally, the processor 601 may include one or more processing units. The processor 601 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0102] Processor 601 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0103] Memory 602, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 602 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 602 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 602 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0104] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium. The computer program product includes computer program code, which, when executed on a computer, causes the computer to perform any of the assistant dialogue response methods discussed above. Since the principle by which the above-described computer-readable storage medium solves the problem is similar to that of the assistant dialogue response method, the implementation of the above-described computer-readable storage medium can be found in the implementation of the method; repeated details will not be elaborated further.
[0105] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the assistant dialogue response methods discussed above. Since the principle by which the above-described computer program product solves the problem is similar to that of the assistant dialogue response method, the implementation of the above-described computer program product can be referred to the implementation of the method, and repeated details will not be described again.
[0106] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0107] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0108] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0109] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0110] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. An assistant dialogue response method, characterized in that, The method includes: At the end of the Nth round of dialogue, metadata for the Nth round of dialogue is generated; the metadata for any round of dialogue includes a summary of the current round of dialogue and an assessment of the impact of the current round of dialogue on the dynamic context. Based on the metadata of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue is updated to obtain the dynamic context of the Nth round of dialogue. In response to user input in the N+1th round of dialogue, an assistant response in the N+1th round of dialogue is generated based on the dynamic context of the Nth round of dialogue, the historical dialogues within the dialogue window, and the corresponding metadata.
2. The method according to claim 1, characterized in that, The dynamic context of any round of dialogue includes strategic layer information and focus layer information; the strategic layer information is used to record key information of the entire dialogue; the focus layer information is used to record key information of the current dialogue. Based on the metadata of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue is updated, including: Based on the strategic layer impact in the metadata of the Nth round of dialogue, update the strategic layer information in the dynamic context of the (N-1)th round of dialogue; Based on the focus layer continuity in the metadata of the Nth round of dialogue, update the focus layer information in the dynamic context of the (N-1)th round of dialogue.
3. The method according to claim 2, characterized in that, The dynamic context of any round of dialogue also includes memory layer information; the memory layer information is used to record key information of historical dialogues beyond the dialogue window; the method further includes: If, at the end of the Nth round of dialogue, there are more historical dialogues to be discarded than the dialogue window, then the key information of the historical dialogues to be discarded is determined. Based on the key information of the historical dialogue to be discarded, update the memory layer information of the dynamic context of the (N-1)th round of dialogue.
4. The method according to claim 1, characterized in that, The metadata for any round of dialogue also includes at least one of the following: the metrics for this round of dialogue, the semantic vector for this round of dialogue, the entity objects for this round of dialogue, and the topic for this round of dialogue; wherein, the metrics for this round of dialogue include usefulness, focus, and confidence, wherein usefulness is used to describe the degree to which this round of dialogue contributes to achieving the dialogue goal, focus is used to describe the closeness of this round of dialogue to the current topic, and confidence is used to describe the accuracy of the summary content of this round of dialogue; The assessment of the impact of this round of dialogue on the dynamic context includes strategic-level impact, focus continuity, and memory-level association. The strategic-level impact represents the influence of this round of dialogue on strategic-level information. The focus continuity represents the continuity of this round of dialogue with the current topic. The memory-level association represents the association between this round of dialogue and memory-level information.
5. The method according to any one of claims 1-4, characterized in that, Before updating the dynamic context of the (N-1)th round of dialogue, the following also includes: The metadata of the Nth round of dialogue is determined to meet preset conditions, which include at least one of the following: The focus continuity in the metadata of the Nth round of dialogue is a new direction, the topic in the metadata of the Nth round of dialogue has changed, the semantic vector in the metadata of the Nth round of dialogue is lower than a first preset threshold, the strategic layer influence representation in the metadata of the Nth round of dialogue has an impact, and the dynamic context of consecutive predetermined rounds has not changed.
6. The method according to claim 5, characterized in that, The metadata generated for the Nth round of dialogue includes: The user input of the Nth round of dialogue, the assistant response of the Nth round of dialogue, the dynamic context of the (N-1)th round of dialogue, the historical dialogue in the dialogue window, and the corresponding metadata are input into the big language model, and the metadata of the Nth round of dialogue is generated based on the prompt words. The historical dialogues in the dialog window are the latest M rounds of dialogues before the Nth round, and the metadata corresponding to the historical dialogues in the dialog window are the M metadata items corresponding to the latest M rounds of dialogues.
7. The method according to claim 5, characterized in that, Based on the key information of the historical dialogue to be discarded, update the memory layer information of the dynamic context of the (N-1)th round of dialogue, including: Extract information with long-term value from the historical dialogues to be discarded as key information of the historical dialogues to be discarded. The key information of the historical dialogue to be discarded is deduplicated and condensed to obtain a condensed summary of the historical dialogue to be discarded. The relevance of the condensed summary is determined based on its relevance to the entire dialogue. The condensed summary and its relevance are added to the memory layer information of the dynamic context of the (N-1)th round of dialogue.
8. An assistant dialogue response device, characterized in that, The device includes: The generation module is used to generate metadata for the Nth round of dialogue at the end of the Nth round of dialogue; the metadata for any round of dialogue includes a summary of the current round of dialogue and an assessment of the impact of the current round of dialogue on the dynamic context; The update module is used to update the dynamic context of the (N-1)th round of dialogue based on the metadata of the Nth round of dialogue, so as to obtain the dynamic context of the Nth round of dialogue. The processing module is used to respond to user input in the N+1th round of dialogue and generate assistant responses in the N+1th round of dialogue based on the dynamic context of the Nth round of dialogue, the historical dialogues in the dialogue window, and the corresponding metadata.
9. An assistant dialogue response device, characterized in that, The device includes: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a computer, cause the method as described in any one of claims 1-7 to be performed.