A Multi-Agent Cooperative Task Planning Method, System, Device, and Storage Medium

By building an asynchronous communication framework and LLM language model to optimize task allocation decisions, the performance bottlenecks and local optimization problems of the traditional multi-agent collaborative architecture are solved, efficient and flexible task planning and decision-making are achieved, and the reliability and adaptability of the system are improved.

CN119917319BActive Publication Date: 2025-07-08XIAMEN YUANTING INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510406772.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-07-08
Estimated Expiration
2045-04-02

AI Technical Summary

Technical Problem

In complex scenarios, traditional multi-agent collaborative architectures have problems such as performance bottlenecks of central controllers, single-point failure risk, local optimization between agents and task conflicts, making it difficult to efficiently handle complex tasks.

Method used

Build an asynchronous communication framework, combine event-driven models and message buffer queues, use LLM language model and predefined behavior rules to optimize task allocation decisions through an exception redecision mechanism, and realize asynchronous communication and efficient decision-making between agents.

Benefits of technology

It improves the reliability, efficiency and flexibility of multi-agent collaborative task planning, can quickly handle routine tasks and deal with complex anomalies, enhances the robustness and adaptability of the system, and supports business scenarios of different sizes and complexities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917319B_ABST
    Figure CN119917319B_ABST
Patent Text Reader

Abstract

The present invention provides a multi-agent collaborative task planning method, system, device and storage medium, including: constructing an asynchronous communication framework, responding to task events through an event-driven model, and decoupling the production and consumption of task events by using a message buffer queue; performing conditional matching on task events based on predefined behavior rules, if the matching is successful, commanding the agent to execute the action corresponding to the rule, otherwise marking the task event as an unmatched task and transmitting it to the LLM language model; loading the historical process data of the unmatched task into the historical message context of the LLM language model, generating a task allocation decision in combination with a guiding template, and optimizing the task allocation decision through an exception re-decision mechanism to obtain a decision result; distributing the decision result to the corresponding agent for execution, and updating the context data of the task event and the predefined behavior rules in real time. The present invention can significantly improve the reliability, efficiency and flexibility of task execution, and is applicable to various complex business scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multi-agent collaborative technologies, and particularly to a multi-agent collaborative task planning method, system, device, and storage medium. Background Art

[0002] In the field of multi-agent system collaborative task management, with the increase in task complexity and the number of agents, many problems have gradually emerged in traditional architecture mechanisms. In the early centralized collaborative architecture, all agents communicate and task allocate through a central controller. This method can still operate in small-scale scenarios. However, when the number of agents increases, the performance bottleneck of the central controller becomes prominent, the task processing efficiency is low, and there is a risk of single-point failure. Once the central controller fails, the entire system may collapse.

[0003] Although the direct collaborative architecture avoids the bottleneck problem of the central controller, the direct communication between agents lacks a global perspective, making it difficult to perform effective overall planning, easily falling into local optima, with frequent task conflicts, resulting in low task execution efficiency and difficulty in dealing with complex and changing task scenarios.

[0004] With the development of artificial intelligence technology, large language models (LLMs) have shown great potential in natural language processing and intelligent decision-making. Introducing LLMs into multi-agent collaborative task planning and combining with a rule engine are expected to overcome the defects of traditional architectures. However, how to efficiently integrate LLMs and the rule engine to build a stable, efficient, and flexible multi-agent collaborative task planning system remains an urgent problem to be solved.

[0005] In view of this, the present invention proposes a multi-agent collaborative task planning method, system, device, and storage medium, which can provide a better solution for multi-agent collaborative task planning in complex business scenarios. Summary of the Invention

[0006] To solve the problems such as local optima or conflicts that easily occur in direct communication and collaboration between agents in complex scenarios, the present invention provides a multi-agent collaborative task planning method, system, device, and storage medium to solve the above technical defect problems.

[0007] In a first aspect, the present invention proposes a multi-agent collaborative task planning method, which includes the following steps:

[0008] S1. Construct an asynchronous communication framework, respond to task events through an event-driven model, and decouple the production and consumption of task events using a message buffer queue to achieve asynchronous communication between the central controller and multiple agents;

[0009] S2. Conditionally match the task event based on predefined behavior rules. If the match is successful, command the agent to execute the action corresponding to the rule. Otherwise, mark the task event as an unmatched task and transmit the unmatched task to the LLM language model;

[0010] S3. Load the historical process data of the unmatched task into the historical message context of the LLM language model, generate a task assignment decision in combination with the guiding template, and optimize the task assignment decision through an exception re - decision mechanism to obtain the decision result;

[0011] S4. Distribute the decision result to the corresponding agent for execution, and update the context data of the task event and the predefined behavior rules in real - time.

[0012] Preferably, in step S1, the task event is responded to through an event - driven model, where the event - driven model includes: an event producer, an event distributor, and an event consumer;

[0013] The event producer generates a task event and passes the task event to the event distributor;

[0014] The event distributor distributes the task event to the corresponding agent based on the type of the task event;

[0015] The event consumer calls the rule library for condition matching or calls the LLM language model for task decision - making, and feeds back the processing result to the context data of the task event.

[0016] Preferably, the task events include task start, exception trigger, decision completion, and multi - agent collaboration messages.

[0017] Preferably, in step S3, loading the historical process data of the unmatched task into the historical message context of the LLM language model and generating a task assignment decision in combination with the guiding template specifically includes the following sub - steps:

[0018] S31. Dynamically load the LLM language model configuration and load the historical process data of the unmatched task into the historical message context of the LLM language model;

[0019] S32. Call a preset guiding model according to the task type of the unmatched task to generate a task assignment decision, where the guiding template includes descriptions of the responsibilities of agent members and structured instructions for task assignment.

[0020] Preferably, in step S3, optimizing the task assignment decision through an exception re - decision mechanism to obtain the decision result includes:

[0021] Judge whether the task assignment decision belongs to an abnormal situation. If it does, trigger the exception re - decision mechanism and optimize it through the following expression:

[0022]

[0023] In the formula, represents the optimized decision result, represents the corrected context in abnormal situations; H represents the task historical process data, which is used as the context input; represents the guidance template optimized for abnormal situations.

[0024] Preferably, in step S1, it further includes: creating a coroutine task using the asyncio library, and scheduling task events for execution using a single-threaded event loop.

[0025] Preferably, in step S2, condition matching is performed on the task event based on predefined behavior rules. If the matching is successful, the agent is commanded to execute the action corresponding to the rule. It further includes:

[0026] S21. Define a rule engine class, and receive the predefined behavior rules during initialization;

[0027] S22. Traverse each predefined behavior rule and check whether the task event meets the conditions of the rule;

[0028] S23. If the task event meets the conditions of the rule, command the agent to execute the action corresponding to the rule and end the processing of the current task event.

[0029] In the second aspect, the present invention proposes a multi-agent collaborative task planning system, which includes:

[0030] An asynchronous communication interface module, configured to build an asynchronous communication framework, respond to task events through an event-driven model, decouple the production and consumption of task events using a message buffer queue, and realize asynchronous communication between the central controller and multiple agents;

[0031] A rule engine module, which performs condition matching on task events based on predefined behavior rules. If the matching is successful, the agent is commanded to execute the action corresponding to the rule. Otherwise, the task event is marked as an unmatched task, and the unmatched task is transmitted to the LLM language model;

[0032] An LLM decision assistance module, configured to load the historical process data of the unmatched task into the historical message context of the LLM language model, generate a task allocation decision in combination with the guidance template, and optimize the task allocation decision through an exception re-decision mechanism to obtain a decision result;

[0033] An agent execution module, configured to distribute the decision result to the corresponding agent for execution, and update the context data of the task event and the predefined behavior rules in real time.

[0034] In a third aspect, the present invention proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the multi-agent collaborative task planning method as described in any one of the above are implemented.

[0035] In a fourth aspect, the present invention proposes a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the multi-agent collaborative task planning method as described in any one of the above are implemented.

[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0037] (1) Solving the defects of traditional architectures: By constructing an asynchronous communication framework and combining an event-driven model and a message buffer queue, the present invention effectively solves the problems of the performance bottleneck and single-point failure risk of the central controller in the traditional centralized collaborative architecture, as well as the local optimality or conflict problems caused by direct communication between agents in the direct collaborative architecture, significantly improving the reliability and efficiency of multi-agent collaborative task planning.

[0038] (2) Efficient task processing and decision-making: Through the collaborative work of predefined behavior rules and the LLM language model, the present invention can quickly process regular tasks, and at the same time utilize the powerful intelligent decision-making ability of the LLM language model to process complex tasks and abnormal situations. This combination method not only improves the speed of task processing but also enhances the accuracy and intelligence level of decision-making.

[0039] (3) Dynamic adaptation and optimization: The present invention introduces an abnormal re-decision mechanism, which can automatically trigger a re-decision process when an abnormal situation is detected. Combining the corrected context and the optimized guidance template, it intelligently adjusts and optimizes the task allocation decision, ensuring that the task can be smoothly executed and completed, and improving the robustness and adaptability of the system.

[0040] (4) Real-time update and optimization: By real-time updating the context data of task events and predefined behavior rules, the present invention ensures that agents can make decisions based on the latest information and rules when executing tasks, supports dynamic adjustment of task execution strategies, and improves the flexibility and efficiency of task execution.

[0041] (5) Flexible expansion and integration: The system architecture proposed by the present invention has high scalability, can easily integrate new agents and task types, adapt to business scenarios of different scales and complexities, and provides convenience for future system upgrades and expansions. Description of the Drawings

[0042] Other features, objects, and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments read with reference to the accompanying drawings:

[0043] Figure 1 is a schematic diagram of a multi-agent asynchronous communication and centralized collaboration architecture according to the present invention;

[0044] Figure 2 is a flowchart of a multi-agent collaborative task planning method according to the present invention;

[0045] Figure 3 is a schematic diagram of the interaction between the producer-consumer model and the message queue in the asynchronous communication framework according to the present invention;

[0046] Figure 4 is a schematic diagram of the structure of a computer system of an electronic device suitable for implementing the embodiments of the present application. Detailed Embodiments

[0047] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only for explaining the related invention and not for limiting the invention. Additionally, it should be noted that for the sake of description, only parts related to the relevant invention are shown in the drawings.

[0048] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the drawings and embodiments.

[0049] Figure 1 shows a schematic diagram of a multi-agent asynchronous communication and centralized collaboration architecture of the present invention, Figure 2 shows a flowchart of a multi-agent collaborative task planning method of the present invention. With reference to Figure 1 and Figure 2 , a multi-agent collaborative task planning method proposed by the present invention includes the following steps:

[0050] S1. Construct an asynchronous communication framework, respond to task events through an event-driven model, and use a message buffer queue to decouple the production and consumption of task events, so as to achieve asynchronous communication between the central controller and multiple agents (schematically represented by Agent in the drawings, and similar expressions will be used hereinafter; Agent intelligent agent).

[0051] In this embodiment, the event-driven model is used to respond to various task events in the system (such as task start, exception trigger, decision completion, multi-agent collaboration message, etc.). Its core components include: event producer, event distributor, and event consumer.

[0052] Among them, the event producer is responsible for generating task events (such as task requests, exception signals, etc.) and passing the task events to the event dispatcher;

[0053] The event dispatcher is used to accept the task events generated by the time producer and distribute the task events to the corresponding agents based on the type of the task events;

[0054] The event consumer is responsible for processing the task time, calling the rule base for condition matching or calling the LLM language model for task decision-making, and feeding back the processing result to the context data of the task event.

[0055] It should be understood that all agents and the task collaborative planning modules (rule base, LLM language model) can act as producers and consumers of events (messages).

[0056] Figure 3 The schematic diagram of the interaction between the producer-consumer model and the message queue in the asynchronous communication framework of the present invention is shown, as Figure 3 shown, the message buffer queue is used to decouple the event producer and the consumer, ensuring the stability and reliability of the system in high-concurrency scenarios. Its core features include:

[0057] Asynchronous communication: Realize asynchronous communication between the event producer and the event consumer through the message queue, avoiding task blocking.

[0058] Message persistence: Ensure that messages will not be lost in case of system exceptions or restarts.

[0059] Priority management: Support sorting messages according to task priorities to ensure that high-priority tasks are processed first.

[0060] In step S1, it also includes: creating a coroutine task through asyncio.create_task (a function in the Python asyncio library) to achieve non-blocking task execution. A coroutine is a concurrent mechanism within a single thread, and tasks are scheduled through an event loop, avoiding the overhead of thread switching. The memory occupation of each coroutine is usually between a few KB and dozens of KB.

[0061] Continue to refer to Figure 1 and Figure 2 , a multi-agent collaborative task planning method proposed by the present invention further includes the following steps:

[0062] S2. Conditionally match the task event based on predefined behavior rules. If the match is successful, command the agent to execute the action corresponding to the rule; otherwise, mark the task event as an unmatched task and transmit the unmatched task to the LLM language model. That is, all task events are first planned by predefined behavior rules, and tasks not planned by the predefined behavior rules are decided by the LLM language model.

[0063] In this embodiment, conditionally match the task event based on predefined behavior rules. If the match is successful, command the agent to execute the action corresponding to the rule, which specifically includes the following sub-steps:

[0064] S21. Define a rule engine class through Python code and receive the predefined behavior rules during initialization;

[0065] S22. Traverse each predefined behavior rule and check whether the task event meets the conditions of the rule;

[0066] S23. If the task event meets the conditions of the rule, command the agent to execute the action corresponding to the rule (for example: directly assign the agent to handle routine tasks and forward the tasks that cannot be decided to the LLM language model) and end the processing of this task event.

[0067] S3. Load the historical process data of the unmatched task into the historical message context of the LLM language model, generate a task assignment decision in combination with the prompt template, and optimize the task assignment decision through the exception re-decision mechanism (indicated by planning in the attached figure; planning for planning), and obtain the decision result;

[0068] S4. Distribute the decision result to the corresponding agent for execution and update the context data of the task event and the predefined behavior rules in real time.

[0069] In step S3, load the historical process data of the unmatched task into the historical message context of the LLM language model and generate a task assignment decision in combination with the prompt template, which specifically includes the following sub-steps:

[0070] S31. Dynamically load the LLM language model configuration and load the historical process data of the unmatched task into the historical message context of the LLM language model;

[0071] S32. Call the preset prompt model according to the task type of the unmatched task to generate a task assignment decision, where the prompt template includes the description of the responsibilities of the agent members and the structured instructions for task assignment.

[0072] Optimize the task assignment decision through the exception re-decision mechanism to obtain the decision result, including:

[0073] Determine whether the task assignment decision belongs to an abnormal situation. If so, trigger the abnormal re - decision mechanism and optimize it through the following expression:

[0074]

[0075] In the formula, represents the optimized decision result, represents the corrected context in the abnormal situation; H represents the task historical process data, which is used as the context input; represents the guidance template optimized for the abnormal situation.

[0076] The abnormal re - decision mechanism means that the collaboration module splits the task into multiple subtasks and assigns them to different agents for execution. Each agent will receive the corresponding subtask requirements:

[0077] <Agent>: <Subtask requirement>.

[0078] The LLM language model evaluates whether the task has achieved the expected goal based on the execution results returned by the agent. If the expected goal is not achieved or the agent returns an error, the collaborative planning module (indicated by "planning" in the attached figure; "planning" for planning) will use the LLM language model to understand the intention of the current task state and re - plan the subtask assignment to ensure the smooth completion of the task.

[0079] Among them, whether it belongs to an abnormal situation is judged by the LLM language model based on the execution results of the agent's subtasks.

[0080] In the second aspect, the present invention proposes a multi - agent collaborative task planning system, which includes:

[0081] An asynchronous communication interface module, configured to build an asynchronous communication framework, respond to task events through an event - driven model, decouple the production and consumption of task events using a message buffer queue, and realize asynchronous communication between the central controller and multiple agents;

[0082] A rule engine module, which performs condition matching on task events based on predefined behavior rules. If the match is successful, it commands the agent to execute the actions corresponding to the rules. Otherwise, it marks the task event as an unmatched task and transmits the unmatched task to the LLM language model;

[0083] An LLM decision - making assistance module, configured to load the historical process data of the unmatched task into the historical message context of the LLM language model, generate a task assignment decision in combination with the guidance template, and optimize the task assignment decision through the abnormal re - decision mechanism to obtain the decision result;

[0084] The agent execution module is configured to distribute the decision results to the corresponding agents for execution, and to update the context data of task events and predefined behavior rules in real time.

[0085] The present invention proposes an asynchronous centralized collaboration + LLM decision assistance + predefined behavior rule fusion framework. By combining the intelligent decision-making ability of the large language model with the efficient rule processing ability of the rule engine, it realizes the task collaboration optimization in complex scenarios. Based on the coroutine mechanism and message buffer queue of asyncio, it solves the task processing bottleneck in high-concurrency scenarios. Through the exception handling process, it significantly improves the robustness of the system and the quality of collaborative task completion. Through historical context loading and customized prompt templates, it realizes the personalization and precision of collaborative task decision-making. By using the rule engine to process regular tasks, it reduces the load of the LLM module and improves the overall efficiency of the system.

[0086] In a third aspect, the present invention proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the multi-agent collaborative task planning method as described in any one of the above.

[0087] In a fourth aspect, the present invention proposes a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the steps of the multi-agent collaborative task planning method as described in any one of the above.

[0088] Next, refer to Figure 4 , which shows a schematic structural diagram of a computer system 400 of a terminal device or a server suitable for implementing the embodiments of the present application. Figure 4 The shown terminal device or server is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present application.

[0089] As Figure 4 shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage section 408 into the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the computer system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other through a bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.

[0090] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as required. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 410 as required so that a computer program read therefrom is installed into the storage section 408 as required.

[0091] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above-described functions defined in the methods of the present application are performed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium, a computer-readable medium, or any combination of the two. The computer-readable medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable medium, and the computer-readable medium can send, propagate, or transmit a program for use by or combined with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0092] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as C or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0093] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0094] The above description is only a preferred embodiment of this application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, technical solutions formed by mutually replacing the above features with (but not limited to) technical features having similar functions disclosed in this application.

Claims

1. A multi-agent collaborative task planning method, characterized in that, It includes the following steps: S1. Build an asynchronous communication framework, respond to task events through an event-driven model, and decouple the production and consumption of task events using a message buffer queue to achieve asynchronous communication between the central controller and multiple agents; S2. Perform conditional matching on the task event based on predefined behavior rules. If the match is successful, command the agent to execute the action corresponding to the rule. Otherwise, mark the task event as an unmatched task and transmit the unmatched task to the LLM language model; In step S2, when performing conditional matching on the task event based on predefined behavior rules and if the match is successful, commanding the agent to execute the action corresponding to the rule, it further includes: S21. Define a rule engine class that receives predefined behavior rules during initialization; S22. Traverse each predefined behavior rule and check whether the task event meets the conditions of the rule; S23. If the task event meets the conditions of the rule, command the agent to execute the action corresponding to the rule and end the processing of the current task event; S3. Load the historical process data of the unmatched task into the historical message context of the LLM language model, generate a task assignment decision in combination with a guiding template, and optimize the task assignment decision through an exception re-decision mechanism to obtain a decision result; In step S3, when loading the historical process data of the unmatched task into the historical message context of the LLM language model and generating a task assignment decision in combination with a guiding template, it specifically includes the following sub-steps: S31. Dynamically load the LLM language model configuration and load the historical process data of the unmatched task into the historical message context of the LLM language model; S32. Call the preset guiding template according to the task type of the unmatched task to generate a task assignment decision, where the guiding template includes descriptions of the responsibilities of agent members and structured instructions for task assignment; S4. Distribute the decision result to the corresponding agent for execution and update the context data of the task event and the predefined behavior rules in real time; The LLM language model evaluates whether the task has achieved the expected goal based on the execution result returned by the agent. If the expected goal is not achieved or the agent returns an error, the LLM language model performs intention understanding on the current task status and re-plans the subtask assignment.

2. The multi-agent collaborative task planning method according to claim 1, wherein In step S1, respond to task events through an event-driven model, where the event-driven model includes: an event producer, an event distributor, and an event consumer; The event producer generates task events and passes the task events to the event distributor; The event distributor distributes the task events to the corresponding agents based on the type of the task event; The event consumer calls the rule library for conditional matching or calls the LLM language model for task decision-making and feeds back the processing result to the context data of the task event.

3. The multi-agent collaborative task planning method according to claim 2, wherein The task events include task startup, exception trigger, decision completion, and multi-agent collaboration messages.

4. The multi-agent collaborative task planning method according to claim 1, characterized in that In step S3, optimize the task assignment decision through an exception re-decision mechanism to obtain a decision result, including: Determine whether the task assignment decision belongs to an abnormal situation. If so, trigger the abnormal re - decision mechanism and optimize it through the following expression: In the formula, represents the optimized decision result, represents the corrected context in abnormal situations; H represents the task historical process data, which is used as context input; represents the guidance template optimized for abnormal situations.

5. The multi-agent collaborative task planning method according to claim 1, wherein In step S1, it further includes: creating a coroutine task using the asyncio library and scheduling the execution of the task event using a single - thread event loop.

6. A multi-agent collaborative task planning system, characterized in that, The system includes: An asynchronous communication interface module, configured to build an asynchronous communication framework, respond to task events through an event - driven model, decouple the production and consumption of task events using a message buffer queue, and achieve asynchronous communication between the central controller and multiple agents; A rule engine module, which performs condition matching on the task event based on predefined behavior rules. If the match is successful, it commands the agent to execute the action corresponding to the rule. Otherwise, it marks the task event as an unmatched task and transmits the unmatched task to the LLM language model; In the rule engine module, when performing condition matching on the task event based on predefined behavior rules, if the match is successful and it commands the agent to execute the action corresponding to the rule, it further includes: S21. Define a rule engine class and receive predefined behavior rules during initialization; S22. Traverse each predefined behavior rule and check whether the task event meets the conditions of the rule; S23. If the task event meets the conditions of the rule, command the agent to execute the action corresponding to the rule and end the processing of the current task event; An LLM decision - making assistance module, configured to load the historical process data of the unmatched task into the historical message context of the LLM language model, generate a task assignment decision in combination with a guidance template, and optimize the task assignment decision through an abnormal re - decision mechanism to obtain a decision result; In the LLM decision - making assistance module, when loading the historical process data of the unmatched task into the historical message context of the LLM language model and generating a task assignment decision in combination with a guidance template, it specifically includes the following sub - steps: S31. Dynamically load the LLM language model configuration and load the historical process data of the unmatched task into the historical message context of the LLM language model; S32. Call the preset guidance template according to the task type of the unmatched task to generate a task assignment decision, where the guidance template includes descriptions of the responsibilities of agent members and structured instructions for task assignment; An agent execution module, configured to distribute the decision result to the corresponding agent for execution and update the context data of the task event and the predefined behavior rules in real - time; The LLM language model evaluates whether the task has achieved the expected goal based on the execution result returned by the agent. If the expected goal is not achieved or the agent returns an error, the LLM language model understands the intention of the current task state and re - plans the subtask assignment.

7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the multi - agent collaborative task planning method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the multi - agent collaborative task planning method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multi-agent cooperation method and system

    CN118917632A