CN-121808025-B - Agent interaction method, system, equipment and medium based on multi-layer memory driving
Abstract
The invention discloses an agent interaction method based on multi-layer memory driving, which belongs to the technical field of intelligent home, and comprises the steps of inputting user inquiry and user ID, converting the user inquiry and the user ID into inquiry vectors, filtering topics according to the user ID in a middle-term memory library, forming a preselected topic set through similarity matching, returning an optimal middle-term memory result after calculating scores by combining the similarity, time attenuation and heat, inquiring a long-term memory library through the user ID, obtaining user portrait information and equipment preference summary as long-term memory results, and inputting the user inquiry, middle-term memory results and long-term memory results into an agent to obtain replies. According to the intelligent home man-machine interaction system, through medium-term memory theme level aggregation, time-effect management and control and long-term memory accurate matching of user and equipment characteristics, multi-layer memory cooperation is achieved, individuation, accuracy and timeliness of intelligent body interaction are improved, information redundancy is reduced, and the intelligent home man-machine interaction system is suitable for man-machine interaction scenes of intelligent home.
Inventors
- Lu Tianqin
- LI YONGHUI
Assignees
- 深圳市华曦达科技股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260310
Claims (8)
- 1. A multi-layer memory driving-based intelligent agent interaction method is characterized by comprising the following steps of inputting user inquiry and user ID, converting the user inquiry into inquiry vectors, filtering topics corresponding to the user ID in a middle memory bank, obtaining a preset number of topics with highest similarity between abstract vectors and inquiry vectors in the middle memory bank to form a preselected topic set, calculating middle memory scores of the topics in the preselected topic set based on similarity, time attenuation and heat, selecting the preset number of topics with highest score in the middle memory bank to serve as middle memory results to return, inquiring user portrait information in a long-term memory bank according to the user ID, conducting similarity retrieval on the inquiry vectors in the long-term memory bank to return equipment preference summary, returning the user portrait information and the equipment preference summary as long-term memory results, inputting the user inquiry, the middle memory results and the long-term memory results into an intelligent agent, and obtaining intelligent agent reply; For multi-round dialogue of agent interaction, splicing multi-round user inquiry and agent reply to form a text, vectorizing the text to form multi-round dialogue vectors, calculating the similarity between the multi-round dialogue vectors, connecting edges of the two multi-round dialogue vectors with the similarity larger than a preset threshold, defining the multi-round dialogue vectors connected with edges as the same multi-round dialogue group, splicing and vectorizing the texts of the multi-round dialogue in the same multi-round dialogue group to form multi-round dialogue group vectors, recalling candidate topics according to user ID in a middle-term memory bank, calculating the similarity between the candidate topics and the multi-round dialogue group vectors, merging the candidate topics and the multi-round dialogue group if the similarity is larger than the preset threshold, and storing the multi-round dialogue group into the middle-term memory bank if the similarity is smaller than the preset threshold to form a new topic; The calculation method of the mid-term memory score is expressed as follows: ; Wherein, the The query vector is represented as a result of which, A summary vector representing the subject matter, The subject matter is represented by a set of images, The degree of similarity is indicated and, The degree of decay in time is indicated, The heat degree is indicated by the heat degree, 、 And Representing the coefficients.
- 2. The method for intelligent agent interaction based on multi-layer memory driving according to claim 1, wherein the method for calculating the time attenuation degree of the theme is expressed as: Recency(m)= ; wherein Δt represents the time interval from the last interaction of the theme to the current moment; Super-parameters representing the time decay.
- 3. The multi-layer memory driven agent interaction method according to claim 1, wherein the method for calculating the heat of the subject is expressed as: ; Wherein DETAILSLENGTH represents the accumulated historical dialogue number of the theme, recentTurns represents the dialogue number of the theme in the preset time, and Δt represents the time interval from last interaction of the theme to the current moment; Super-parameters representing the time decay.
- 4. The method for intelligent agent interaction based on multi-layer memory driving according to claim 1, wherein the step of combining the candidate subjects and the multi-turn dialog group includes the steps of obtaining texts of the multi-turn dialog and texts of the candidate subjects in the multi-turn dialog group as updated subject contents, and performing summary processing on the texts of the multi-turn dialog and the texts and summaries of the candidate subjects in the multi-turn dialog group to obtain summaries of the updated subjects.
- 5. The intelligent agent interaction method based on the multi-layer memory driving of claim 1, further comprising the steps of deleting the theme when the heat of the theme in the middle-term memory is smaller than a preset threshold value, acquiring the text of the theme when the heat of the theme in the middle-term memory is larger than the preset threshold value, inputting a large language model, extracting user basic information and user equipment preference, and inputting the user basic information and the user equipment preference into the long-term memory.
- 6. An agent interaction system based on multi-layer memory driving, which is used for realizing agent interaction by the agent interaction method based on multi-layer memory driving according to any one of claims 1-5, and is characterized by comprising a middle-term memory bank and a long-term memory bank.
- 7. A computer device comprising a processor and a memory, the memory being coupled to the processor, the memory storing one or more programs for execution by the processor to implement the steps in the multi-layer memory drive-based agent interaction method of any of claims 1-5.
- 8. A computer readable storage medium storing one or more programs for execution by a processor to implement the steps in the multi-layered memory drive-based agent interaction method of any of claims 1-5.
Description
Agent interaction method, system, equipment and medium based on multi-layer memory driving Technical Field The invention belongs to the technical field of intelligent home, and particularly relates to an agent interaction method, system, equipment and medium based on multi-layer memory driving. Background Along with the rapid development of artificial intelligence technology, the intelligent agent is widely applied to man-machine conversation scenes, and aims to provide personalized and efficient response service by accurately understanding user demands and combining historical interaction information. At present, the man-machine dialogue implementation mode oriented to the intelligent agent is concentrated on one or more combinations of session-level context memory, knowledge base retrieval and simple user portrait construction, but the man-machine dialogue implementation mode still has a plurality of limitations in practical application, and is difficult to meet the requirements of users on individuation and precise interaction of the intelligent agent. Specifically, the existing session-level context memorizing manner can only maintain short-term conversation history in the current session round, and once the session is ended, relevant memorizing information is lost, so that user demand continuation and preference multiplexing across sessions cannot be realized. In the knowledge base searching mode, although the historical words similar to the current problems can be returned through vector searching, topic level aggregation and combination of multiple rounds of dialogue information are lacking, and meanwhile, no aging management mechanism is introduced, so that the problems of easiness in repetition and low relevance of a searching result are caused. The user portrait construction mode is simple, the static portrait is formed based on user click behaviors or preferences, the dialogue semantic information, the equipment operation parameters and the user behavior time sequence characteristics cannot be cooperatively modeled, and the user dynamic habits and the scene requirements are difficult to accurately capture. Disclosure of Invention The technical problem to be solved in the prior art is to overcome the defects that the interaction efficiency is low and personalized requirements are difficult to accurately meet due to the fact that the method for the interaction of the agents cannot effectively process memory data in the prior art, so that the method, the system, the equipment and the medium for the interaction of the agents based on multi-layer memory driving are provided. An agent interaction method based on multi-layer memory driving comprises the following steps: Inputting user inquiry and user ID; Converting the user query into a query vector; filtering the subject corresponding to the user ID in a middle-term memory bank; Acquiring a preset number of topics with highest similarity between abstract vectors and query vectors in a middle-term memory library to form a preselected topic set; Calculating a mid-term memory score for topics in the set of pre-selected topics based on similarity, time decay, and popularity; Selecting the topics with the highest score in the middle-term memory library as middle-term memory results to return, and attaching corresponding equipment parameters; inquiring user portrait information in a long-term memory base according to the user ID; searching similarity of the query vector in a long-term memory library, and returning to the equipment preference summary; returning the user portrait information and equipment preference summary as a long-term memory result; Inputting the user inquiry, the middle-term memory result and the long-term memory result into an agent, and obtaining an agent reply. Further, the method also comprises the following steps: For multi-round dialogue of agent interaction, splicing multiple rounds of user inquiry and agent reply to form a text, and vectorizing the text to form a multi-round dialogue vector; calculating the similarity between the multiple rounds of dialogue vectors, wherein the similarity is greater than two rounds of dialogue vectors with edges connected with a preset threshold; Defining the multi-round dialogue vector with the edge as the same multi-round dialogue group; Splicing and vectorizing texts of the multi-round conversations in the same multi-round conversation group to form multi-round conversation group vectors; recall candidate topics according to user ID in the mid-term memory; The similarity between the candidate theme and the multi-round dialogue group vector is calculated, the candidate theme and the multi-round dialogue group are combined when the similarity is larger than a preset threshold value, the multi-round dialogue group is formed into a new theme when the similarity is smaller than the preset threshold value, and the new theme is stored in the middle-term memory bank. Further, the calculation method of