Information processing method, information processing device, electronic equipment and storage medium
By combining the time distance, importance and similarity evaluation results, the mixed memory information of the agent is determined, and the language model is used to process the information, the problem of low efficiency and accuracy of the agent's information processing is solved, and more accurate and effective reply information generation is achieved.
Patent Information
- Application Number
- CN202411931037.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, in the information processing of agents, the processing methods of short-term memory and long-term memory are not effective enough, resulting in low information processing efficiency and accuracy of agents.
By acquiring short-term memory information and multiple long-term memory information, combining the time distance evaluation results, importance evaluation results and similarity evaluation results, the mixed memory information is determined, and the language model is used to process the mixed memory information to generate reply information.
This method can accurately determine mixed memory information from multiple dimensions, improve the accuracy and effectiveness of reply information, and enhance the information processing capabilities of the agent.
Smart Images

Figure CN119886208A_ABST
Abstract
Description
Background Art
[0002] With the rapid development of artificial intelligence technology, large language models have been widely used in many application fields. People can get the reply information of the intelligent agent by inputting information to it. How to ensure that the intelligent agent understands the input information and mines the information in it so that it can output accurate reply content has become the focus of attention. The prior art proposes that the accuracy of information processing by the intelligent agent can be improved by combining historical memory information to form context information. The commonly used method is to store historical information in a database or vector library, and the intelligent agent directly extracts historical information by retrieval. However, on the one hand, the historical information determined by retrieval is often incomplete and cannot guarantee the validity of the generated context information, thereby limiting the performance of the intelligent agent; on the other hand, the prior art lacks an effective way to mix short-term memory and long-term memory. Therefore, how to process short-term memory and long-term memory to improve the efficiency and accuracy of information processing by the intelligent agent is a problem that needs to be solved urgently in the prior art.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The present disclosure provides an information processing method, an information processing device, an electronic device and a computer-readable storage medium, thereby overcoming the problem of low efficiency and accuracy of information processing by intelligent agents in the prior art at least to a certain extent.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, there is provided an information processing method, comprising: obtaining short-term memory information to be processed, and multiple long-term memory information; the short-term memory information at least includes the information to be processed input by the user; determining a time distance evaluation result of each of the long-term memory information in time distribution, determining an importance evaluation result of each of the long-term memory information, and determining a similarity evaluation result between the short-term memory information and each of the long-term memory information; determining mixed memory information based on the short-term memory information and the multiple long-term memory information, in combination with the time distance evaluation result, the importance evaluation result and the similarity evaluation result; and processing the mixed memory information using a language model to determine reply information for returning to the user.
[0007] According to one aspect of the present disclosure, there is provided an information processing device, comprising: a memory information acquisition module, used to acquire short-term memory information to be processed, and multiple long-term memory information; the short-term memory information at least includes the information to be processed input by the user; an evaluation result determination module, used to determine the time distance evaluation result of each of the long-term memory information in the time distribution, determine the importance evaluation result of each of the long-term memory information, and determine the similarity evaluation result between the short-term memory information and each of the long-term memory information; a mixed memory determination module, used to determine the mixed memory information based on the short-term memory information and the multiple long-term memory information, in combination with the time distance evaluation result, the importance evaluation result and the similarity evaluation result; a reply information determination module, used to process the mixed memory information using a language model, and determine the reply information to be returned to the user.
[0008] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.
[0009] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above methods is implemented.
[0010] The exemplary embodiments of the present disclosure have the following beneficial effects:
[0011] Obtain short-term memory information to be processed and multiple long-term memory information; the short-term memory information at least includes the information to be processed input by the user; determine the time distance evaluation result of each long-term memory information in time distribution, determine the importance evaluation result of each long-term memory information, and determine the similarity evaluation result between the short-term memory information and each long-term memory information; determine the mixed memory information based on the short-term memory information and the multiple long-term memory information, combined with the time distance evaluation result, the importance evaluation result and the similarity evaluation result; use the language model to process the mixed memory information, and determine the reply information for returning to the user. On the one hand, this exemplary embodiment proposes a new information processing method, which can determine mixed memory information based on the time distance evaluation results, importance evaluation results and similarity evaluation results of the long-term memory information in the time distribution. Compared with the prior art that directly extracts historical memory information from the historical memory library according to the retrieval method to generate mixed memory information, this exemplary embodiment can accurately determine the long-term memory information in the mixed memory information from multiple dimensions and aspects, ensure the accuracy and effectiveness of the generation of mixed memory information, and provide a guarantee for the model to obtain accurate reply information; on the other hand, this exemplary embodiment can accurately and conveniently mix short-term memory information with long-term memory information through simple calculations, and use a language model to process the mixed memory information to improve the accuracy and effectiveness of the determined reply information.
[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0014] Figure 1 A flowchart schematically illustrates an information processing method in this exemplary embodiment;
[0015] Figure 2 A sub-flow chart schematically illustrates an information processing method in this exemplary embodiment;
[0016] Figure 3 A sub-flow chart schematically illustrates another information processing method in this exemplary embodiment;
[0017] Figure 4 A schematic diagram of the module interaction of an intelligent agent in this exemplary embodiment is shown;
[0018] Figure 5 A flowchart schematically illustrating another information processing method in this exemplary embodiment;
[0019] Figure 6 A block diagram schematically shows a structure of an information processing device in this exemplary embodiment;
[0020] Figure 7 An electronic device for implementing the above method in this exemplary embodiment is schematically shown. DETAILED DESCRIPTION
[0021] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0022] An exemplary embodiment of the present disclosure first provides an information processing method.
[0023] The following is combined with Figure 1 This exemplary embodiment is further described as follows. Figure 1 As shown, the information processing method may include the following steps S110 to S140:
[0024] Step S110, obtaining short-term memory information to be processed and multiple long-term memory information; the short-term memory information at least includes the information to be processed input by the user.
[0025] Among them, short-term memory information can refer to the information of the current time period or the time close to the current time period, which at least includes the information to be processed input by the user, such as the question information input by the user to the intelligent agent through text or voice, such as inputting "weekend itinerary guide to xx park", which is the information to be processed input by the user. Short-term memory information can also include other information, such as the user's current identity information, and system prompt word information. For example, the user interacts with the intelligent agent and inputs "weekend itinerary guide to xx park", and the user presets the identity information as "Xiao Su, married, with a daughter". The system prompt word can be the background of the conversation, the identity relationship of the dialogue parties, etc., then the text information input by the user, the user identity information, and the system prompt word can all be regarded as short-term memory information. Long-term memory information refers to information at a distance from the current time, which can be historical memory information, such as the questions and answers asked by the user in the previous round or history.
[0026] Short-term memory information can be obtained from the user's input data, the label data set by the user, and the configuration data of the agent, such as obtaining the question information input by the user, the identity information preset by the user, or the system prompt words of the large language model, etc. Long-term memory information can be stored in an external storage area such as a historical information library or a vector library. When necessary, this exemplary embodiment can obtain long-term memory information from the external storage area.
[0027] Step S120, determining the time distance evaluation result of each long-term memory information in time distribution, determining the importance evaluation result of each long-term memory information, and determining the similarity evaluation result between the short-term memory information and each long-term memory information.
[0028] In this exemplary embodiment, the times corresponding to multiple long-term memory information may be different. For example, the questions input in the previous round and the previous two rounds and the corresponding replies may correspond to different information input times or reply generation information. Therefore, this exemplary embodiment can perform time distance evaluation on the long-term memory information at different times in time distribution to determine the time distance evaluation result. The time distance evaluation result can be an indicator data used to reflect the degree of time distance between each long-term memory information, or the degree of distance from the current time. Among them, the distance between the long-term memory information and the current time can be characterized by the distance between the long-term memory information and the short-term memory information obtained in step S110, such as the distance between the long-term memory information and the information to be processed input by the current user.
[0029] The importance assessment result of long-term memory information refers to indicator data used to reflect the importance of long-term memory information. The importance of each long-term memory information may be different, and the importance of long-term memory information may be related to multiple factors, such as the generation time, generation content, storage form of the long-term memory information, whether the user performs other interactions, etc. Whether the user performs other interactions may include, for example, whether the user forwards, copies, or browses the memory information for a long time.
[0030] The similarity evaluation result between the short-term memory information and each long-term memory information can be an indicator data used to reflect the similarity between the short-term memory information and each long-term memory information. This exemplary embodiment can convert the short-term memory information and the long-term memory information into a vector form, and determine the similarity evaluation result between the short-term memory information and each long-term memory information by calculating the cosine similarity between the vectors.
[0031] In an exemplary embodiment, the above-mentioned determination of the time distance evaluation result of each long-term memory information in the time distribution may include:
[0032] According to the ranking value and benchmark value of each long-term memory information from the current time, the time distance evaluation result of each long-term memory information in time distribution is calculated.
[0033] Among them, the long-term memory information can be a kind of historical information, and the time corresponding to each long-term memory information can be different. The distance sorting value refers to the distance evaluation value used to evaluate the long-term memory information at different times. The reference value can be the basic value used to calculate the time distance evaluation result, which can be set or customized according to actual needs. This exemplary embodiment can read the most recent N pieces of information from the historical information library as multiple long-term memory information, and can be sorted according to the index number ID i The size is sorted into {1, 2, 3, ... N} to represent the sequential distance of the information from the current time message, and the following formula is used to calculate the distance similarity score S of each long-term memory information in the time distribution close :
[0034]
[0035] Among them, y0 is the initial value, that is, the reference value, e is the base of the natural logarithm, α is the attenuation factor, and x i is the ranking value of the i-th historical message. By calculating through the above formula, we can get the similarity score S of N long-term memory information. close , and this score is the time distance evaluation result.
[0036] In an exemplary embodiment, determining the importance evaluation result of each long-term memory information can be achieved by:
[0037] The format of N long-term memory information read from the historical information database is [{ID i-1 :(x i-1 ,d i-1 )},{ID i :(x i ,d i )}…], where the importance score S corresponding to the text in N long-term memory information impo(ta+t It can be determined by the following formula:
[0038] S impo(ta+t ={d i |i=1,2,…N}
[0039] where d i Represents the importance score of the i-th piece of information, that is, the importance assessment result.
[0040] In an exemplary embodiment, determining the similarity evaluation result between the short-term memory information and each long-term memory information can be achieved by:
[0041] This exemplary embodiment can be used to store and retrieve high-dimensional vectors through a vector database, and can efficiently process large-scale data. A vector library corresponding to N long-term memory information is obtained from the historical information library, wherein the vector library can be formed by converting each text message in the N long-term memory information into a vector using an embedding model. When it is necessary to determine the text message that is most similar to short-term memory information, such as a user question, the short-term memory information can first be converted into a vector, and then a similarity measurement method is used to calculate the cosine similarity between the short-term memory information vector and each long-term memory information vector stored in the database, thereby obtaining a similarity score S simila( , can be expressed by the following formula:
[0042] S simila( ={s i |i=1,2,…N}
[0043] Among them, s i It represents the cosine similarity score of the i-th message, that is, the similarity evaluation result.
[0044] Step S130, determining mixed memory information based on the short-term memory information and the multiple long-term memory information, combined with the time distance evaluation result, the importance evaluation result and the similarity evaluation result.
[0045] Among them, mixed memory information refers to mixed information that integrates short-term memory information and long-term memory information. How to mix short-term and long-term memory is the focus of this exemplary embodiment. In this exemplary embodiment, the mixed memory information can be determined based on short-term memory information and multiple long-term memory information, combined with the time distance evaluation results, importance evaluation results and similarity evaluation results. Specifically, m long-term memory information can be extracted from N long-term memory information based on the time distance evaluation results, importance evaluation results and similarity evaluation results, and then the m long-term memory information is merged with the short-term memory information, for example, the long-term memory information is spliced with the short-term memory information. Extracting m long-term memory information from N long-term memory information based on the time distance evaluation results, importance evaluation results and similarity evaluation results can be achieved by formula calculation. For example, a calculation formula is constructed based on the time distance evaluation results, importance evaluation results and similarity evaluation results, such as weighted calculation, to determine a comprehensive evaluation result, and the m long-term memory information ranked top in the comprehensive evaluation result is determined based on the comprehensive evaluation result, and so on.
[0046] In an exemplary embodiment, if Figure 2 As shown, the above-mentioned determination of mixed memory information based on the short-term memory information and the multiple long-term memory information, combined with the time distance evaluation result, the importance evaluation result and the similarity evaluation result, may include the following steps:
[0047] Step S210, obtaining a first coefficient of a time distance evaluation result, a second coefficient of an importance evaluation result, and a third coefficient of a similarity evaluation result;
[0048] Step S220, using the first coefficient, the second coefficient and the third coefficient, the time distance evaluation result, the importance evaluation result and the similarity evaluation result are calculated to determine the information mixing evaluation value;
[0049] Step S230, determining one or more target long-term memory information from the plurality of long-term memory information according to the information mixing evaluation value;
[0050] Step S240, generating mixed memory information according to one or more target long-term memory information and short-term memory information.
[0051] Among them, the first coefficient, the second coefficient and the third coefficient are the calculation coefficients corresponding to the time distance evaluation results, the importance evaluation results and the similarity evaluation results, respectively. The first coefficient, the second coefficient and the third coefficient are used to calculate the time distance evaluation results, the importance evaluation results and the similarity evaluation results to determine the information mixed evaluation value, which can be regarded as a comprehensive score of the mixed memory of the comprehensive time distance evaluation results, the importance evaluation results and the similarity evaluation results.
[0052] Before determining the information mixing evaluation value, it is considered that the calculation results of the time distance evaluation results, the importance evaluation results, and the similarity evaluation results may not be uniform. For example, the similarity score S close , Importance score S impo(ta+t , similarity score S simila( The standards are inconsistent, so they can be normalized first. Specifically, the similarity score S corresponding to N historical information is obtained by calculating close , Importance score S impo(ta+t , similarity score S simila( After that, the three scores can be normalized by the Euclidean norm using the following formula:
[0053]
[0054] Among them, s i represents the corresponding score of the i-th message, and S- represents the result after L2 normalization. Therefore, the normalized similarity score S- close , Importance score S i-mpo(ta+t , similarity score S- simila( .
[0055] Then, the final mixed memory score S of N historical information can be calculated mix , which is the information mixing evaluation value:
[0056] S mix =α1S- close +α3S i-mpo(ta+t +α8S- simila(
[0057] Among them, α1 represents the weight coefficient of the similarity score, that is, the first coefficient; α3 represents the weight coefficient of the importance score, that is, the second coefficient; α8 represents the weight coefficient of the similarity score, that is, the third coefficient.
[0058] Furthermore, one or more target long-term memory information can be determined from multiple long-term memory information according to the information mixing evaluation value, for example, a preset number of long-term memory information with high scores can be extracted from multiple long-term memory information according to the information mixing evaluation value, or long-term memory information with scores greater than a preset score can be extracted from multiple long-term memory information as target long-term memory information, etc. Finally, mixed memory information can be generated according to one or more target long-term memory information and short-term memory information.
[0059] In an exemplary embodiment, the above-mentioned determining one or more target long-term memory information from multiple long-term memory information according to the information mixing evaluation value may include:
[0060] Sort multiple long-term memory information in descending order of information mixing evaluation value;
[0061] The first preset number of long-term memory information in the sorting result is used as the target long-term memory information.
[0062] This exemplary embodiment can sort N long-term memory information according to the size of the information mixing evaluation value to obtain a new historical information library {x1, x3, ... x9}, where x1 represents the long-term memory information corresponding to the maximum information mixing evaluation value, and so on.
[0063] Then, the first preset number of long-term memory information in the sorting result can be used as the target long-term memory information, where the preset number can be determined according to actual needs or system performance, and the present disclosure does not make specific limitations on this. For example, the first m long-term memory information at the front of the sorting result can be extracted from the N long-term memory information after sorting as the target long-term memory information, and then these m long-term memory information are spliced with the short-term memory information to obtain mixed memory information.
[0064] This exemplary embodiment can obtain a hybrid memory knowledge base by sorting operations and adding short-term memory information. This knowledge base adds relevant important information and high semantic similarity information on the basis of retaining recent historical information, making the historical memory more comprehensive and complete.
[0065] Step S140: Process the mixed memory information using a language model to determine reply information to be returned to the user.
[0066] Finally, the language model can be used to process the mixed memory information to determine the reply information used to return to the user. The reply information can be regarded as a dialogue message to reply to the user. For example, the user can input questions to the language model. This exemplary embodiment can combine the historical information with the input questions to obtain mixed memory information. After the language model processes the mixed memory information, it can obtain the reply information and return it to the user.
[0067] Based on the above description, in this exemplary embodiment, short-term memory information to be processed and multiple long-term memory information are obtained; the short-term memory information includes at least the information to be processed input by the user; the time distance evaluation result of each long-term memory information in the time distribution is determined, the importance evaluation result of each long-term memory information is determined, and the similarity evaluation result between the short-term memory information and each long-term memory information is determined; based on the short-term memory information and the multiple long-term memory information, combined with the time distance evaluation result, the importance evaluation result and the similarity evaluation result, the mixed memory information is determined; the mixed memory information is processed using a language model to determine the reply information for returning to the user. On the one hand, this exemplary embodiment proposes a new information processing method, which can determine mixed memory information based on the time distance evaluation results, importance evaluation results and similarity evaluation results of the long-term memory information in the time distribution. Compared with the prior art that directly extracts historical memory information from the historical memory library according to the retrieval method to generate mixed memory information, this exemplary embodiment can accurately determine the long-term memory information in the mixed memory information from multiple dimensions and aspects, ensure the accuracy and effectiveness of the generation of mixed memory information, and provide a guarantee for the model to obtain accurate reply information; on the other hand, this exemplary embodiment can accurately and conveniently mix short-term memory information with long-term memory information through simple calculations, and use a language model to process the mixed memory information to improve the accuracy and effectiveness of the determined reply information.
[0068] In an exemplary embodiment, if Figure 3 As shown, the above information processing method may further include the following steps:
[0069] Step S310, obtaining multiple pieces of reflection memory information;
[0070] Step S320, calculating the similarity between the short-term memory information and the reflective memory information to obtain a similarity calculation result;
[0071] The generating of mixed memory information according to one or more target long-term memory information and short-term memory information may include:
[0072] Step S330, generating mixed memory information based on the similarity calculation result, one or more target long-term memory information and short-term memory information.
[0073] In order to ensure the effectiveness and accuracy of the hybrid memory information, this exemplary embodiment may also consider adding relevant reflective memory information to the hybrid memory information to improve the accuracy and efficiency of the model output response results. Reflective memory information can be regarded as a kind of historical experience information, which can be stored in a configured reflective memory information library and can be extracted or obtained from the reflective memory information library when needed. In the reflective memory information library, the vector of the reflective question Q converted using the embedding model and the corresponding reflective answer can be stored in a vector library, and a dictionary result can be used, where the key is the vector of the question Q and the value is the corresponding answer.
[0074] Extracting multiple pieces of reflective memory information from the reflective memory information library may be extracting part of the reflective memory information, or may be extracting all the reflective memory information from the reflective memory information library. After extracting multiple pieces of reflective memory information, the similarity between the short-term memory information and the reflective memory information may be calculated to obtain a similarity calculation result. The similarity calculation may be achieved by calculating the cosine similarity between the corresponding vectors of the reflective memory information. Finally, based on the similarity calculation result, one or more target long-term memory information and short-term memory information, mixed memory information may be generated. Specifically, based on the similarity calculation result, it may be determined whether reflective memory information needs to be incorporated when generating mixed memory information. When the similarity calculation result meets certain requirements, mixed memory information may be generated based on the reflective memory information, the target long-term memory information and the short-term memory information; when the similarity calculation result does not meet certain requirements, mixed memory information may be generated based on the target long-term memory information and the short-term memory information.
[0075] In an exemplary embodiment, the generation of mixed memory information based on the similarity calculation result, one or more target long-term memory information and short-term memory information may include:
[0076] If there is reflective memory information with a similarity greater than a preset threshold among the multiple reflective memory information, generating mixed memory information according to the reflective memory information with a similarity greater than the preset threshold, one or more target long-term memory information, and short-term memory information;
[0077] If the similarity between the reflective memory information and the short-term memory information in the multiple reflective memory information is less than a preset threshold, mixed memory information is generated according to one or more target long-term memory information and short-term memory information.
[0078] Among them, the first threshold refers to the conditional threshold used to determine whether the reflective memory information meets the conditional threshold for adding to the mixed memory information. When the similarity between the reflective memory information and the short-term memory information is greater than the first threshold, it means that it is relatively similar to the short-term memory information. In the current question-answering process, the reflective memory information will provide greater help, so it can be added to the mixed memory information. When the similarity between the reflective memory information and the short-term memory information is less than the first threshold, it means that there is no content in the reflective memory information that is related to or similar to the current short-term memory information, and there is no need to add the reflective memory information to the mixed memory information.
[0079] In this exemplary embodiment, an embedding model can be used to convert short-term memory information and reflective memory information into vector form, and then the cosine similarity between the vector of the short-term memory information and the vector of each reflective memory information in the reflective memory information library can be calculated. If the cosine similarity is greater than the preset threshold β, it means that there is reflective memory information in the reflective memory information library that is highly related to the current short-term memory information. Therefore, the corresponding answer can be retrieved from the reflective memory information library and this part of the answer can be spliced into the mixed memory to form a new mixed memory; if the cosine similarity is less than the preset threshold β, the mixed memory information is determined according to the target long-term memory information and short-term memory information determined above.
[0080] This exemplary embodiment proposes to combine the reflective knowledge base with the mixed memory information, and calculate the cosine similarity between the user question and the reflective question by using the embedding model, and then combine the reflective knowledge into the mixed memory information, so as to use the reflective knowledge to solve practical problems. By combining the reflective knowledge with the mixed memory information, it can help the intelligent agent to effectively use the reflective knowledge base information and improve the accuracy of the intelligent agent when answering questions.
[0081] In an exemplary embodiment, after determining the reply information to be returned to the user, the information processing method may further include:
[0082] According to the reply information, the first coefficient of the time distance evaluation result, the second coefficient of the importance evaluation result, and the third coefficient of the similarity evaluation result are adjusted.
[0083] In this exemplary embodiment, a memory module can be configured to determine the mixed memory information. Then, after obtaining the mixed memory information of the memory module, the intelligent planning module will plan according to the current state, call the relevant tools for execution, and the execution results will also be passed to the memory module. When the memory module receives the reply information of the large model, a weight coefficient adaptive adjustment prompt can be constructed. According to the relationship between the planning execution result and the time distance evaluation result, importance evaluation result and similarity evaluation result of N long-term memory information, the weight coefficient value of (α1, α3, α8) is dynamically and adaptively adjusted, thereby increasing the weight proportion of the relevant modules in the mixed memory. By dynamically adjusting the weight coefficient, the long-term memory information in the mixed memory information can be made more comprehensive and accurate, and the accuracy of the planning module can also be greatly improved.
[0084] This exemplary embodiment proposes to form mixed memory information by calculating the time distance evaluation results, importance evaluation results and similarity evaluation results, and adaptively adjust the weight coefficients of the time distance evaluation results, importance evaluation results and similarity evaluation results through the intelligent agent planning execution results and the mixed memory content. By dynamically adjusting the weight coefficient, the historical memory information in the mixed memory information can be made more comprehensive and accurate, and the accuracy of the planning module can be greatly improved.
[0085] Figure 4 The schematic diagram of module interaction of an intelligent agent related to the information processing method in this exemplary embodiment is shown, and the intelligent agent 400 may include a memory module 410, a planning module 420, an execution module 430 and a tool module 440. The user 450 may input a question to the memory module 410, and the memory module 410 may generate mixed memory information according to the user question and historical memory information, and construct a prompt to enable the planning module 420 to generate a planning strategy. The execution module 430 may call the execution tool through the tool module 440, and process the mixed memory information to obtain the execution result, and return it to the memory module 410. After receiving the execution result, the memory module 410 may return the answer to the question to the user.
[0086] In an exemplary embodiment, the information processing method may further include:
[0087] Evaluate the response information and build a reflective memory information library.
[0088] When the memory module obtains the reply x from the big model, it can construct an importance score to evaluate the prompt, and reply to the content x based on the big model. The content importance score d of the reply information can be obtained through reasoning with the big model, which can be stored in the database in the format of {ID:(x,d)}, where ID represents the index number of the information, which is a unique identifier and is expressed in system time in milliseconds.
[0089] In this exemplary embodiment, the N-1 long-term memory information closest to the current one and the current reply information x can be used to construct a vector library corresponding to the N long-term memory information, wherein the vector library converts each text message in the N memory information into a vector using an embedding model. Therefore, the database and the vector library can be obtained through this unit, which are used to calculate the importance score and the similarity score in the hybrid memory generation stage.
[0090] By summing the importance scores of N pieces of memory information, we can get the sum of the importance of N pieces of memory information. impo(ta+t :
[0091]
[0092] Among them, d i Score the importance of the i-th historical information.
[0093] The sum of the importance of N pieces of memory information can be used to evaluate whether to add the reply information x to the reflective memory information library for subsequent use. impo(ta+t When the value is greater than the reflection threshold γ, it will enter the reflection module to build a reflection knowledge base and return the reply information to the user; when the sum of the importance sum impo(ta+t When it is less than the reflection threshold γ, the reply information of the large model will be directly returned to the user.
[0094] After obtaining N pieces of historical memory information, the reflection module constructs a reflection summary prompt, that is, takes the N pieces of historical memory information as statements and infers M key questions from these statements. After obtaining M reflection questions, the reflection question M is calculated by reading the vector library and using the embedding model. i The cosine similarity score with N historical information is sorted according to the score to obtain the first preset number of historical information, such as the TOP10 relevant historical information. Use the rerank re-ranking model to sort. Based on the retrieved TOP10 historical information, the re-ranking model uses specific features (such as content features, context features, user features, etc.) to evaluate the importance of historical memory information. The rerank model scores or sorts each item in the historical memory information, and then selects the most relevant or optimal result. For example, the second preset number of historical memory information can be used to obtain the TOP3 historical memory information. By constructing a question answer summary prompt, reflect on the question M i As a question, the TOP3 historical memory information is summarized as a reference description to obtain the reflection question M i Answer A i .
[0095] Therefore, for M reflective questions, M reflective summary answers can be obtained. By constructing the reflective questions and reflective answers as a reflective knowledge base dictionary and storing them, the intelligent agent's answers are finally given to the user.
[0096] This exemplary embodiment proposes to generate relevant reflection questions by calculating the sum of importance scores, judging the relationship between the sum of scores and the reflection threshold, and using the reflection summary prompt. The reflection questions and historical memory information are embedded and retrieved and reranked to obtain the TOP3 historical memory information, and the summary prompt is constructed to obtain the reflection answer, and finally the reflection knowledge base is constructed. By constructing reflection knowledge, the intelligent agent can summarize historical questions and answers, thereby effectively solving deep and complex problems.
[0097] Figure 5 A flowchart of another information processing method in this exemplary embodiment is shown, which may specifically include the following steps:
[0098] Execute step S502 using the memory module of the agent to obtain long-term memory information;
[0099] Step S504, calculating the time distance evaluation results of the N long-term memory information in time distribution;
[0100] Step S506, dynamically obtaining the nearest N long-term memory information and the importance evaluation results corresponding to each long-term memory information;
[0101] Step S508, reading the vector library of the long-term memory information, and determining the similarity evaluation results of each long-term memory information and the short-term memory information by means of a vector similarity calculation method;
[0102] Step S510, using the first coefficient, the second coefficient and the third coefficient, the time distance evaluation result, the importance evaluation result and the similarity evaluation result are calculated to determine the information mixing evaluation value;
[0103] Step S512, determining one or more target long-term memory information from the plurality of long-term memory information according to the information mixing evaluation value;
[0104] Step S514, obtaining multiple pieces of reflection memory information;
[0105] Step S516, calculating the similarity between the short-term memory information and the reflective memory information to obtain a similarity calculation result;
[0106] Step S518, determining whether the similarity between the reflective memory information and the short-term memory information is greater than a preset threshold;
[0107] If it is greater than the preset threshold, step S520 is executed to generate mixed memory information according to the reflective memory information whose similarity is greater than the preset threshold, one or more target long-term memory information and short-term memory information;
[0108] If it is less than the preset threshold, step S522 is executed to generate mixed memory information according to one or more target long-term memory information and short-term memory information;
[0109] Utilizing the planning module, the execution module, and the tool module of the agent to execute step S524, the mixed memory information is processed to obtain reply information;
[0110] After receiving the reply information, the memory module continues to execute step S526 to adjust the first coefficient of the time distance evaluation result, the second coefficient of the importance evaluation result, and the third coefficient of the similarity evaluation result according to the reply information;
[0111] Step S528, calculating the sum of the importance scores of the reply information and the adjacent N-1 pieces of historical memory information;
[0112] Step S530, determining whether the sum of the importance scores is greater than a reflection threshold;
[0113] If it is less than the reflection threshold, step S532 is executed to directly return the reply information to the user;
[0114] If it is greater than the reflection threshold, step S534 is executed to construct a reflection summary prompt word according to the reply information and generate a reflection question;
[0115] Step S538, calculating the similarity between the reflection question and the N pieces of historical memory information;
[0116] Step S536, rerank the historical memory information using the rerank reranking model;
[0117] Step S538, construct a reflective knowledge base or dictionary, and return the reply information to the user.
[0118] The exemplary embodiments of the present disclosure also provide an information processing device. Figure 6The device 600 may include a memory information acquisition module 610, which is used to acquire short-term memory information to be processed and multiple long-term memory information; the short-term memory information at least includes the information to be processed input by the user; an evaluation result determination module 620, which is used to determine the time distance evaluation result of each long-term memory information in the time distribution, determine the importance evaluation result of each long-term memory information, and determine the similarity evaluation result between the short-term memory information and each long-term memory information; a mixed memory determination module 630, which is used to determine the mixed memory information based on the short-term memory information and the multiple long-term memory information, combined with the time distance evaluation result, the importance evaluation result and the similarity evaluation result; a reply information determination module 640, which is used to process the mixed memory information using a language model and determine the reply information to be returned to the user.
[0119] In an exemplary embodiment, the evaluation result determination module includes: a time distance evaluation result calculation unit, which is used to calculate the time distance evaluation result of each long-term memory information in time distribution according to the distance ranking value and reference value of each long-term memory information from the current time.
[0120] In an exemplary embodiment, a hybrid memory determination module includes: a coefficient acquisition unit, used to acquire a first coefficient of a time distance evaluation result, a second coefficient of an importance evaluation result, and a third coefficient of a similarity evaluation result; a hybrid evaluation value determination unit, used to calculate the time distance evaluation result, the importance evaluation result, and the similarity evaluation result using the first coefficient, the second coefficient, and the third coefficient to determine an information hybrid evaluation value; a target long-term memory information determination unit, used to determine one or more target long-term memory information from multiple long-term memory information according to the information hybrid evaluation value; and a hybrid memory information generation unit, used to generate hybrid memory information based on one or more target long-term memory information and short-term memory information.
[0121] In an exemplary embodiment, the target long-term memory information determination unit includes: a sorting subunit, used to sort multiple long-term memory information in order from high to low information mixing evaluation values; a target memory determination subunit, used to use the first preset number of long-term memory information in the sorting result as the target long-term memory information.
[0122] In an exemplary embodiment, the information processing device also includes: a reflective memory acquisition unit, used to acquire multiple reflective memory information; a similarity calculation unit, used to calculate the similarity between short-term memory information and reflective memory information to obtain a similarity calculation result; a mixed memory information generation unit, including: a mixed memory generation sub-unit, used to generate mixed memory information based on the similarity calculation result, one or more target long-term memory information and short-term memory information.
[0123] In an exemplary embodiment, a hybrid memory generation subunit includes: a first judgment subunit, which is used to generate hybrid memory information based on the reflective memory information with a similarity greater than a preset threshold, one or more target long-term memory information and short-term memory information if there is reflective memory information with a similarity greater than a preset threshold among multiple reflective memory information; a second judgment subunit, which is used to generate hybrid memory information based on one or more target long-term memory information and short-term memory information if the similarity between the reflective memory information and the short-term memory information among the multiple reflective memory information is less than a preset threshold.
[0124] In an exemplary embodiment, after determining the reply information for returning to the user, the information processing device also includes: a coefficient adjustment unit, which is used to adjust the first coefficient of the time distance evaluation result, the second coefficient of the importance evaluation result, and the third coefficient of the similarity evaluation result according to the reply information.
[0125] The specific details of each module / unit in the above-mentioned device have been described in detail in the embodiments of the method part. The undisclosed details can be found in the embodiments of the method part, so they will not be repeated here.
[0126] Exemplary embodiments of the present disclosure also provide an electronic device capable of implementing the above method.
[0127] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0128] Refer to the following Figure 7 An electronic device 700 according to such an exemplary embodiment of the present disclosure is described below. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0129] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0130] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 710 can execute Figure 1 , Figure 2 or Figure 3 Steps shown etc.
[0131] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .
[0132] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0133] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0134] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0135] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiment of the present disclosure.
[0136] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.
[0137] The exemplary embodiments of the present disclosure also provide a program product for implementing the above method, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0138] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0139] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0140] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0141] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0142] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0143] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0144] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0145] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An information processing method, characterized in that: include: Obtain short-term memory information to be processed, as well as multiple long-term memory information; The short-term memory information at least includes the information to be processed input by the user; Determine a time distance evaluation result of each of the long-term memory information in time distribution, determine an importance evaluation result of each of the long-term memory information, and determine a similarity evaluation result between the short-term memory information and each of the long-term memory information; Determine mixed memory information according to the short-term memory information and the plurality of long-term memory information, in combination with the time distance evaluation result, the importance evaluation result and the similarity evaluation result; The mixed memory information is processed using a language model to determine reply information to be returned to the user.
2. The method according to claim 1, characterized in that Determining the time distance evaluation result of each long-term memory information in time distribution includes: According to the distance ranking value and the reference value of each long-term memory information from the current time, the time distance evaluation result of each long-term memory information in time distribution is calculated.
3. The method according to claim 1, characterized in that The determining of mixed memory information according to the short-term memory information and the plurality of long-term memory information in combination with the time distance evaluation result, the importance evaluation result and the similarity evaluation result includes: Obtaining a first coefficient of a time distance evaluation result, a second coefficient of an importance evaluation result, and a third coefficient of the similarity evaluation result; Using the first coefficient, the second coefficient and the third coefficient, the time distance evaluation result, the importance evaluation result and the similarity evaluation result are calculated to determine the information mixing evaluation value; determining one or more target long-term memory information from the plurality of long-term memory information according to the information mixed evaluation value; Generate mixed memory information based on the one or more target long-term memory information and the short-term memory information.
4. The method according to claim 3, characterized in that The step of determining one or more target long-term memory information from the plurality of long-term memory information according to the information mixed evaluation value comprises: Sorting the plurality of long-term memory information in descending order of the information mixing evaluation values; The first preset number of long-term memory information in the sorting result is used as the target long-term memory information.
5. The method according to claim 3, characterized in that: The method further comprises: Get multiple pieces of reflective memory information; Calculating the similarity between the short-term memory information and the reflective memory information to obtain a similarity calculation result; The generating mixed memory information according to the one or more target long-term memory information and the short-term memory information comprises: Based on the similarity calculation result, the one or more target long-term memory information and the short-term memory information, mixed memory information is generated.
6. The method according to claim 5, characterized in that The generating mixed memory information according to the similarity calculation result, the one or more target long-term memory information and the short-term memory information comprises: If there is reflective memory information with a similarity greater than a preset threshold among the multiple reflective memory information, generating mixed memory information according to the reflective memory information with a similarity greater than the preset threshold, the one or more target long-term memory information and the short-term memory information; If the similarity between the reflective memory information in the multiple reflective memory information and the short-term memory information is less than a preset threshold, mixed memory information is generated according to one or more target long-term memory information and the short-term memory information.
7. The method according to claim 3, characterized in that After determining the reply information to be returned to the user, the method further includes: According to the reply information, the first coefficient of the time distance evaluation result, the second coefficient of the importance evaluation result and the third coefficient of the similarity evaluation result are adjusted.
8. An information processing device, characterized in that: include: A memory information acquisition module is used to acquire short-term memory information to be processed and multiple long-term memory information; The short-term memory information at least includes the information to be processed input by the user; An evaluation result determination module, used to determine a time distance evaluation result of each of the long-term memory information in time distribution, determine an importance evaluation result of each of the long-term memory information, and determine a similarity evaluation result between the short-term memory information and each of the long-term memory information; A mixed memory determination module, used to determine mixed memory information according to the short-term memory information and the plurality of long-term memory information, in combination with the time distance evaluation result, the importance evaluation result and the similarity evaluation result; The reply information determination module is used to process the mixed memory information using a language model to determine the reply information to be returned to the user.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.