Memory management method of multi-agent interaction system, related device and program product

By employing a multi-level memory management method, memory data is stored hierarchically according to tasks, dialogues, and states. This solves the problems of redundancy and low retrieval efficiency in memory management in multi-agent systems, enabling flexible and accurate context management and efficient data retrieval, while reducing computational costs.

CN121434926BActive Publication Date: 2026-05-05IFLYTEK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing multi-agent systems lack fine-grained and flexible organization in memory management, resulting in redundant memory data, low retrieval efficiency, and the burying of key information, which increases the processing burden and computational cost of large language models.

Method used

A multi-level memory management method is adopted to store memory data in a hierarchical manner according to task memory, dialogue memory and state memory. It is classified and managed by intelligent agent role and memory level, providing flexible context management capabilities.

Benefits of technology

It improves the flexibility of memory data management and retrieval efficiency, reduces redundant data, avoids irrelevant information interfering with decision-making, and reduces the processing burden and computational cost of large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121434926B_ABST
    Figure CN121434926B_ABST
Patent Text Reader

Abstract

This application discloses a memory management method, related devices, and program products for a multi-agent interaction system, relating to the field of artificial intelligence technology. The method includes: responding to a user-initiated task command, calling a multi-agent ensemble to infer the task result, and feeding the task result back to the user; acquiring memory data generated by each agent in the multi-agent ensemble during the inference process; and storing the memory data of each agent hierarchically according to task memory level, dialogue memory level, and state memory level. A single task memory includes one or more rounds of dialogue memory related to a single task processed by the agent, and a single dialogue memory includes one or more state memories related to one round of dialogue by the agent. The state memory is used to record the state data of the model inference process called by the agent in one round of dialogue. This application provides more flexible memory data management, offering more flexible, accurate, and efficient context management and organization capabilities in human-machine and multi-agent collaboration processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a memory management method, related equipment and program products for a multi-agent interaction system. Background Technology

[0002] With the development of artificial intelligence technology, multi-agent systems have demonstrated enormous potential in scenarios such as complex task processing, intelligent customer service, content generation, and workflow automation. Memory management has become an indispensable underlying technological support. By integrating information and data generated in human-computer interaction and multi-agent collaboration, memory management provides large models with a certain degree of environmental awareness for participating in human production activities in the real world.

[0003] Existing solutions typically employ a flat or single-dimensional memory storage approach, mixing task context, dialogue history, and operation steps together. This approach fails to effectively distinguish the lifecycle and importance level of memory data, leading to data redundancy and low retrieval efficiency. As the number of interaction rounds increases, a large amount of irrelevant historical information interferes with the agent's decision-making, causing key information to be overwhelmed—the so-called "memory illusion" problem—while also increasing the processing burden and computational cost of large language models. Summary of the Invention

[0004] In view of the above problems, this application is proposed to provide a memory management method, related equipment, and program products for a multi-agent interaction system, so as to improve the flexibility of memory data management and realize more flexible, accurate, and efficient context management and organization capabilities in human-machine and multi-agent collaboration. The specific solution is as follows:

[0005] Firstly, a memory management method for a multi-agent interaction system is provided, including:

[0006] In response to a user-initiated task command, the system invokes the configured multi-agent set to infer the task result and then feeds the result back to the user.

[0007] Obtain the memory data generated by each agent in the multi-agent set during the reasoning process;

[0008] The memory data of each agent is stored hierarchically according to the task memory level, dialogue memory level, and state memory level.

[0009] Among them, a single task memory includes one or more rounds of dialogue memory related to a single task processed by the agent, and a single dialogue memory includes one or more state memories related to one round of dialogue of the agent. The state memory is used to record the state data of the model inference process called by the agent in one round of dialogue.

[0010] In one possible design, in another implementation of the first aspect of the embodiments of this application, the task memory is based on the tasks processed by the agent, recording the input, output, task configuration parameters and one or more dialogue memories related to each task.

[0011] The dialogue memory is based on dialogues between agents or between an agent and a user, recording the dialogue input, dialogue output, and one or more state memories related to each round of dialogue for an agent.

[0012] In one possible design, in another implementation of the first aspect of the embodiments of this application, the process of calling the multi-agent collective inference task result to feed back the task result to the user, and obtaining the memory data of the agents and storing it hierarchically, includes:

[0013] In response to user-initiated task commands, task reasoning is performed through the calling relationships between agents in the multi-agent set;

[0014] In this process, the preceding intelligent agent determines the next intelligent agent to be called and issues a sub-task to the next intelligent agent. The next intelligent agent then infers the result of the sub-task, stores the memory data of the inference process in a hierarchical manner, and feeds back the sub-task result to the calling source intelligent agent. This process continues until the entry intelligent agent infers the task result and feeds it back to the user. The entry intelligent agent is the first intelligent agent called in response to the task instruction.

[0015] In one possible design, another implementation of the first aspect of the embodiments of this application further includes:

[0016] In response to a user’s follow-up question on the same task, an execution route map of the same task is obtained. The execution route map represents the human-computer dialogue process before the follow-up question on the same task, and the execution route of each agent.

[0017] The memory data of each agent in the execution roadmap is compressed to obtain globally compressed memory data;

[0018] The large model is invoked to determine the target entry agent for the follow-up question based on the execution roadmap and the global compressed memory data. The target entry agent is then invoked to perform the reasoning process through the calling relationship between the target entry agent and other agents. The target entry agent obtains the final follow-up result and feeds it back to the user.

[0019] In one possible design, in another implementation of the first aspect of the embodiments of this application, before invoking the target entry agent, the following is further included:

[0020] The large model is invoked to determine the target memory data that the target entry agent needs to inherit based on the execution roadmap, the global compressed memory data, and the follow-up question. The target memory data is the memory data of one or more rounds of human-computer dialogue process before the follow-up question in the same task.

[0021] The process of invoking the target entry agent includes:

[0022] The target entry agent is invoked to execute the current inference process based on the target memory data.

[0023] In one possible design, another implementation of the first aspect of the embodiments of this application further includes:

[0024] After the target entry agent finishes its current round of inference, the memory data of this round of inference is compressed and then distributed to the calling source agent of the target entry agent.

[0025] In one possible design, in another implementation of the first aspect of the embodiments of this application, the process by which the target entry agent obtains the final follow-up result includes:

[0026] After compressing the memory data of this round of reasoning and spreading it to the calling source agent of the target entry agent, the calling source agent is updated to the target entry agent, and the updated target entry agent decides whether to perform reasoning based on the spread memory.

[0027] If the decision result is yes, then through the target entry agent, the reasoning process of the follow-up question is carried out based on diffuse memory to obtain the final follow-up result;

[0028] If the decision result is negative, the memory diffusion operation is performed iteratively until the decision of the agent that has been diffused is based on the diffused memory for reasoning.

[0029] In one possible design, in another implementation of the first aspect of the embodiments of this application, the process of compressing the memory data of each agent in the execution roadmap includes:

[0030] The memory data of each agent is compressed according to the compression strategy configured for each agent.

[0031] The compression strategy for each agent includes compression strategies that match the three levels of task memory, dialogue memory, and state memory.

[0032] In a second aspect, an electronic device is provided, comprising: a memory and a processor;

[0033] The memory is used to store programs;

[0034] The processor is configured to execute the program to implement the various steps of the memory management method for a multi-agent interaction system described in any of the first aspects of this application.

[0035] Thirdly, a readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the various steps of the memory management method for a multi-agent interaction system described in any of the first aspects of this application.

[0036] Fourthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the various steps of the memory management method for a multi-agent interaction system described in any of the first aspects of this application.

[0037] By employing the aforementioned technical solution, this application adopts a novel memory hierarchical design scheme. For memory data generated during multi-agent ensemble reasoning tasks, memory management is implemented from two dimensions: agent role and memory hierarchy. The memory hierarchy includes task memory, dialogue memory, and state memory. A single task memory includes one or more rounds of dialogue memory related to a single task processed by the agent. A single dialogue memory includes one or more state memories related to one round of dialogue for the agent. State memory records the state data of the model reasoning process invoked by the agent in one round of dialogue. In this way, memory data can be classified and managed according to agents, and the memory data of the same agent is further hierarchically managed according to task memory, dialogue memory, and state memory. Compared to existing flat and singular memory management methods, this application vertically deepens the memory hierarchy, making memory data management more flexible. This provides more flexible, accurate, and efficient context management and organization capabilities in human-machine and multi-agent collaboration processes. For example, when organizing prompts for a large model based on memory data, different levels of memory data can be distinguished, facilitating the large model's global control over the entire reasoning task. Meanwhile, the memory data management scheme of this application facilitates efficient data retrieval, which can improve retrieval efficiency, reduce redundant data, avoid a large amount of irrelevant information interfering with the agent's decision-making and causing key information to be overwhelmed, and at the same time reduce the processing burden and computational cost of large language models. Attached Figure Description

[0038] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0039] Figure 1A schematic diagram of an implementation system architecture for the memory management method of the multi-agent interaction system provided in this application embodiment;

[0040] Figure 2 A schematic flowchart of a memory management method for a multi-agent interaction system provided in this application embodiment;

[0041] Figures 3a-3b Two schematic diagrams illustrating the calling relationships between intelligent agents are provided respectively;

[0042] Figure 4 A schematic diagram illustrating hierarchical storage of human-computer interaction process memory data provided in this application embodiment;

[0043] Figure 5 This application provides a schematic diagram of a multi-agent execution route.

[0044] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0047] Currently, most mainstream memory management systems adopt a flat, standardized processing flow. In each round of interaction, a unified storage strategy is used to store human input and model output as memory in a vector database. In the next round of dialogue, the vectors are used to retrieve relevant information blocks. However, in real-world scenarios, the retrieval of scattered information blocks may contain logical conflicts, failing to accurately guide subsequent operational decisions in complex reasoning tasks. This can easily lead to contextual interference, decision-making errors, and even hallucinations.

[0048] Existing solutions lack a management solution that can flexibly organize context, isolate and reduce interfering memories, making it difficult to solve problems such as "context explosion" and decision interference in the long reasoning task processing of multi-agent systems.

[0049] To address the problem of existing technologies lacking fine-grained and flexible memory organization, this application introduces a hierarchical memory concept based on the task dimension, dividing the agent's memory into task level, dialogue level, and state level. That is, the interaction between the user and the agent system consists of a sequential list of multiple tasks in the time dimension; a task memory consists of a sequential list of multiple dialogue memories in the time dimension; and a dialogue memory consists of a sequential list of multiple state memories in the time dimension. By managing memory according to agent roles and hierarchical levels, the flexibility of memory data management is improved.

[0050] This application provides a memory management method for a multi-agent interaction system, which can be applied to, for example... Figure 1 The system architecture shown may include a terminal 100 and a server 200. The server 200 may include one or more servers (…). Figure 1 (This example uses a server as an illustration).

[0051] Either terminal 100 or server 200 can be used independently to execute the memory management method of the multi-agent interaction system provided in the embodiments of this application. Alternatively, terminal 100 and server 200 can also be used collaboratively to execute the memory management method of the multi-agent interaction system provided in the embodiments of this application.

[0052] The following description Figure 1 The product form of the mid-terminal 100;

[0053] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc., and this application embodiment does not impose any restrictions on it.

[0054] This application provides a memory management method for a multi-agent interaction system. Taking the application of this method to a computer device as an example, the computer device can specifically be... Figure 1 The system consists of terminal 100 or a combination of terminal 100 and server 200. (Refer to...) Figure 2 The memory management method of this multi-agent interaction system specifically includes the following steps:

[0055] Step S100: In response to the task instruction initiated by the user, the configured multi-agent set inference task result is invoked, and the task result is fed back to the user.

[0056] Specifically, after a user initiates a task command, the large model analyzes the command to determine the first agent (which can be defined as the entry agent) to be invoked to execute it, as well as the task invocation parameters. These parameters are then sent to the entry agent, which performs task inference based on them. For complex tasks, collaboration among multiple agents may be required. That is, the entry agent may need to invoke other agents during inference. This application pre-configures a set of agents with different roles, and these agents can have invocation relationships with each other.

[0057] In some embodiments of this application, the calling relationships between agents in a set of agents can be defined in the form of a directed graph. For example... Figure 3a and Figure 3b This example illustrates the calling relationships between two different agents. Nodes represent agents with different roles, and directed edges represent calling permission relationships. The originating node of a directed edge has permission to call the node pointed to by that directed edge.

[0058] It should be noted that the calling relationships between different intelligent agents can be set by the user according to the task requirements. The calling relationships between different intelligent agents can be unidirectional, such as... Figure 3a As shown. In addition, different intelligent agents can also have bidirectional calling relationships, such as... Figure 3b As shown.

[0059] In this step, task inference can be performed in response to user-initiated task commands by leveraging the calling relationships between agents in the multi-agent set.

[0060] Specifically, after determining the entry agent to be invoked to execute the task instruction, the entry agent performs the inference process. If other agents need to be invoked to execute subtasks during this process, the entry agent will further invoke other agents. The invoked agents may also invoke other agents again during their subtask inference process, and this process iterates. After the invoked agents execute the subtasks and obtain the results, they return the results to the invoking agent. Finally, the entry agent obtains the task result and provides feedback to the user.

[0061] It should be noted that each agent, during the task inference process, decides whether to call other agents based on task requirements, and further determines which agents to call when a call is needed. The calling relationships between agents need to satisfy a pre-defined directed graph of calling relationships, as shown in the example below. Figure 3a and Figure 3b As shown.

[0062] Step S110: Obtain the memory data generated by each agent in the multi-agent set during the reasoning process.

[0063] Specifically, in response to task instructions, reasoning is performed by a set of multiple agents. Each agent participating in the reasoning process generates information data, including but not limited to: human-computer interaction inputs and outputs, inputs and outputs of inter-agent calls, agent parameters, task running parameters, and tool outputs called during the agent reasoning process. This information data can be stored as memory data to provide contextual reference for subsequent human-computer interaction processes.

[0064] Step S120: Store the memory data of each agent in a hierarchical manner according to the task memory level, dialogue memory level, and state memory level.

[0065] In this embodiment, the memory data is divided according to different agent roles to obtain the memory data of each agent. Furthermore, a hierarchical organization architecture for memory data is provided, dividing the memory data of each agent into three layers: task memory, dialogue memory, and state memory.

[0066] The task memory layer stores one or more task memories, and a single task memory includes one or more rounds of dialogue memory related to a single task processed by the agent.

[0067] The dialogue memory layer stores one or more dialogue memories, and a single dialogue memory includes one or more state memories related to a turn of dialogue of the agent.

[0068] It should be noted that a round of dialogue between an agent can be a dialogue between the agent and the user (for the entry agent). In addition, it can also be a dialogue between agents. For example, when the entry agent calls other agents, it sends subtasks to those agents. This process can be regarded as a round of dialogue between the entry agent and other agents.

[0069] The state memory layer stores one or more state memories. A single state memory is used to record the state data of the model inference process called by the agent in one round of dialogue.

[0070] Combination Figure 4 This example illustrates a human-computer interaction process between a user and an intelligent agent team, where the memory data generated by the intelligent agent team is stored in layers according to task memory, dialogue memory, and state memory.

[0071] The task memory hierarchy includes several task memories, each containing at least one round of dialogue memory related to the agent's handling of a single task. For example... Figure 4 Task 2, "Create a picture book about the story of sympathy for the peasants, with requirements...", takes as an example. It includes p dialogue memories, from dialogue 1 to dialogue p. Each dialogue memory further includes one or more state memories related to a turn of dialogue for the agent. For example... Figure 4 Take dialogue 2 in the text as an example: “Adjust the background music to be more soothing”. It includes q state memories from state 1 to state q.

[0072] This application provides a novel memory hierarchy design scheme. For memory data generated during multi-agent inference tasks, memory management is implemented from two dimensions: agent role and memory hierarchy. The memory hierarchy includes task memory, dialogue memory, and state memory. A single task memory includes one or more rounds of dialogue memory related to a single task processed by the agent. A single dialogue memory includes one or more state memories related to one round of dialogue by the agent. State memory records the state data of the model inference process invoked by the agent in one round of dialogue. In this way, memory data can be classified and managed according to agents, and the memory data of the same agent is further hierarchically managed according to task memory, dialogue memory, and state memory. Compared to existing flat and singular memory management methods, this application deepens the memory hierarchy vertically, making memory data management more flexible. This provides more flexible, accurate, and efficient context management and organization capabilities in human-machine and multi-agent collaboration processes. For example, when organizing prompts for a large model based on memory data, different levels of memory data can be distinguished, facilitating the large model's global control over the entire inference task. Meanwhile, the memory data management scheme of this application facilitates efficient data retrieval, which can improve retrieval efficiency, reduce redundant data, avoid a large amount of irrelevant information interfering with the agent's decision-making and causing key information to be overwhelmed, and at the same time reduce the processing burden and computational cost of large language models.

[0073] In some embodiments of this application, three different levels of memory are described, each requiring the recording of its own type of information.

[0074] For task memory, the system records the input, output, task configuration parameters (such as task execution sandbox environment, task execution parameters, etc.) and one or more dialogue memories related to each task, based on the tasks processed by the agent.

[0075] Optionally, task memory can also record inherited memory, which refers to the process of multiple rounds of interaction between an agent and the same task instruction. In a certain round, the task memory of the agent can inherit the task memory of the same agent in the previous round or multiple rounds.

[0076] For dialogue memory, it records the dialogue input, dialogue output, dialogue state, and one or more state memories related to each round of dialogue, taking dialogue between agents or between an agent and a user as the unit.

[0077] For state memory, the state data of the model inference process called by the agent in a round of dialogue is recorded, including but not limited to: the model output content of the model inference process, the set of planned operations of the model, and the information of the calling tools.

[0078] In some embodiments of this application, the process of calling the results of a multi-agent collective inference task and feeding the task results back to the user, as well as obtaining the memory data of the agents and storing it hierarchically, as described in the foregoing embodiments, is further explained.

[0079] Specifically, in response to user-initiated task commands, task reasoning is performed through the calling relationships between agents in the multi-agent set.

[0080] The process of each agent calling the system involves the previous agent determining the next agent to be called through its reasoning process, issuing a sub-task to the next agent, and then the next agent reasoning the result of the sub-task. The memory data of the reasoning process is stored hierarchically, and the result of the sub-task is fed back to the calling agent. This process continues until the entry agent reasones the result of the task and feeds it back to the user. The entry agent is the first agent called in response to the task instruction.

[0081] Combination Figure 5 It provides an example of a schematic diagram of the execution path of an intelligent agent in human-computer interaction.

[0082] When a user initiates a task command, the execution manager analyzes the task command to determine the entry agent to be invoked, and sends scheduling parameters to the entry agent. The entry agent then executes the inference process and determines the roles of other agents to be invoked.

[0083] Figure 5 In the example shown, during the first round of human-computer interaction, a total of 9 agents participated in reasoning, corresponding to (RunID: 1~9). RunID represents the execution sequence number; it increments by 1 for each additional reasoning process. Each agent performs reasoning according to the execution path.

[0084] During execution, each agent (RunID:1~9) initializes task-level memory based on the subtasks that enter the agent. Then, the agent enters the reasoning phase and initializes dialogue-level memory.

[0085] Each agent performs a detailed reasoning process, organizes state-level memories, and stores the memory data generated during the agent's reasoning process in a hierarchical manner according to the set memory hierarchy storage architecture (task memory, dialogue memory, state memory). The agent also feeds back the sub-task results obtained by the agent to the calling agent.

[0086] Figure 5 In this context, RunAgent represents the agent executing the current step. Figure 5The first round of human-computer interaction, as shown, involves the planning agent calling upon the picture book agent. The picture book agent's reasoning process then calls upon the following agents: background gathering agent, chapter creation agent, script creation agent, cover creation agent, narration synthesis agent, music synthesis agent, storyboard creation agent, and picture book synthesis agent. Each agent, after obtaining the sub-task result through reasoning, feeds back the sub-task result to the calling agent. Finally, the planning agent obtains the task result and provides it to the user.

[0087] In some embodiments of this application, another alternative implementation of the memory management method is described.

[0088] Based on any of the foregoing embodiments, the memory management method of this embodiment may further include the following steps:

[0089] Step S200: In response to a follow-up question from the user regarding the same task, obtain the execution route map (RAG) for the same task. The execution route map (RAG) represents the human-computer dialogue process before the follow-up question for the same task, and the execution route of each agent.

[0090] Combination Figure 5 As shown, after initiating a task command during the first round of human-computer interaction, the user receives feedback on the task result. Based on this, the user can then ask follow-up questions about the same task.

[0091] It should be noted that in human-computer interaction, the questions asked by users can carry a task ID. The same task ID can be carried for one or more questions for the same task.

[0092] Upon receiving a follow-up question, if the execution manager determines that the task ID of the follow-up question is the same as the task ID of a previously obtained question, it can retrieve the execution route map (RAG) for that same task. This RAG represents the execution routes of each agent in the human-computer dialogue preceding the current follow-up question within that same task. Figure 5 In the second round of human-computer interaction, after the user asks follow-up questions, the obtained execution route map RAG is from RunID:0 to RunID:9.

[0093] Step S210: Compress the memory data of each agent in the execution roadmap RAG to obtain globally compressed memory data.

[0094] In this embodiment, to facilitate the execution manager in accurately determining the entry agent corresponding to the user's follow-up question—that is, the first agent to be invoked when reasoning about the user's follow-up question—and to enable the execution manager to understand the overall task from a global perspective and complete the accurate selection of the entry agent, the memory data of each agent in the execution roadmap RAG obtained in the aforementioned steps is compressed (corresponding to...). Figure 5(Metal team memory compression) to obtain globally compressed memory data.

[0095] This embodiment provides a flexible memory compression mechanism capable of offering up to "3×M" compression strategies, where M represents the number of agents in the agent set, and 3 represents the three-layer storage architecture of the memory data, corresponding to task memory, dialogue memory, and state memory. That is, this application can configure a compression strategy for each type of agent, and the compression strategy for each agent can further include compression strategies matching the three layers of task memory, dialogue memory, and state memory, thereby compressing the agent's memory data according to each agent's compression strategy.

[0096] The memory compression mechanism provided in this embodiment enables more granular memory management. It can be applied to a variety of different task requirements, allowing for the selection of the same or different compression strategies for different agents and memory levels, which is particularly important in continuous, long-duration human-computer interaction tasks.

[0097] An example of an optional compression strategy is to retain the inputs and outputs at the task level, extract key inference steps at the state level, and compress irrelevant detailed inference data. This allows the execution manager to gain a global perspective on the entire task while avoiding interference from excessive fragmented inference data.

[0098] Step S220: Invoke the large model to make a decision on the target entry agent for questioning based on the execution roadmap and global compressed memory data, and invoke the target entry agent to execute the reasoning process through the calling relationship between the target entry agent and other agents. The target entry agent obtains the final questioning result and feeds it back to the user.

[0099] In this step, the execution manager can call the large model to determine the target entry agent to be called based on the execution roadmap and global compressed memory data obtained in the previous steps. Then, the target entry agent is called to perform the reasoning process. If the target entry agent determines that other agents need to be called, it will further call other agents to perform reasoning. The called agents will then feed back the subtask results to the calling source agent. Finally, the target entry agent will obtain the questioning result and feed it back to the user.

[0100] like Figure 5 As shown, in the second round of human-computer interaction, in response to the user's follow-up questions, the execution manager obtains the execution roadmap (RAG) and compresses the team memory (the memory data of each agent in the execution roadmap RAG). Based on the execution roadmap RAG and the compressed team memory, the decision is made on the target entry agent, namely: the picture book agent corresponding to RunID:10.

[0101] It should be noted that under the same task (with the same task ID), the execution sequence number RunID is incremented, and the same type of intelligent agent, i.e., the same RunAgent, may be called repeatedly in different rounds of human-computer interaction.

[0102] Figure 5 As shown, the execution sequence numbers involved in the second round of human-computer interaction include: RunID10-RunID12.

[0103] The execution sequence numbers involved in the third round of human-computer interaction include: RunID13-RunID15.

[0104] In some embodiments of this application, a memory inheritance mechanism is further provided. Specifically, before calling the target entry agent for reasoning in step S220 above, the following processing steps can be added:

[0105] The large model is invoked to determine the target memory data that the target entry agent needs to inherit, based on the execution roadmap, globally compressed memory data, and follow-up questions. The target memory data is the memory data of one or more rounds of human-computer dialogue process before the target entry agent asks follow-up questions in the same task.

[0106] correspond Figure 5 In the second round of human-computer interaction, the execution manager can determine, based on the execution roadmap (RAG), globally compressed memory data, and follow-up questions, that the target entry agent (picture book agent) needs to inherit the memory data of the same type of agent (picture book agent) from the first round of human-computer interaction. In the third round of human-computer interaction, the execution manager can determine, based on the execution roadmap (RAG), globally compressed memory data, and follow-up questions, that the target entry agent (storyboard creation agent) needs to inherit the memory data of the same type of agent (storyboard creation agent) from the second round of human-computer interaction.

[0107] By combining the Execution Roadmap (RAG), globally compressed memory data, and follow-up questions, the large model can accurately determine which round or multiple rounds of human-computer interaction the target entry agent should inherit from the previous round of human-computer interaction, as well as the memory data of similar agents. In multiple rounds of interaction within the same task, the same agent may execute different or even contradictory subtasks in different rounds. In this case, the large model can selectively determine which round or multiple rounds of memory data the target entry agent should inherit when inferring follow-up questions, avoiding the potential introduction of irrelevant or even contradictory memory data that could interfere with the target entry agent's reasoning process in this round by directly inheriting all historical memory data.

[0108] Alternatively, after determining the RunID to be inherited by the target entry agent, the memory data of the agent corresponding to that RunID can be compressed, and then the compressed memory data can be inherited. For example, the detailed reasoning process in the agent's state memory can be retained, while the Action call results can be compressed. Of course, other compression strategies can also be chosen.

[0109] After determining the target memory data that the target entry agent needs to inherit, the target entry agent can be invoked to execute the current inference process based on the target memory data.

[0110] In this embodiment, by setting up an agent memory inheritance mechanism, the target entry agent can selectively inherit the memory data of the previous one or more rounds of human-computer interaction in different rounds of the same task, so that the target entry agent can accurately execute the reasoning process of asking follow-up questions in the current round of interaction.

[0111] In some embodiments of this application, a memory diffusion mechanism is further provided. Specifically, after the inference of the target entry agent is completed in step S220 above, the memory data of this round of inference can be compressed and diffused to the calling source agent of the target entry agent.

[0112] correspond Figure 5 In the second round of human-computer interaction, the target entry agent (the picture book agent corresponding to RunID:10) compresses the memory data of this round and spreads it to the calling source agent, namely the planning agent corresponding to RunID:0.

[0113] In the third round of human-computer interaction, the target entry agent (the storyboard creation agent corresponding to RunID:13) compresses the memory data from this round and diffuses it to the calling source agent, namely the picture book agent corresponding to RunID:14. Furthermore, after changing the target entry agent to the picture book agent corresponding to RunID:14, the new target entry agent further diffuses the memory data to the calling source agent, namely the planning agent corresponding to RunID:0.

[0114] In this embodiment, by introducing a memory diffusion mechanism, the memory of the calling source agent can be ensured to be updated in a timely manner. For example, when a user asks a follow-up question: "Modify the storyboard parameters and then recreate the picture book," the target entry agent is the storyboard creation agent, which performs the storyboard parameter modification operation. If this memory data is not diffused to the picture book agent, the modified storyboard parameters cannot be obtained when the picture book agent performs picture book generation, thus potentially preventing the generation of a picture book that meets the user's follow-up question.

[0115] Further optionally, in the follow-up question scenario, the execution manager determines the target entry agent corresponding to the follow-up question, and after calling the target entry agent to perform inference, after compressing the memory data of this round of inference and spreading it to the calling source agent of the target entry agent, the calling source agent can also be updated to a new target entry agent.

[0116] Specifically, the target entry agent notifies the execution manager after completing memory diffusion. In one optional implementation, the execution manager can directly update the calling source agent to the new target entry agent and diffuse the inference to the new target entry agent (i.e., have the new target entry agent execute the subsequent inference process).

[0117] In an alternative implementation, the execution manager can decide whether to update the target entry agent to the calling source agent based on a set policy. For example, it can determine whether the target entry agent belongs to a set type of agent. If it is an agent of the set type, no change to the target entry agent is required; otherwise, the calling source agent is updated to the new target entry agent, and the inference is propagated to the new target entry agent.

[0118] by Figure 5 As shown, this application can pre-configure the picture book agent not to change the entry agent after performing memory diffusion. Therefore, in the second round of human-computer interaction, the target entry agent (picture book agent) remains the target entry agent after performing memory diffusion, and feeds back the follow-up question results to the user after receiving them.

[0119] Figure 5 In the third round of human-computer interaction, the target entry agent (storyboard creation) does not belong to the set type of agent. Therefore, after it completes memory diffusion, the source agent (picture book agent) is updated to the new target entry agent, and the reasoning is diffused to the new target entry agent. Through the updated target entry agent, the reasoning process of asking follow-up questions based on the diffused memory is carried out to obtain the final follow-up result, which is then fed back to the user.

[0120] In another possible implementation, the execution manager can decide whether to update the target entry agent to the calling source agent based on a set policy. For example, it can determine whether the target entry agent belongs to a set type of agent. If it is a set type of agent, no change to the target entry agent is needed; otherwise, the calling source agent is updated to the new target entry agent. The updated target entry agent then decides whether to perform inference based on diffused memory.

[0121] If the decision result is yes, then through the updated target entry agent, the reasoning process of asking follow-up questions based on diffuse memory is carried out to obtain the final follow-up result.

[0122] If the decision result is negative, the memory diffusion operation is performed iteratively until the decision of the agent that has been diffused is based on the diffused memory for reasoning diffusion.

[0123] The memory diffusion mechanism provided in this embodiment offers a more flexible and controllable memory management method. Specifically, after determining the target entry agent based on the follow-up question, if subsequent resolution of the follow-up question requires reliance on other agents, and the target entry agent lacks the authority to invoke these other agents, the memory diffusion mechanism provided in this embodiment allows the target entry agent to compress and diffuse the memory data from the current reasoning process to the calling source agent. This diffusion recursively spreads memory and reasoning upwards, with the final diffused agent executing the reasoning process to invoke the required other agents, ensuring correct reasoning for the follow-up question.

[0124] This embodiment provides step S220, which involves calling a large model to determine the target entry agent for questioning based on the execution roadmap and global compressed memory data, and calling the target entry agent to execute the reasoning process through the calling relationship between the target entry agent and other agents. The target entry agent then obtains the final questioning result and provides it back to the user.

[0125] In some embodiments of this application, after determining the target entry agent corresponding to the follow-up question, the target entry agent is invoked to perform reasoning. After the target entry agent finishes performing this round of reasoning, the memory data of this round of reasoning is compressed and diffused to the calling source agent of the target entry agent. The calling source agent can then be updated to the target entry agent, and the updated target entry agent decides whether to perform reasoning based on diffused memory.

[0126] If the decision result is yes, then through the target entry agent, the reasoning process of asking follow-up questions based on diffuse memory is carried out to obtain the final follow-up result;

[0127] If the decision result is negative, the memory diffusion operation is performed iteratively until the decision of the agent that has been diffused is based on the diffused memory for reasoning.

[0128] The embodiments described above provide several flexible memory diffusion and reasoning diffusion mechanisms, which can be flexibly set according to actual business needs, thereby providing a more flexible and controllable memory management method.

[0129] This application also provides an electronic device in its embodiments. (See reference...) Figure 6 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, tablets, desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0130] like Figure 6 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 2 or a program loaded from a storage device 8 into a random access memory (RAM) 3, to implement the memory management method of the multi-agent interaction system of the foregoing embodiments of this application. When the electronic device is powered on, the RAM 3 also stores various programs and data required for the operation of the electronic device. The processing unit 1, ROM 2, and RAM 3 are interconnected via a bus 4. An input / output (I / O) interface 5 is also connected to the bus 4.

[0131] Typically, the following devices can be connected to I / O interface 5: input devices 6 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 7 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 8 including, for example, memory cards, hard drives, etc.; and communication devices 9. Communication device 9 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0132] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the memory management methods of the multi-agent interaction system provided in this application.

[0133] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the memory management methods of the multi-agent interaction system provided in this application.

[0134] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0135] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0136] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0137] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0138] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

Claims

1. A memory management method for a multi-agent interactive system, characterized in that, include: In response to a user-initiated task command, the system invokes the configured multi-agent set to infer the task result and then feeds the result back to the user. Obtain the memory data generated by each agent in the multi-agent set during the reasoning process; The memory data of each agent is stored hierarchically according to the task memory level, dialogue memory level, and state memory level. Among them, the task memory layer stores one or more task memories, and a single task memory includes one or more rounds of dialogue memories related to a single task processed by the agent. The dialogue memory layer stores one or more dialogue memories, and a single dialogue memory includes one or more state memories related to a round of dialogue of the agent. The state memory layer stores one or more state memories, and the state memories are used to record the state data of the model inference process called by the agent in a round of dialogue. The task memory is based on the tasks processed by the agent, recording the input, output, task configuration parameters, and one or more dialogue memories related to each task. The dialogue memory is based on dialogues between agents or between an agent and a user, recording the dialogue input, dialogue output, and one or more state memories related to each round of dialogue for an agent.

2. The method according to claim 1, characterized in that, The process of calling the results of a multi-agent ensemble inference task and feeding the results back to the user, as well as acquiring the agents' memory data and storing it hierarchically, includes: In response to user-initiated task commands, task reasoning is performed through the calling relationships between agents in the multi-agent set; In this process, the preceding intelligent agent determines the next intelligent agent to be called and issues a sub-task to the next intelligent agent. The next intelligent agent then infers the result of the sub-task, stores the memory data of the inference process in a hierarchical manner, and feeds back the sub-task result to the calling source intelligent agent. This process continues until the entry intelligent agent infers the task result and feeds it back to the user. The entry intelligent agent is the first intelligent agent called in response to the task instruction.

3. The method according to any one of claims 1-2, characterized in that, Also includes: In response to a user’s follow-up question on the same task, an execution route map of the same task is obtained. The execution route map represents the human-computer dialogue process before the follow-up question on the same task, and the execution route of each agent. The memory data of each agent in the execution roadmap is compressed to obtain globally compressed memory data; The large model is invoked to determine the target entry agent for the follow-up question based on the execution roadmap and the global compressed memory data. The target entry agent is then invoked to perform the reasoning process through the calling relationship between the target entry agent and other agents. The target entry agent obtains the final follow-up result and feeds it back to the user.

4. The method according to claim 3, characterized in that, Before invoking the target entry agent, the following is also included: The large model is invoked to determine the target memory data that the target entry agent needs to inherit based on the execution roadmap, the global compressed memory data, and the follow-up question. The target memory data is the memory data of one or more rounds of human-computer dialogue process before the follow-up question in the same task. The process of invoking the target entry agent includes: The target entry agent is invoked to execute the current inference process based on the target memory data.

5. The method according to claim 3, characterized in that, Also includes: After the target entry agent finishes its current round of inference, the memory data of this round of inference is compressed and then distributed to the calling source agent of the target entry agent.

6. The method according to claim 5, characterized in that, The process by which the target entry agent obtains the final follow-up question result includes: After compressing the memory data of this round of reasoning and spreading it to the calling source agent of the target entry agent, the calling source agent is updated to the target entry agent, and the updated target entry agent decides whether to perform reasoning based on the spread memory. If the decision result is yes, then through the target entry agent, the reasoning process of the follow-up question is carried out based on diffuse memory to obtain the final follow-up result; If the decision result is negative, the memory diffusion operation is performed iteratively until the decision of the agent that has been diffused is based on the diffused memory for reasoning.

7. The method according to claim 3, characterized in that, The process of compressing the memory data of each agent in the execution roadmap includes: The memory data of each agent is compressed according to the compression strategy configured for each agent. The compression strategy for each agent includes compression strategies that match the three levels of task memory, dialogue memory, and state memory.

8. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the memory management method for a multi-agent interaction system as described in any one of claims 1 to 7.

9. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the memory management method for a multi-agent interaction system as described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the various steps of the memory management method for a multi-agent interaction system as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-time reasoning system, method and equipment based on large model and medium

    CN120069069A

  • Large model task routing method, device and medium

    CN120429307A

  • Memory processing method based on intelligent agent, storage medium and electronic device

    CN121168679A