Session state management method, device and storage medium for multi-agent system
By defining the master agent and the slave agent in the multi-agent system and using the session state memory mechanism, the problems of inaccurate allocation of session tasks and high resource consumption in the prior art are solved, and more efficient and coherent session processing is achieved.
Patent Information
- Application Number
- CN202510113349.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-24
AI Technical Summary
When existing multi-agent systems handle complex and continuous session tasks, there are problems such as insufficient context information transmission and errors in task allocation, resulting in low computing efficiency and high resource consumption.
By defining the master agent and the slave agent in the multi-agent system, the master agent specifies the slave agent according to the user's session opening needs, and dynamically adjusts task allocation according to assistance requests during the session. Use the session state memory mechanism to record and pass session history information to ensure the accuracy of task allocation.
It improves the accuracy and coherence of the conversation, reduces the burden on the main agent in multiple rounds of conversations, avoids misallocation caused by the main agent's frequent routing decisions, and improves the system's computing efficiency and resource utilization.
Smart Images

Figure CN119603345B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and storage medium for managing session state of a multi-agent system. Background Art
[0002] In the field of large-model-based intelligent agent systems, with the continuous advancement of technology, the application scenarios of artificial intelligence have gradually become more complex, involving multiple tasks and processing requirements. In many practical applications, a single agent is often unable to efficiently solve complex problems due to the limitations of processing power and task scope. In order to address these challenges, multi-agent systems have gradually become an important development trend. Multi-agent systems have high flexibility and scalability by assigning tasks to different agents and solving problems through collaboration. Therefore, how to efficiently manage the collaboration and communication between multiple agents has become a key issue in current technology.
[0003] In the prior art, there are three main methods for solving the problem of multi-agent collaboration. The first method is to transform the multi-agent system into a single-agent system, transform the functions of each agent into multiple tools of the main agent, and realize the collaboration of multiple agents through the main agent. The second method is to retain multiple agents, and after each session passes through the main agent, the main agent acts as a routing role to decide which agent is responsible for processing the session task. The third method is the broadcast method, that is, the main agent broadcasts the session to all agents, allowing each agent to determine whether to process the task, and finally summarize the generated results.
[0004] Although existing technologies provide different multi-agent collaboration solutions, there are still some limitations. In each round of conversation, existing technologies must pass a large amount of context information, especially in the case of multiple rounds of dialogue, which significantly increases the computational burden of large model reasoning and reduces the computational efficiency of the system. At the same time, existing methods fail to fully consider the continuity of the conversation, resulting in the need to re-transmit and process context information in each round of conversation, and fail to effectively utilize historical information between agents, thereby increasing resource consumption and reasoning complexity, affecting the efficiency and accuracy of the system. Summary of the invention
[0005] The present application provides a method, device and storage medium for managing the session state of a multi-agent system, which can improve the accuracy and coherence of the session. The present application provides the following technical solutions:
[0006] In a first aspect, the present application provides a session state management method for a multi-agent system, the method comprising:
[0007] In a multi-agent system, define one agent as the master agent and the other agents as slave agents;
[0008] In response to a user's session start requirement, the master agent specifies a slave agent for the user according to the user's session start requirement;
[0009] The slave agent accepts the designation of the master agent, undertakes the conversation task and continues the conversation with the user, and during the conversation, determines whether to send an assistance request to the master agent according to the content of the user conversation;
[0010] The master agent designates another slave agent for the user according to the assistance request to take over the slave agent that issued the assistance request, undertake the conversation task and continue the conversation with the user;
[0011] In response to the user's request to end the session, the slave agent ends the session task and waits for the master agent to assign tasks.
[0012] In a specific implementation scheme, the method of defining one agent as a master agent and other agents as slave agents in a multi-agent system includes:
[0013] The system prompts the master agent to be designated as the session entry of the multi-agent system and to perform the following tasks:
[0014] According to the user's session opening requirements, a slave agent is designated to handle the session requirements, and the master agent can only designate one slave agent in each round;
[0015] Coordinate the cooperation relationship between the slave agents and transmit feedback information of the slave agents;
[0016] Intervene in user conversations and assist other slave agents in collecting interaction information in the conversation.
[0017] In a specific implementation scheme, the method of defining one agent as a master agent and other agents as slave agents in a multi-agent system includes:
[0018] For the main agent, the multimodal large model completes the construction of the main agent through a binding routing tool;
[0019] The routing tool is a tool used by the master agent to specify the slave agent. The routing tool can generate the slave agent's identifier and additional information to be transmitted to the slave agent based on the user's session opening requirements and the slave agent's capabilities.
[0020] In a specific implementation scheme, the method of defining one agent as a master agent and other agents as slave agents in a multi-agent system includes:
[0021] The slave agent is designated as the agent that handles specific tasks in the multi-agent system through system prompts, and is asked to perform the following tasks:
[0022] Accept the designation of the master agent, undertake the conversation task and continue the conversation with the user;
[0023] During the conversation, judging whether it is necessary to feed back information requiring assistance from other slave agents to the master agent according to the content of the user's conversation;
[0024] Receive the information of other slave agents forwarded by the master agent and continue the conversation task.
[0025] In a specific implementation scheme, the method of defining one agent as a master agent and other agents as slave agents in a multi-agent system includes:
[0026] For the slave agent, the multimodal large model completes the construction of the slave agent by binding business tools, information feedback tools and exit mechanism tools;
[0027] The business tools are a set of tools required by the agent to handle specific conversation requirements, which are determined by the specific business;
[0028] The information feedback tool is a tool for requesting the master agent to coordinate other slave agents to assist when the slave agent cannot handle the current session requirements;
[0029] The exit mechanism tool is a tool for forcibly exiting the dialogue when the slave agent is unable to handle the conversation requirements and needs to actively hand over the conversation control.
[0030] In a specific implementation scheme, the master agent designates another slave agent for the user to take over the slave agent that issued the assistance request according to the assistance request, undertake the conversation task and continue the conversation with the user, including:
[0031] During a user's session, session state memory is used to record the session state at the previous and current moments.
[0032] In a specific possible implementation scheme, the master agent designates another slave agent for the user to take over the slave agent that issued the assistance request according to the assistance request, and after taking over the conversation task and continuing the conversation with the user, it also includes:
[0033] After the new slave agent takes over the conversation task and continues the conversation with the user, it determines whether it needs to send an assistance request to the master agent based on the content of the user's conversation during the conversation;
[0034] The master agent re-assigns a new slave agent based on the new assistance request. Through the setting of session state memory, all session inputs go directly into the newly designated slave agent without passing through the master agent.
[0035] In a second aspect, the present application provides a session state management device for a multi-agent system, which adopts the following technical solution:
[0036] A session state management device for a multi-agent system, comprising:
[0037] The agent definition module is used to define an agent as the master agent and other agents as slave agents in a multi-agent system;
[0038] A session start module, configured to respond to a user's session start requirement, wherein the master agent specifies a slave agent for the user according to the user's session start requirement;
[0039] An agent dialogue module is used for the slave agent to accept the designation of the master agent, undertake the conversation task and continue the conversation with the user, and determine whether to send an assistance request to the master agent according to the user conversation content during the conversation;
[0040] An agent switching module is used for the master agent to designate another slave agent for the user to take over the slave agent that issued the assistance request according to the assistance request, to undertake the conversation task and continue the conversation with the user;
[0041] The session ending module is used to respond to the user's session ending request, and the slave agent ends the session task and waits for the master agent to assign tasks.
[0042] In a third aspect, the present application provides an electronic device comprising a processor and a memory; the memory stores a program, and the program is loaded and executed by the processor to implement a session state management method for a multi-agent system as described in the first aspect.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium, in which a program is stored. When the program is executed by a processor, it is used to implement a session state management method for a multi-agent system as described in the first aspect.
[0044] In summary, the beneficial effects of this application include at least:
[0045] 1) By using session state memory, a single slave agent can directly take over and process continuous conversations with the user without having to go through the master agent's route every time. In this way, the master agent only intervenes in task allocation when necessary, thereby reducing the burden on the master agent in multiple rounds of conversations. This mechanism avoids incorrect allocations that may be caused by frequent routing decisions made by the master agent, ensuring the accuracy and coherence of the conversation content. Session state memory can help the system remember and track the context of each round of conversation, so that each slave agent can process based on historical conversation information when taking over a task, avoiding conversation interruptions or deviations caused by information loss or misjudgment.
[0046] 2) The master agent is not only responsible for the distribution of tasks, but also needs to coordinate the collaboration between different slave agents. When a slave agent cannot complete a task independently, the master agent dynamically adjusts according to the needs of the user and the capabilities of the slave agent, and designates other slave agents to take over the task. This mechanism enables each agent to specialize according to its own strengths and capabilities, while the master agent efficiently coordinates the transmission and cooperation of information in the background, ensuring the smooth transmission of information between multiple agents, avoiding duplication or omission of tasks, and thus improving the work efficiency and responsiveness of the overall system.
[0047] In the multi-agent system of the present application, the master agent is responsible for coordinating and allocating tasks, designating slave agents according to the user's session start requirements, and adjusting task allocation as needed during the session. When the slave agent cannot solve the problem independently, it will send an assistance request to the master agent, and the master agent will reassign other slave agents to take over the task based on the request. Finally, when the user sends a request to end the session, the slave agent ends the task and waits for the master agent to make a new task allocation. This solution solves the problems of flexibility and accuracy of task allocation in a multi-agent system. Through the collaboration of the master agent and the slave agent, it ensures that tasks can be reasonably allocated according to the capabilities of the agents; at the same time, through the assistance request mechanism in the session, dynamic adjustment of tasks and continuity of the session are achieved, avoiding session interruptions or inefficiencies caused by incorrect task allocation.
[0048] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of the session state management method of the multi-agent system in the embodiment of the present application.
[0050] Figure 2 It is a schematic diagram of the overall process of the session state management method of the multi-agent system in the embodiment of the present application.
[0051] Figure 3 It is a structural block diagram of the session state management device of the multi-agent system in an embodiment of the present application.
[0052] Figure 4 It is a block diagram of an electronic device for session state management of a multi-agent system in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.
[0054] Optionally, the present application uses the session state management method of the multi-agent system provided in each embodiment as an example for explanation in an electronic device, where the electronic device is a terminal or a server. The terminal may be a computer, a tablet computer, etc. This embodiment does not limit the type of electronic device.
[0055] Reference Figure 1 , is a flow chart of a method for managing a session state of a multi-agent system provided by an embodiment of the present application, the method comprising at least the following steps:
[0056] Step S101: define one agent as a master agent and other agents as slave agents in a multi-agent system.
[0057] Among them, the role definition and task description of the master agent and slave agent in the multi-agent system are completed through system prompts.
[0058] Specifically, for the main agent, the system prompts the main agent to be designated as the session entry of the multi-agent system, and allows it to perform the following tasks:
[0059] 1) According to the user's session opening requirements, a slave agent is designated to handle the session requirements, and the master agent can only designate one slave agent in each round.
[0060] 2) Cache the intermediate process results fed back from the agent.
[0061] 3) Coordinate the collaborative relationship between the slave agents and transmit feedback information from the slave agents.
[0062] 4) Intervene in user conversations and assist other slave agents in collecting interaction information in the conversation.
[0063] For the slave agent, the system prompts the slave agent to be the agent that handles specific tasks in the multi-agent system, and lets it perform the following tasks:
[0064] 1) Accept the instructions of the main agent, undertake the conversation task and continue the conversation with the user.
[0065] 2) During the conversation, determine whether it is necessary to feedback to the master agent information that requires assistance from other slave agents based on the content of the user's conversation.
[0066] 3) Receive information from other slave agents forwarded by the master agent and continue the conversation task.
[0067] In implementation, in order to realize the functions of the master agent and the slave agent, the multimodal large model is bound to different tools to form the master agent or the slave agent.
[0068] Specifically, for the master agent, the multimodal large model completes the construction of the master agent by binding the routing tool. The routing tool is a tool for the master agent to specify the slave agent. The routing tool can generate the slave agent's ID and additional information to be passed to the slave agent based on the user's session opening requirements and the slave agent's capabilities. After calling the routing tool, the session control is automatically transferred to the slave agent specified by the master agent.
[0069] For the slave agent, the multimodal large model completes the construction of the slave agent by binding business tools, information feedback tools and exit mechanism tools. Through the synergy of business tools, feedback information tools and exit mechanism tools, the slave agent can handle tasks independently and collaborate with the master agent to complete complex conversation requirements when necessary. Among them, the business tool is a set of tools required by the slave agent to handle specific conversation requirements, which is determined by the specific business. The feedback information tool is called when the slave agent cannot handle the current conversation requirements and needs the assistance of other slave agents to request coordination from the master agent. The exit mechanism tool is called when the slave agent cannot handle the conversation requirements and needs to actively hand over the control of the conversation. It will forcibly exit the conversation and let the master agent take over the conversation.
[0070] Step S102: In response to the user's session initiation requirement, the master agent specifies a slave agent for the user according to the user's session initiation requirement.
[0071] In step S102, after the user issues a session start request, the master agent calls the bound routing tool to generate a slave agent identifier (ID) suitable for executing the task based on the user's session start request and the current business capabilities of the slave agent. The master agent designates the slave agent and transfers the session control to the designated slave agent.
[0072] Step S103, the slave agent accepts the designation of the master agent, undertakes the conversation task and continues the conversation with the user. During the conversation, it determines whether it is necessary to send an assistance request to the master agent based on the content of the user conversation.
[0073] In step S103, after the slave agent accepts the designation of the master agent, it undertakes the conversation task and starts a continuous conversation with the user. During the conversation, the slave agent calls the bound business tool to process specific needs and generate corresponding replies based on the content input by the user. When the slave agent is processing the conversation task, if it is judged that the user's needs exceed its own capabilities, such as requiring the collaboration of other slave agents or involving the coordination of tasks of the master agent, the slave agent will call the information feedback tool and send an assistance request to the master agent. The assistance request contains the context information of the user's current conversation, which facilitates the master agent to make quick decisions and formulate the slave agent.
[0074] Step S104: The master agent designates another slave agent for the user based on the assistance request to take over the slave agent that issued the assistance request, undertake the conversation task and continue the conversation with the user.
[0075] In step S104, after receiving the assistance request from the slave agent, the master agent calls the bound routing tool again, generates a new slave agent identifier suitable for executing the task based on the context information of the user's current conversation in the assistance request, and transfers the session control to the new slave agent through the routing tool. The new slave agent takes over the conversation task and continues the conversation with the user, ensuring the continuity of the conversation and the seamless connection of the user experience.
[0076] In addition, preferably, during the user's session, session state memory is used to record the session state before and at the current moment. Specifically, the session state memory is a table that mainly records the changes in key states such as the assignment, feedback, and exit of session tasks. Through state memory, the main agent can obtain more comprehensive historical information and context information, and make task assignment decisions in combination with real-time feedback. The decision of the main agent not only depends on the current conversation content, thereby reducing the probability of errors in task assignment. Refer to Table 1 for an example table of session state memory:
[0077] Table 1 Example table of session state memory
[0078]
[0079] In the implementation, after the new slave agent takes over the conversation task and continues the conversation with the user, similarly, during the conversation, it is determined whether it is necessary to send an assistance request to the master agent according to the user's conversation content. The master agent re-assigns a new slave agent according to the new assistance request. At this time, through the setting of the conversation state memory, all conversation inputs will not pass through the master agent, but directly enter the newly designated slave agent, which can avoid the master agent from making mistakes in task allocation due to too much conversation to a certain extent. Specifically, each time the master agent re-assigns a new slave agent according to the assistance request, the master agent does not make a decision based on all the conversation content, but assigns a new slave agent based on part of the conversation information or context information provided in the assistance request. Because the master agent does not process the content of each round of conversation, but only processes the key information involved in the assistance request. This mechanism can effectively avoid the master agent from making misjudgments or wrong assignments due to too much conversation content when allocating tasks. When the slave agent is unable to solve the problem independently and sends out a request for assistance, the master agent not only designates a new slave agent based on part of the dialogue or context information in the assistance request, but also ensures that all subsequent conversation inputs can be directly connected to the new slave agent through the session state memory mechanism.
[0080] Step S105: In response to the user's request to end the session, the slave agent ends the session task and waits for the master agent to assign tasks.
[0081] In step S105, when the user issues a request to end the session, the slave agent ends the current session task according to the request. Specifically, the slave agent actively terminates the conversation with the user through the exit mechanism tool and notifies the master agent that the session has ended. After the session ends, the slave agent returns the control right to the master agent and prepares to accept new task assignments. At this time, the master agent takes over the control right and performs a new round of task assignments according to the new user session requirements.
[0082] In summary, combined with Figure 2 , this application handles complex user conversation requirements through the collaboration of a master agent and multiple slave agents. In the scheme, the master agent is responsible for intelligently designating a slave agent to handle the task based on the user's conversation initiation requirements, ensuring the continuity and smooth transition of the conversation. When the slave agent cannot solve the problem independently, it will send an assistance request to the master agent, and the master agent will reassign a new slave agent to take over the task based on the context information in the assistance request. Through the conversation state memory mechanism, the system can effectively record and transmit conversation history information, ensure the accuracy of task allocation, and reduce the incorrect allocation of the master agent due to too much conversation content, thereby improving the efficiency and accuracy of the system. This technical solution solves the problems of context transfer and task allocation errors that exist in existing multi-agent systems when processing complex and continuous conversation tasks, and improves the flexibility and responsiveness of the system.
[0083] In addition, by introducing the session state memory mechanism, this solution can record key state information in the session, including task assignment, assistance request, and exit, so as to avoid the need to re-transmit all context information in each round of the session. In this way, the slave agent can directly judge and process tasks based on historical information without relying on the master agent for a large amount of context transfer every time, thereby greatly reducing resource consumption and reasoning complexity. When the slave agent needs assistance, the master agent only reassigns tasks based on some key information in the assistance request (such as the context of the current conversation or key decision points) instead of processing all the conversation content. This can reduce unnecessary context information transfer and further optimize the computational efficiency of the system.
[0084] It should be noted that this application is particularly suitable for complex continuous conversation scenarios. In simple conversation scenarios, user needs are usually more direct and simple, without the need to transmit a large amount of contextual information, and without involving collaboration between multiple agents, so there is no need to adopt complex state memory and task coordination mechanisms.
[0085] Figure 3 This is a structural block diagram of a session state management device for a multi-agent system provided by an embodiment of the present application, and the device includes at least the following modules:
[0086] The agent definition module is used to define an agent as the master agent and other agents as slave agents in a multi-agent system;
[0087] A session start module, used to respond to the user's session start requirement, and the master agent specifies a slave agent for the user according to the user's session start requirement;
[0088] The agent dialogue module is used to accept the designation of the master agent from the slave agent, undertake the conversation task and continue the conversation with the user. During the conversation, it is determined whether it is necessary to send an assistance request to the master agent according to the content of the user conversation;
[0089] An agent switching module is used for the master agent to designate another slave agent to take over the slave agent that issued the assistance request according to the assistance request, to undertake the conversation task and continue the conversation with the user;
[0090] The session ending module is used to respond to the user's session ending request, end the session task from the intelligent agent and wait for the main intelligent agent to assign tasks.
[0091] For relevant details, refer to the above method embodiment.
[0092] Figure 4 4 is a block diagram of an electronic device provided by an embodiment of the present application. The device at least includes a processor 401 and a memory 402.
[0093] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0094] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, which is used to be executed by the processor 401 to implement the session state management method of the multi-agent system provided in the method embodiment of the present application.
[0095] In some embodiments, the electronic device may further optionally include: a peripheral device interface and at least one peripheral device. The processor 401, the memory 402 and the peripheral device interface may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface via a bus, a signal line or a circuit board. Schematically, the peripheral devices include but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply.
[0096] Of course, the electronic device may also include fewer or more components, which is not limited in this embodiment.
[0097] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the session state management method of a multi-agent system of the above method embodiment.
[0098] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the session state management method of a multi-agent system of the above-mentioned method embodiment.
[0099] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0100] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for managing a session state of a multi-agent system, characterized in that: The method comprises: In a multi-agent system, define one agent as the master agent and the other agents as slave agents; In response to a user's session start requirement, the master agent specifies a slave agent for the user according to the user's session start requirement; The slave agent accepts the designation of the master agent, undertakes the conversation task and continues the conversation with the user, and during the conversation, determines whether to send an assistance request to the master agent according to the content of the user conversation; The master agent designates another slave agent for the user to take over the slave agent that issued the assistance request according to the assistance request, and the slave agent takes over the conversation task and continues the conversation with the user; during the user's conversation, the conversation state memory is used to record the previous and current conversation states; after the new slave agent takes over the conversation task and continues the conversation with the user, it determines whether it is necessary to issue an assistance request to the master agent according to the user's conversation content during the conversation; the master agent re-designates a new slave agent according to the new assistance request, and through the setting of the session state memory, all conversation inputs do not pass through the master agent, but directly enter the newly designated slave agent; In response to the user's request to end the session, the slave agent ends the session task and waits for the master agent to assign tasks.
2. The method for managing the session state of a multi-agent system according to claim 1, characterized in that: Defining one agent as the master agent and other agents as slave agents in a multi-agent system includes: The system prompts the master agent to be designated as the session entry of the multi-agent system and to perform the following tasks: According to the user's session opening requirements, a slave agent is designated to handle the session requirements, and the master agent can only designate one slave agent in each round; Coordinate the cooperation relationship between the slave agents and transmit feedback information of the slave agents; Intervene in user conversations and assist other slave agents in collecting interaction information in the conversation.
3. The method for managing the session state of a multi-agent system according to claim 2, characterized in that: Defining one agent as the master agent and other agents as slave agents in a multi-agent system includes: For the main agent, the multimodal large model completes the construction of the main agent through a binding routing tool; The routing tool is a tool used by the master agent to specify the slave agent. The routing tool can generate the slave agent's identifier and additional information to be transmitted to the slave agent based on the user's session opening requirements and the slave agent's capabilities.
4. The method for managing the session state of a multi-agent system according to claim 1, characterized in that: Defining one agent as the master agent and other agents as slave agents in a multi-agent system includes: The slave agent is designated as the agent that handles specific tasks in the multi-agent system through system prompts, and is asked to perform the following tasks: Accept the designation of the master agent, undertake the conversation task and continue the conversation with the user; During the conversation, judging whether it is necessary to feed back information requiring assistance from other slave agents to the master agent according to the content of the user's conversation; Receive the information of other slave agents forwarded by the master agent and continue the conversation task.
5. The method for managing the session state of a multi-agent system according to claim 4, characterized in that: Defining one agent as the master agent and other agents as slave agents in a multi-agent system includes: For the slave agent, the multimodal large model completes the construction of the slave agent by binding business tools, information feedback tools and exit mechanism tools; The business tools are a set of tools required by the agent to handle specific conversation requirements, which are determined by the specific business; The information feedback tool is a tool for requesting the master agent to coordinate other slave agents to assist when the slave agent cannot handle the current session requirements; The exit mechanism tool is a tool for forcibly exiting the dialogue when the slave agent is unable to handle the conversation requirements and needs to actively hand over the conversation control.
6. A session state management device for a multi-agent system, characterized in that: include: The agent definition module is used to define an agent as the master agent and other agents as slave agents in a multi-agent system; A session start module, configured to respond to a user's session start requirement, wherein the master agent specifies a slave agent for the user according to the user's session start requirement; An agent dialogue module is used for the slave agent to accept the designation of the master agent, undertake the conversation task and continue the conversation with the user, and determine whether to send an assistance request to the master agent according to the user conversation content during the conversation; The agent switching module is used for the master agent to designate another slave agent to take over the slave agent that issued the assistance request according to the assistance request, to take over the conversation task and continue the conversation with the user; during the user's conversation, the conversation state memory is used to record the previous and current conversation states; after the new slave agent takes over the conversation task and continues the conversation with the user, it is determined whether it is necessary to issue an assistance request to the master agent according to the user's conversation content during the conversation; the master agent re-designates a new slave agent according to the new assistance request, and through the setting of the session state memory, all conversation inputs do not pass through the master agent, but directly enter the newly designated slave agent; The session ending module is used to respond to the user's session ending request, and the slave agent ends the session task and waits for the master agent to assign tasks.
7. An electronic device, characterized in that: The device includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a session state management method for a multi-agent system as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The storage medium stores a program, which, when executed by a processor, is used to implement a session state management method for a multi-agent system as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-machine cooperation method, scheduling device and multi-machine cooperation system
CN115437360A
Method for realizing large-scale language model training through computing power of intelligent computing center
CN119179901A