Search

CN-121981145-A - Intelligent body construction system and method based on long and short memories

CN121981145ACN 121981145 ACN121981145 ACN 121981145ACN-121981145-A

Abstract

The application discloses an intelligent body construction system and method based on long and short memories. The application collects new task description and history interaction information and matches initial parameters from a rule base based on the information. The coefficients of task topic variation and execution smoothness are calculated in each round of session, and the short-term and long-term memory weights are dynamically adjusted. And retrieving information in the short-term and long-term memory banks according to the weights, and fusing to generate fused information. And after the fusion information is input into the model for processing, synchronously updating the short-term memory bank, and asynchronously updating the long-term memory bank according to the scoring condition. And after the session is ended, optimizing and adjusting the initial parameters based on the session data. Finally, the intelligent agent is constructed based on the dynamically adjusted weight and the updated memory bank, and the method effectively solves the problem that the intelligent agent cannot be constructed accurately and efficiently in the prior art.

Inventors

  • ZHANG NANFENG
  • LIN WENJUN
  • DENG WENHAO
  • ZHANG YI
  • HUANG DAN
  • LI ZHEHONG
  • YAN SHIPENG
  • XUE XIAOJUN

Assignees

  • 广东航宇卫星科技有限公司

Dates

Publication Date
20260505
Application Date
20251230

Claims (10)

  1. 1. An intelligent agent construction system based on long and short memories, which is characterized by comprising: The information acquisition module is used for acquiring the description information of the new task and the history information of the collaborative interaction of the agents; the parameter matching module is used for matching initial parameters in a preset rule base based on the description information and the historical information, wherein the initial parameters comprise expected conversation turns and weight correlation coefficients; The weight dynamic adjustment module is used for calculating a first coefficient representing the change degree of a task theme and a second coefficient representing the execution stability degree of the task based on the history information in each round of session, and adapting short-term memory weight and long-term memory weight according to the first coefficient, the second coefficient and initial parameters; the memory retrieval fusion module is used for retrieving real-time interaction information in a preset short-term memory base based on the short-term memory weight, retrieving historical structural information in the preset long-term memory base based on the long-term memory weight, and fusing the real-time interaction information and the historical structural information to obtain fusion information; The memory updating module is used for inputting the fusion information into a preset model for processing, synchronously updating the short-term memory library according to the model processing result, and asynchronously updating the long-term memory library according to a preset grading condition; The rule base self-adaptive optimization module is used for carrying out self-adaptive adjustment on initial parameters in the rule base based on the first coefficient, the second coefficient and session execution data after the session is ended; The intelligent agent construction module is used for constructing and obtaining intelligent agent based on short-term memory weight, long-term memory weight, updated long-term memory bank, updated short-term memory bank and self-adaptive adjusted initial parameters.
  2. 2. The long and short memory-based intelligent agent construction system according to claim 1, wherein the parameter matching module specifically comprises: the task feature extraction unit is used for identifying task type identifiers in the description information and extracting task association features in the history information; The multi-mode matching unit is used for matching the task type identifier with task type codes in a preset rule base, combining the task association characteristics, verifying whether the matching is successful or not, and acquiring corresponding estimated conversation turns and weight correlation coefficients if the matching is successful; If the matching fails, calculating the comprehensive semantic similarity of the description information, the task association features and the task feature keywords in the rule base, selecting the parameter corresponding to the task with the highest comprehensive similarity as an initial parameter, and if the comprehensive semantic similarity does not reach a preset standard, calling a default parameter preset in the rule base as the initial parameter.
  3. 3. The long and short memory-based intelligent agent construction system according to claim 1, wherein the weight dynamic adjustment module specifically comprises: The first coefficient calculation unit is used for acquiring input description information of the current turn and output content of a preset model, and generating a current abstract of the current turn through a text abstract technology; extracting a history abstract of a corresponding task from the history information; The method comprises the steps of converting a current abstract of a current round and a selected historical abstract into vector forms respectively, calculating semantic similarity between vectors of the current abstract and average vectors of the historical abstract, and calculating a first coefficient based on the semantic similarity; A second coefficient calculating unit, configured to record the number of rounds that the current session has completed; The average execution turns of the similar tasks in the history information are combined, and the estimated conversation total turns are corrected; Calculating a second coefficient based on the number of completed turns and the corrected estimated session total turns; the weight adapting unit is used for extracting a first weight coefficient and a second weight coefficient from the initial parameters, combining the first coefficient and the second coefficient, and calculating based on a preset numerical operation to obtain a long-term memory weight and a short-term memory weight.
  4. 4. The long and short memory-based intelligent agent construction system according to claim 1, wherein the memory retrieval fusion module specifically comprises: The long-term memory retrieval unit is used for converting the description information and the history information into retrieval vectors, and retrieving entity identifiers in a vector database based on the retrieval vectors; Traversing association relations of preset degrees in a graph database through the entity identifier to obtain corresponding triplet information; converting the triplet information into a natural language text form to obtain historical structured information; The information fusion unit is used for converting the real-time interaction information into a short-term memory vector, and converting the history structural information into a long-term memory vector; and carrying out weighted summation on the short-term memory vector and the long-term memory vector based on the short-term memory weight and the long-term memory weight, and taking the weighted summation vector as fusion information.
  5. 5. The long and short memory-based agent construction system according to claim 1, wherein the memory updating module specifically comprises: The short-term memory updating unit is used for acquiring the input description information of the current round and the output content of the preset model, and if the total length of the input description information and the output content exceeds a preset threshold value, dividing the input description information and the output content into a plurality of text blocks with overlapped parts; summarizing all the micro abstracts to generate a comprehensive abstract of the current turn; if the short-term memory bank has the history comprehensive abstract, fusing the history comprehensive abstract and the current round comprehensive abstract to generate a rolling abstract, and updating the rolling abstract to the short-term memory bank; If the short-term memory bank does not have the history comprehensive abstract, storing the current round comprehensive abstract into the short-term memory bank; The long-term memory updating unit is used for scoring the input description information, the output content and the history information of the current round from three preset dimensions; The method comprises the steps of calculating weighted comprehensive scores of three dimension scores, extracting triple information in current round input description information and output content to be stored in a graph database if the weighted comprehensive scores are higher than a preset threshold, converting entity description into vectors, storing the vectors in the vector database, and establishing association relation between the entity description vectors and entity identifiers.
  6. 6. The long and short memory-based intelligent agent construction system according to claim 1, wherein the rule base adaptive optimization module specifically comprises: the weight parameter optimization unit is used for acquiring the user satisfaction degree score of the accumulated session and the first coefficient and the second coefficient of each turn in each session; Calculating a first coefficient average value and a second coefficient average value of each session, wherein the first coefficient average value is the arithmetic average of first coefficients of all rounds in a single session; classifying the conversations according to the numerical ranges of the first coefficient average value and the second coefficient average value, and respectively carrying out barrel classification processing on the first weight coefficient and the second weight coefficient in the initial parameters used by the conversations under each classification according to different classification results; Calculating the average satisfaction degree scores of all the sessions in each barrel, and determining the weight coefficient corresponding to the barrel with the highest average satisfaction degree score under the corresponding category as an optimization target value; And adjusting the original weight coefficient according to the optimized target value to obtain an updated weight coefficient and writing the updated weight coefficient into a rule base.
  7. 7. The long and short memory-based intelligent agent construction system according to claim 1, wherein the intelligent agent construction module specifically comprises: The parameter integrating unit is used for integrating the short-term memory weight, the long-term memory weight, the updated short-term memory bank, the updated long-term memory bank, the optimized predicted session round and the optimized weight correlation coefficient to obtain an integrated parameter; The intelligent agent generating unit is used for inputting the integrated parameters into a preset frame, and correlating a long and short memory calling mechanism, a parameter dynamic adapting mechanism and a memory updating mechanism through cooperative scheduling logic built in the frame; based on each mechanism after the association, generating the intelligent agent based on long and short memories.
  8. 8. The intelligent agent construction method based on long and short memories is characterized by comprising the following steps: acquiring description information of a new task and history information of agent cooperative interaction; based on the description information and the history information, matching initial parameters in a preset rule base, wherein the initial parameters comprise expected conversation turns and weight correlation coefficients; In each round of session, calculating a first coefficient representing the change degree of a task theme and a second coefficient representing the execution stability degree of the task based on the history information, and adapting short-term memory weight and long-term memory weight according to the first coefficient, the second coefficient and initial parameters; Searching real-time interaction information in a preset short-term memory bank based on the short-term memory weight, searching historical structural information in the preset long-term memory bank based on the long-term memory weight, and fusing the real-time interaction information and the historical structural information to obtain fused information; inputting the fusion information into a preset model for processing, synchronously updating the short-term memory library according to the model processing result, and asynchronously updating the long-term memory library according to a preset scoring condition; After the session is ended, based on the first coefficient, the second coefficient and session execution data, carrying out self-adaptive adjustment on initial parameters in the rule base; Based on the short-term memory weight, the long-term memory weight, the updated long-term memory bank, the updated short-term memory bank and the self-adaptive adjusted initial parameters, the intelligent body based on the long-term memory is constructed.
  9. 9. The method for constructing an intelligent agent based on long and short memories according to claim 8, wherein the initial parameters in a preset rule base are matched based on the description information and the history information, and the initial parameters comprise expected conversation turns and weight correlation coefficients, specifically: Identifying task type identification in the description information and extracting task association characteristics in the history information; Matching the task type identifier with task type codes in a preset rule base, verifying whether the matching is successful or not by combining the task association characteristics, and acquiring corresponding estimated conversation turns and weight correlation coefficients if the matching is successful; If the matching fails, calculating the comprehensive semantic similarity of the description information, the task association features and the task feature keywords in the rule base, selecting the parameter corresponding to the task with the highest comprehensive similarity as an initial parameter, and if the comprehensive semantic similarity does not reach a preset standard, calling a default parameter preset in the rule base as the initial parameter.
  10. 10. The long-short memory-based agent construction method according to claim 8, wherein in each session, a first coefficient indicating a degree of change of a task theme and a second coefficient indicating a degree of smoothness of task execution are calculated based on the history information, and a short-term memory weight and a long-term memory weight are adapted according to the first coefficient, the second coefficient and initial parameters, specifically: acquiring input description information of a current turn and output content of a preset model, and generating a current abstract of the current turn through a text abstract technology; extracting a history abstract of a corresponding task from the history information; The method comprises the steps of converting a current abstract of a current round and a selected historical abstract into vector forms respectively, calculating semantic similarity between vectors of the current abstract and average vectors of the historical abstract, and calculating a first coefficient based on the semantic similarity; Recording the number of completed turns of the current session; The average execution turns of the similar tasks in the history information are combined, and the estimated conversation total turns are corrected; Calculating a second coefficient based on the number of completed turns and the corrected estimated session total turns; And extracting a first weight coefficient and a second weight coefficient from the initial parameters, and combining the first coefficient and the second coefficient, and calculating based on a preset numerical operation to obtain a long-term memory weight and a short-term memory weight.

Description

Intelligent body construction system and method based on long and short memories Technical Field The invention relates to the field of intelligent agent construction, in particular to an intelligent agent construction system and method based on long and short memories. Background Along with the rapid development of artificial intelligence technology, a multi-agent cooperative system is increasingly important in a complex task processing scene, the core of the multi-agent cooperative system depends on the fact that high-efficiency interaction and cooperation are realized among agents through multiple rounds of session, and the effective memory and management of historical information directly determine the cooperative quality and task execution efficiency of the system. In such systems, the agent needs to compromise the consistency of the short-term session context and the traceability requirement of long-term structured knowledge, both to quickly respond to the dynamic changes of the current task and to accurately invoke the valuable information of the history precipitation, which presents a double challenge to the memory management technology. The current mainstream memory management scheme has remarkable limitations that short-term memory management based on a fixed context window is adopted, a first-in first-out simple mechanism is adopted, dynamic evaluation on the importance of session content is lacking, key context information is easy to discard indiscriminately in a long-round session, long-term memory retrieval based on a pure vector database is adopted, recall history text fragments are calculated only by means of semantic similarity, structural relationships such as causality, time sequence and the like among information cannot be modeled, retrieval results are fragmented, and deep tracing is difficult to support. In addition, the existing scheme generally adopts static parameter configuration, key parameters such as memory weight, session length and the like cannot be dynamically adjusted according to task types and session progress, updating of long-term memory depends on manual formulation rules, and an automatic information value evaluation mechanism is lacked, so that the system is weak in self-adaptation capability and lag in parameter optimization, and finally the problems of high decision delay, incoherence in cooperation, low tracing efficiency and the like in the multi-agent cooperation process are caused, and the intelligent level of the multi-agent cooperation system is severely restricted. These deficiencies result in the inability of the prior art to accurately and efficiently construct an agent. Disclosure of Invention The invention provides an intelligent body construction system and method based on long and short memories, which are used for solving the problem that intelligent bodies cannot be constructed accurately and efficiently in the prior art. In a first aspect, the present application provides a long and short memory-based intelligent agent construction system, comprising: The information acquisition module is used for acquiring the description information of the new task and the history information of the collaborative interaction of the agents; the parameter matching module is used for matching initial parameters in a preset rule base based on the description information and the historical information, wherein the initial parameters comprise expected conversation turns and weight correlation coefficients; The weight dynamic adjustment module is used for calculating a first coefficient representing the change degree of a task theme and a second coefficient representing the execution stability degree of the task based on the history information in each round of session, and adapting short-term memory weight and long-term memory weight according to the first coefficient, the second coefficient and initial parameters; the memory retrieval fusion module is used for retrieving real-time interaction information in a preset short-term memory base based on the short-term memory weight, retrieving historical structural information in the preset long-term memory base based on the long-term memory weight, and fusing the real-time interaction information and the historical structural information to obtain fusion information; The memory updating module is used for inputting the fusion information into a preset model for processing, synchronously updating the short-term memory library according to the model processing result, and asynchronously updating the long-term memory library according to a preset grading condition; The rule base self-adaptive optimization module is used for carrying out self-adaptive adjustment on initial parameters in the rule base based on the first coefficient, the second coefficient and session execution data after the session is ended; The intelligent agent construction module is used for constructing and obtaining intelligent agent based on short-term mem