Memory enhancement and task planning method and system for large model multi-agent

By constructing an external memory bank and a closed-loop learning mechanism, the problem of lack of historical experience guidance in planning in large-scale multi-agent systems is solved, achieving efficient and self-optimizing task planning and improving the planning quality and execution efficiency of the system.

CN121543629BActive Publication Date: 2026-03-24XIAMEN YUANTING INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-19
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing large-scale multi-agent systems lack historical experience guidance in task planning, making it impossible to accumulate and reuse experiential knowledge. This leads to a disconnect between planning and execution, resulting in unstable planning quality, resource waste, and low efficiency.

Method used

An external memory is built, and planning experience and abstract patterns are extracted through structured parsing of historical task data to generate an initial task planning scheme. The execution status is monitored to record deviations, and the planning rules are updated based on the deviations to form a closed-loop learning process.

Benefits of technology

It significantly improves the quality and efficiency of initial planning, enables the continuous accumulation and self-evolution of system knowledge, ensures the contextual adaptability of planning solutions, and enhances the ability to handle cross-domain tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543629B_ABST
    Figure CN121543629B_ABST
Patent Text Reader

Abstract

The application discloses a memory enhancement and task planning method and system for large model multi-agent. The method comprises the following steps: structurally analyzing historical task data, extracting planning experience and abstract mode, and constructing and indexing an external memory library; retrieving relevant experience and mode from the memory library based on a new task description, and generating a memory-enhanced task planning book; distributing the planning scheme to a multi-agent network for execution, monitoring and recording the actual execution trajectory, and calculating the deviation of the actual execution trajectory from the planning expectation; evaluating the planning scheme based on the execution result and the deviation, refining the planning correction rules, and updating the task experience and rules of this time to the memory library. By introducing the external memory and closed-loop learning mechanism which can dynamically evolve, the application solves the problems of lack of experience guidance in existing system planning, inability to deposit and reuse knowledge, and disconnection between planning and execution, and significantly improves the planning quality, system reusability and self-adaptive optimization capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence and multi-agent collaboration technology, specifically to a memory enhancement and task planning method and system for large-scale multi-agent models. Background Technology

[0002] With breakthroughs in the capabilities of Large Language Models (LLMs), LLM-based agents and their multi-agent collaborative systems have become a cutting-edge paradigm for solving complex tasks. These systems, through prompting engineering, guide multiple agents playing different roles to engage in dialogue, planning, and collaboration to accomplish tasks that are difficult for a single agent to handle, such as complex project planning and cross-domain problem solving.

[0003] However, existing multi-agent task planning techniques based on large models have the following fundamental defects and shortcomings:

[0004] (1) The lack of historical experience in the planning phase leads to a waste of intellectual resources by "starting from scratch": When faced with new tasks, the task decomposition and planning modules of existing systems can usually only plan based on predefined static prompts or limited real-time context. This is similar to an experienced team not being allowed to refer to any past project plans and summary reports when executing a new project. As a result, the planning quality is highly unstable, and problems such as redundant steps, omission of key links, and unreasonable division of roles are prone to occur, which seriously affect the efficiency and success rate of subsequent execution.

[0005] (2) Experience and knowledge cannot be accumulated and reused at the system level: Even if a multi-agent system successfully completes a complex task, the valuable experience generated in the process, including procedural knowledge such as task decomposition logic, role collaboration patterns, and problem-solving paths, dissipates immediately after the task ends. The system lacks an effective mechanism to store these successful strategic blueprints or lessons learned from failures for future reference when performing similar tasks. This results in the overall capability of the system failing to continuously evolve through practical accumulation, with each task becoming an independent event, causing a huge waste of computing power and time.

[0006] (3) Planning and execution are disconnected, lacking a self-optimizing closed loop: The planning of existing systems is often one-off and unidirectional. Once the planning scheme is generated, it is delivered for execution. Regardless of whether the execution result is successful or not, the planning itself cannot be systematically evaluated, diagnosed, and corrected. When execution fails due to improper planning, the system can usually only simply regenerate a new plan that may also have the same defects, instead of accurately diagnosing the specific defects of the plan from the failure (such as misjudging task dependencies or underestimating the complexity of subtasks), and absorbing this "planning counterexample" as knowledge, thus falling into a low-level cycle of trial and error.

[0007] Existing large-scale multi-agent systems suffer from significant shortcomings in task planning, particularly in terms of experience utilization, knowledge accumulation, and continuous optimization. The core issue lies in the lack of a memory mechanism capable of systematically storing, retrieving, and utilizing historical planning experience, as well as a framework that links planning, execution, and outcome analysis to form a learning loop. This severely restricts the ability of multi-agent systems to perform tasks autonomously and reliably in complex and dynamic environments over extended periods.

[0008] Therefore, there is an urgent need in this field for a new multi-agent task planning method that can overcome the above-mentioned shortcomings and achieve experience accumulation, intelligent planning and self-evolution. Summary of the Invention

[0009] To address the problems in existing multi-agent system planning, such as lack of historical experience guidance, inability to retain and reuse knowledge, and the inability to self-optimize due to the disconnect between planning and execution, this invention provides a memory enhancement and task planning method and system for large-scale multi-agent systems, thereby resolving the aforementioned technical deficiencies.

[0010] This invention proposes a memory enhancement and task planning method for large-scale multi-agent models, which includes the following steps:

[0011] S1. Perform structured analysis on historical multi-agent task data, extract planning experience and abstract patterns, and build and index an external memory bank.

[0012] S2. Based on the description of the new task, retrieve relevant planning experience and planning patterns from the external memory bank, and generate a task planning document based on the retrieval results as the initial task planning scheme for memory enhancement.

[0013] S3. Distribute the initial task planning scheme to the multi-agent network for execution, monitor the execution status to record the actual execution trajectory, and calculate the deviation between the actual execution trajectory and the planning expectation.

[0014] S4. Based on the deviation between the execution results obtained in step S3 and the records, evaluate the initial task planning scheme, extract planning correction rules based on the evaluation results, and update the experience of this task and the planning correction rules to the external memory bank.

[0015] Preferably, in step S1, the historical multi-agent task data is structured and parsed to extract planning experience and abstract patterns in order to construct and index the external memory database. This specifically includes the following sub-steps:

[0016] S11. Analyze historical multi-agent task data and extract structured information to construct planning experience units. The planning experience units include task objectives, task decomposition structure, role-subtask mapping, and evaluation results.

[0017] S12. Input multiple planning experience units into a large model for analysis, and summarize them to form a reusable planning pattern template.

[0018] S13. Construct an external memory bank, specifically including: vectorizing the text of planning experience units and planning pattern templates and constructing a vector database, storing the task metadata associated with planning experience units and planning pattern templates into a relational database, and constructing a hybrid index on the vector database and the relational database.

[0019] More preferably, in step S2, based on the description of the new task, relevant planning experience and planning patterns are retrieved from the external memory bank, and a memory-enhanced initial task planning scheme is generated based on the retrieval results, specifically including the following sub-steps:

[0020] S21. Based on the description vector of the new task, retrieve semantically similar planning experience units from the vector database of the external memory, and filter out matching planning pattern templates from the relational database of the external memory according to the metadata of the new task.

[0021] S22. Based on the retrieved planning experience units and planning pattern templates, generate one or more candidate planning sketches through the planning agent, and pre-evaluate the candidate planning sketches.

[0022] S23. Based on the pre-evaluation results, select a planning sketch from the candidate planning sketches. The planning agent, in conjunction with the capability profile of the currently available agents, dynamically fine-tunes the role division and task allocation in the selected planning sketch, generates and outputs a task planning document, and uses the task planning document as the initial task planning scheme for memory enhancement.

[0023] In a further preferred embodiment, in step S22, the candidate planning sketches are pre-evaluated, specifically by scoring and ranking multiple candidate planning sketches based on the historical success rate of the planning experience unit on which each candidate planning sketch depends, and the matching degree between the resources required by the candidate planning sketch and the available resources of the current multi-agent network.

[0024] Preferably, in step S3, the initial task planning scheme is distributed to the multi-agent network for execution, the execution status is monitored to record the actual execution trajectory, and the deviation between the actual execution trajectory and the planned expectation is calculated. Specifically, this includes the following sub-steps:

[0025] S31. Based on the role definitions in the task planning document, assign the subtasks to the corresponding agent instances for execution;

[0026] S32. Monitor and record the interactions, tool calls, and state changes of each agent during the execution of sub-tasks to form the actual execution trajectory;

[0027] S33. Compare the actual execution trajectory with the expected trajectory in the task plan, and trigger an alarm when the deviation exceeds the threshold.

[0028] Preferably, in step S4, the initial task planning scheme is evaluated based on the deviation between the execution result obtained in step S3 and the recorded result. Planning correction rules are then extracted based on the evaluation results, and the experience and planning correction rules of this task are updated to the external memory. This specifically includes the following sub-steps:

[0029] S41. Based on the task completion rate, resource consumption ratio, and time deviation rate between the actual execution trajectory and the planned expectation, the initial task planning scheme is quantitatively evaluated to obtain an efficiency score.

[0030] S42. If the performance score is lower than the preset threshold, compare the task plan with the actual execution trajectory to locate planning defects, and generate structured planning correction rules based on the defects.

[0031] S43. Construct the task plan and actual execution trajectory of this task into a new planning experience unit and store it in the external memory bank, and associate the planning correction rules with the relevant planning pattern templates or planning experience units in the external memory bank.

[0032] More preferably, in step S42, the structured planning correction rule is as follows: when the task objective meets specific keyword conditions and the current task plan contains specific types of sub-tasks, then the specified associated sub-tasks are added or adjusted in the task plan.

[0033] In step S43, the planning correction rule is associated with the relevant planning pattern template or planning experience unit in the external memory bank. Specifically, the triggering condition of the planning correction rule is bound to the task metadata of the relevant planning pattern template or planning experience unit so that the rule is matched first when similar tasks are executed in the future.

[0034] This invention also proposes a memory enhancement and task planning system for large-scale multi-agent models, used to implement any of the methods described above, the system comprising:

[0035] The memory building and indexing module is configured to perform structured parsing of historical multi-agent task data, extract planning experience and abstract patterns, in order to build and index an external memory.

[0036] The memory enhancement planning generation module is configured to retrieve relevant planning experience and planning patterns from an external memory bank based on the description of a new task, and generate a task planning document as the initial task planning scheme for memory enhancement based on the retrieval results.

[0037] The execution monitoring and deviation detection module is configured to distribute the initial task planning scheme to the multi-agent network for execution, monitor the execution status to record the actual execution trajectory, and calculate the deviation between the actual execution trajectory and the planning expectation.

[0038] The evaluation and closed-loop update module is configured to evaluate the initial task planning scheme based on the execution results and recorded deviations obtained from the execution monitoring and deviation detection module, extract planning correction rules based on the evaluation results, and update the experience and planning correction rules of this task to the external memory.

[0039] The present invention also proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it implements the steps of any of the above-described methods for memory enhancement and task planning for large-scale multi-agent models.

[0040] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described methods for memory enhancement and task planning for large-scale multi-agent models.

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

[0042] (1) Significantly improves the quality and efficiency of initial planning and reduces trial-and-error costs: This invention constructs a dynamically evolving external memory bank and designs an enhancement mechanism of "planning-retrieval-fusion," enabling the system to directly draw on historical successful experiences and abstract patterns when facing new tasks, effectively avoiding the intellectual waste of planning "from scratch." Compared with traditional methods that rely on static prompts, the initial task planning scheme (task planning document) generated by this invention is significantly improved in terms of step rationality, clear role division, and accurate resource estimation, thereby greatly improving the one-time planning success rate and execution efficiency of complex tasks and reducing the costs of repeated trial and error and rework caused by improper planning.

[0043] (2) Achieving continuous accumulation and reuse of system knowledge, endowing the system with self-evolution capabilities: This invention adopts a hybrid memory structure combining concrete planning experience units and abstract planning pattern templates, and designs a complete learning process of "execution monitoring - root cause analysis - rule extraction - closed-loop update". This overcomes the core defects of existing systems where experience cannot be accumulated and knowledge cannot be reused. The system can not only store the complete trajectory of each task, but also automatically extract generalizable conditions and correction rules from failure cases. This enables the system's planning intelligence to continuously accumulate and optimize as the number of tasks processed increases, possessing the continuous self-evolution and adaptability capabilities lacking in traditional multi-agent systems.

[0044] (3) Ensuring the contextual adaptability of the planning scheme and enhancing the system's cross-domain task processing capabilities: This invention achieves an intelligent upgrade of the planning scheme from experience reuse to contextual adaptation through multi-granularity memory retrieval and a dynamic adaptation strategy based on the current available agent capability profiles. The system can not only retrieve similar historical cases, but also customize and fine-tune the retrieved planning sketches by combining the specific context of the current task, available tools, and agent expertise. This ensures that the final output planning scheme has both the reliability of historical experience and the relevance to the current task environment, effectively solving the adaptation problem of rigidly applying planning schemes and failing to adapt to different situations when dealing with cross-domain and cross-team tasks, and improving the system's versatility and robustness. Attached Figure Description

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

[0046] Figure 1 This is a flowchart of a method for memory enhancement and task planning for large-scale multi-agent models;

[0047] Figure 2 This is a schematic diagram of a memory enhancement and task planning system for large-scale multi-agent models.

[0048] Figure 3 This is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present invention. Detailed Implementation

[0049] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0050] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0051] Figure 1 A flowchart illustrating a method for memory enhancement and task planning in large-scale multi-agent models is shown. (Refer to...) Figure 1 This invention proposes a memory enhancement and task planning method for large-scale multi-agent models, comprising the following steps:

[0052] S1. Perform structured analysis on historical multi-agent task data to extract planning experience and abstract patterns in order to build and index an external memory library.

[0053] This step is fundamental to the entire method, aiming to transform discrete, unstructured historical task data into a systematic and efficiently searchable external knowledge memory. Its core is learning from history, structuring successful experiences and lessons learned from failures, and extracting reusable patterns. Specifically, step S1 includes the following sub-steps:

[0054] S11. Analyze historical multi-agent task data and extract structured information to construct planning experience units.

[0055] The goal of this sub-step is to perform in-depth analysis of the complete execution record of historical tasks (including initial task descriptions, dialogues between all agents, tool call sequences, intermediate outputs, and final result logs). The system extracts key structured information from this raw data and encapsulates it into self-contained planning experience units.

[0056] Each planning experience unit is a structured data object, serving as the basic unit for storage and reuse in an external memory. In a preferred embodiment, a complete planning experience unit contains at least the following core fields:

[0057] Task Objective: Clearly describe the ultimate goal to be achieved by this historical task. For example: Create a visual sales data analysis report that includes trends and attributions.

[0058] Task decomposition structure (task decomposition tree): Records the key sub-tasks and their logical relationships in a hierarchical or sequential manner to achieve the task objective. For example: data cleaning → metric calculation → chart generation → report writing.

[0059] Role-Subtask Mapping Table: This table explicitly records in the task history which role (corresponding to an agent with specific capabilities) is responsible for performing each subtask. For example: Data Engineer agent: data cleaning; Data Analyst agent: metric calculation and chart generation; Business Analyst agent: report writing.

[0060] Tool usage sequence: Records the specific tools or APIs called during the execution of each subtask and the order in which they are called. For example: SQL query → Python pandas processing → Matplotlib plotting.

[0061] Final deliverables and evaluation: Record the final output of the task (such as a PPT report containing 5 core charts) and the quantitative or qualitative evaluation of the task performance (such as completion rate: 100%, report quality score: A).

[0062] By constructing such planning experience units, the system transforms one-off task processes into standardized knowledge blocks that can be stored long-term, analyzed independently, and referenced by subsequent tasks.

[0063] S12. Input multiple planning experience units into the large model for analysis, and summarize them into a reusable planning pattern template.

[0064] This sub-step aims to elevate knowledge by abstracting general methodologies from specific cases. The system takes multiple related planning experience units (from the same domain or with similar processes) as input and submits them to the Large Language Model (LLM) for analysis.

[0065] The task of the large model is to ignore the details of specific tasks (such as "sales data" or "user behavior data") and focus on identifying and extracting the common process framework, collaboration logic, and decision-making patterns among these cases. Based on this analysis, the large model summarizes and generates reusable planning pattern templates.

[0066] For example, by analyzing multiple planning experience units that generate data analysis reports, a general planning pattern template can be summarized from the larger model. Its framework might be: data acquisition and preprocessing → core indicator / dimensional analysis → key insight visualization → narrative summary and report formation. This template strips away specific data domains and report formats, retaining the universal solution logic for such tasks, allowing new tasks to be quickly applied to this advanced framework.

[0067] S13. Construct an external memory bank, specifically including: vectorizing the text of planning experience units and planning pattern templates and constructing a vector database, storing the task metadata associated with planning experience units and planning pattern templates into a relational database, and constructing a hybrid index on the vector database and the relational database.

[0068] This sub-step is crucial for building an efficient retrieval system. This invention employs a hybrid storage and indexing architecture to construct an external memory bank, simultaneously supporting flexible semantic similarity retrieval and precise multi-dimensional filtering queries. Specific implementation includes:

[0069] Vectorization and Vector Database Construction: Natural language description fields (such as text descriptions of task objectives and task decomposition structures) in planning experience units, as well as the complete text of planning pattern templates, are converted into high-dimensional vectors (i.e., semantic vectors) through an embedding model. All these vectors are stored in a dedicated vector database. This enables the system to quickly retrieve the most similar historical experiences or patterns based on the semantics of a new task description.

[0070] Relational database construction: Simultaneously, structured metadata of planning experience units and planning pattern templates is stored in a relational database. This metadata includes, but is not limited to: task domain (e.g., business analysis, software development), task complexity level, list of tools involved (e.g., SQL, Python), types of roles involved (e.g., data analyst, backend engineer), and historical performance evaluation results.

[0071] Building a hybrid index: The system establishes connections between vector databases and relational databases, forming a unified hybrid indexing mechanism. For example, for a planning experience unit, both vector indexes (for semantic matching) and relational index labels (e.g., domain: business analysis, tool: SQL / Python, role: data analyst) are generated simultaneously. Thus, during retrieval, the system can first quickly filter candidate sets that meet certain hard criteria (e.g., the requirement to use a certain tool) through the relational database, and then sort these candidate sets by semantic similarity through the vector database, thereby achieving efficient and accurate multi-granularity memory retrieval.

[0072] Through step S1, this invention establishes an external memory bank that is rich in content, clear in structure, and efficient in retrieval, providing strong prior knowledge support for subsequent intelligent planning and fundamentally changing the status quo of system planning "from scratch".

[0073] Continue to refer to Figure 1 The present invention proposes a memory enhancement and task planning method for large-scale multi-agent models, which further includes the following steps:

[0074] S2. Based on the description of the new task, retrieve relevant planning experience and planning patterns from the external memory bank, and generate a task planning document based on the retrieval results as the initial task planning scheme for memory enhancement.

[0075] When a new task request arrives, the core of this step lies in utilizing the existing external task memory to generate a high-quality, directly executable starting point plan for the new task, thereby effectively overcoming the shortcomings of planning "from scratch". This step is achieved through a coherent "retrieval-generation-optimization" process, specifically including the following sub-steps:

[0076] S21. Based on the description vector of the new task, retrieve semantically similar planning experience units from the vector database of the external memory, and filter out matching planning pattern templates from the relational database of the external memory according to the metadata of the new task.

[0077] This step is the starting point for memory enhancement, aiming to achieve multi-dimensional and highly efficient retrieval of prior knowledge. First, the system transforms the textual description of the new task (e.g., generating an analysis report on user behavior for this quarter's products) into a high-dimensional description vector using a pre-trained embedding model. Then, using this vector as a query condition, the system performs an approximate nearest neighbor search in the vector database of the external memory, retrieving the K most semantically similar specific planning experience units (e.g., complete experience records of historically completed sales data analysis reports). This semantic vector-based retrieval method deeply understands the task intent, and even if the new task differs superficially from historical tasks, it can find reference cases with similar connotations.

[0078] Simultaneously, the system parses the context or associated metadata of new tasks (such as the domain specified by the task, the type of tools expected to be used, and the suggested roles), and uses this as structured query conditions to perform precise filtering in the relational database of the external memory, thereby identifying one or more planning pattern templates (such as general data analysis report generation patterns) that highly match at the metadata level. Through this hybrid retrieval strategy that combines semantic similarity search with attribute condition filtering, the system can simultaneously obtain specific historical cases that can be directly referenced and abstract process frameworks that can be followed by higher-level management, providing dual knowledge support for planning generation that is both specific and general.

[0079] S22. Based on the retrieved planning experience units and planning pattern templates, generate one or more candidate planning sketches through the planning agent, and pre-evaluate the candidate planning sketches.

[0080] After the retrieval is complete, the system uses the retrieved specific planning experience units and abstract planning pattern templates as key reference cases and process guidelines, along with a complete description of the current new task, and inputs them into a dedicated planning agent (usually a large language model). The planning agent comprehensively understands the task objectives, analyzes and draws on the task decomposition structure, role division logic, and tool call sequences from historical experience, and generates one or more preliminary candidate planning sketches. For example, a sketch might draw on the experience of historical data analysis reports, planning a task flow that includes steps such as behavioral data extraction, retention funnel analysis, and visualization chart creation.

[0081] Subsequently, the system does not directly adopt these sketches but immediately conducts a rapid pre-evaluation. The core criteria for this evaluation include two main aspects: first, the historical success rate or performance evaluation score recorded by the historical planning experience units on which the sketch primarily relies and references; and second, the degree of match between the resource requirements planned in the sketch (e.g., skill requirements for specific roles, calls to specific tools or APIs) and the actual available resource status in the current multi-agent network. Based on these criteria, the system performs preliminary scoring and ranking of multiple candidate sketches, thereby selecting solutions with relatively higher feasibility.

[0082] S23. Based on the pre-evaluation results, select a planning sketch from the candidate planning sketches. The planning agent, in conjunction with the capability profile of the currently available agents, dynamically fine-tunes the role division and task allocation in the selected planning sketch, generates and outputs a task planning document, and uses the task planning document as the initial task planning scheme for memory enhancement.

[0083] Based on the ranking results generated from the pre-evaluation, the system selects the candidate planning sketch with the best evaluation as the basis for further optimization. Next, the planning agent performs key context adaptation operations. It does not mechanically copy the original sketch, but rather combines the real-time capability profiles of each available agent instance in the operating environment (for example, one agent instance is particularly good at executing complex SQL queries, while another instance is proficient in using specific data visualization libraries) to dynamically and personally fine-tune and reallocate the mapping relationship between the pre-set roles and sub-tasks in the sketch, so as to ensure that the task allocation can maximize the strengths of each member in the current team.

[0084] Simultaneously, the planning agent seamlessly integrates the specific details and requirements unique to the new task into the planning process. For example, it modifies a general query template for sales data tables based on historical experience into a specific query statement adapted to the current user behavior log table structure. Through this series of intelligent processes based on retrieval results, pre-assessment feedback, and real-time context adaptation, the planning agent ultimately outputs a detailed, clear, and immediately executable task plan. This plan clearly defines the final task decomposition steps, the responsible roles for each sub-step, the required tools or resource interfaces, and the expected intermediate outputs and collaboration nodes, thus forming a high-quality, highly reliable memory-enhanced initial task planning scheme, significantly improving the starting quality and execution success rate of the planning process.

[0085] Continue to refer to Figure 1 The present invention proposes a memory enhancement and task planning method for large-scale multi-agent models, which further includes the following steps:

[0086] S3. Distribute the initial task planning scheme to the multi-agent network for execution, monitor the execution status to record the actual execution trajectory, and calculate the deviation between the actual execution trajectory and the planned expectation.

[0087] This step is crucial for putting the memory-enhanced initial task plan (i.e., the task plan document) generated in the previous step into practice. It aims to ensure the plan is executed accurately and to capture any deviations in real time during execution, providing a basis for subsequent evaluation and optimization. This step establishes a closed-loop monitoring system from planning to execution, specifically including the following three closely linked sub-steps:

[0088] S31. Based on the role definitions in the task plan, assign the subtasks to the corresponding agent instances for execution.

[0089] The execution engine first parses the task plan, accurately identifying the defined roles (e.g., data engineers, data analysts) and their assigned subtasks (e.g., data cleaning, chart generation). Then, the engine finds or instantiates agent instances with the corresponding role capabilities within the current multi-agent network, distributing specific subtask descriptions, context information, input data, and collaboration interface specifications to them. Each agent, upon receiving its assigned instructions, autonomously executes its assigned subtask. This process transforms abstract planning into concrete execution, ensuring that each task stage has a clearly defined responsible party.

[0090] S32. Monitor and record the interactions, tool calls, and state changes of each agent during the execution of sub-tasks to form the actual execution trajectory.

[0091] Throughout the entire process of task execution by the intelligent agent network, the system initiates a comprehensive state monitoring and logging mechanism. This mechanism captures and persistently stores all key events in real time, including but not limited to: dialogues and message exchanges between different intelligent agents for collaboration, each agent's requests and returns for external tools or APIs, intermediate data or files produced by each subtask, and key changes in task status (such as start, in progress, blocked, completed, and failed). The system integrates and correlates these discrete events according to chronological order and causal relationships, forming a complete and traceable actual execution trajectory. This trajectory is a true and objective record of the planned execution, providing a data foundation for subsequent comparative analysis.

[0092] S33. Compare the actual execution trajectory with the expected trajectory in the task plan, and trigger an alarm when the deviation exceeds the threshold.

[0093] The system continuously and automatically compares the actual execution trajectory recorded by S32 with the pre-set expectations in the task plan generated by S2. This comparison is multi-dimensional, including but not limited to: the deviation between the actual completion time of the subtask and the planned timeline, the difference between the actual tools or resources used and the planned scheme, the degree of conformity between the actual output and the expected output in the plan, and unplanned errors or obstacles that occur during the execution process.

[0094] The system pre-sets quantifiable thresholds for different types of deviations. When the deviation between the actual execution trajectory and the planned expectation exceeds the corresponding threshold (e.g., a critical sub-task is delayed by more than 20% of the planned time, or unauthorized tools are used), the system immediately triggers a deviation alarm. Simultaneously, the system can use the current task context and deviation type as query conditions to instantly retrieve contingency adjustment strategies from the external memory that have historically handled similar deviations or obstacles. These strategy suggestions, along with the alarm information, are provided to the master control agent or human supervisor, enabling them to make more effective adjustment decisions based on historical wisdom, such as reassigning tasks, invoking contingency strategies, or requesting additional resources. This deviation event and its context are also recorded, providing direct input for root cause analysis in step S4. Through this step, the system achieves fine-grained management and real-time feedback of the execution process, ensuring rapid response to deviations.

[0095] Continue to refer to Figure 1 The present invention proposes a memory enhancement and task planning method for large-scale multi-agent models, which further includes the following steps:

[0096] S4. Based on the deviation between the execution results obtained in step S3 and the records, evaluate the initial task planning scheme, extract planning correction rules based on the evaluation results, and update the experience of this task and the planning correction rules to the external memory bank.

[0097] This step is the core of enabling the system's self-learning and continuous optimization, completing a full closed loop from "planning-execution" to "evaluation-learning." It aims to objectively evaluate the effectiveness of the initial planning scheme, deeply analyze the problems exposed during execution, and feed the extracted new knowledge (whether successful experiences or lessons learned) into the external memory bank, enabling the system's planning capabilities to be iteratively enhanced. This step is specifically implemented through the following three logically rigorous sub-steps:

[0098] S41. Based on the task completion rate, resource consumption ratio, and time deviation rate between the actual execution trajectory and the planned expectation, the initial task planning scheme is quantitatively evaluated to obtain an effectiveness score.

[0099] After the task is completed, the system initiates a systematic post-evaluation process. First, based on the execution results and trajectory data recorded in step S3, the system calculates a set of objective quantitative indicators to evaluate the effectiveness of the planning scheme. These indicators include: 1) Task completion rate, measuring whether the final output fully meets the initial task objectives; 2) Resource consumption ratio, comparing the actual consumed computing resources, time costs, or economic costs with the planned estimates; 3) Time deviation rate, calculating the overall deviation between the actual time consumed by subtasks on the critical path and the planned time, based on the deviation recorded in step S33. The system integrates these indicators and generates a comprehensive effectiveness score through a preset weighted algorithm. This score is a quantitative summary of the success and efficiency of the planning scheme, providing a basis for decision-making regarding whether further in-depth analysis is needed.

[0100] S42. If the performance score is lower than the preset threshold, compare the task plan with the actual execution trajectory to locate planning defects, and generate structured planning correction rules based on the defects.

[0101] This sub-step involves in-depth analysis and knowledge extraction of planning deficiencies. The system compares the performance score calculated by S41 with a preset pass / fail threshold. If the performance score is lower than the threshold, it indicates a significant flaw in the planning, and the system triggers a root cause analysis process. The analysis module compares the original task plan side-by-side with the recorded actual execution trajectory. By comparing the differences between task decomposition, role allocation, tool usage, and expected outputs and actual results item by item, it accurately pinpoints the specific planning defects that led to failure or deviation. For example, it might locate a critical sub-task that was omitted during planning: analyzing the performance of the backend database.

[0102] After locating the defect, the system leverages the analytical and summarizing capabilities of the Large Language Model (LLM) to generate a clear, reusable, and structured correction rule—a condition-correction rule—based on the context of the defect. The system provides the LLM with prompts including task background, original planning scheme, exposed defects, and root cause analysis. The prompt word template can be designed as follows:

[0103] Based on the following task planning defect analysis, please generate a clear and reusable condition-correction rule.

[0104] Task and Planning Background

[0105] Initial task: Optimize the loading speed of product detail pages on e-commerce websites.

[0106] The original plan included three main sub-tasks: front-end code compression, lazy loading of images, and CDN deployment.

[0107] Defects exposed during implementation

[0108] After actual implementation, it was found that although the front-end optimization was completed, slow database queries became a new bottleneck, causing the overall optimization goals to be unmet. The root cause of the defect was that the crucial sub-task of back-end database performance analysis and optimization was omitted during the planning stage.

[0109] Rule generation requirements

[0110] Please develop a rule to ensure that such omissions are automatically avoided when making similar plans in the future. The rule format should be: IF [trigger condition] THEN [corrective action or subtask that must be added to the plan].

[0111] Based on the above inputs, the large model can output conditional-correction rules in the following form:

[0112] If the task objective contains keywords such as performance optimization or improving loading speed, and the planning scheme already includes front-end optimization subtasks (such as code compression and lazy loading of resources), then the back-end service and database query performance analysis subtasks must be added to the plan as prerequisite or parallel checks.

[0113] The system stores this rule in a structured manner. For example, taking the aforementioned rule as an example, its storage format can be: {Triggering condition: The task objective includes performance optimization and the planning scheme includes front-end optimization subtasks, Correction action: Add back-end service and database query performance analysis subtasks}, and associate it with relevant planning pattern templates or experience units.

[0114] S43. Construct the task plan and actual execution trajectory of this task into a new planning experience unit and store it in the external memory bank, and associate the planning correction rules with the relevant planning pattern templates or planning experience units in the external memory bank.

[0115] Regardless of the success or failure of the task, its entire process constitutes valuable system experience. Therefore, the system merges the task plan and actual execution trajectory of this task, constructing a new planning experience unit according to the format defined in step S11. This unit contains all the structured information of this task, especially its final performance evaluation results.

[0116] Subsequently, the system stores this new planning experience unit in an external memory. Specifically, this involves vectorizing its text description and storing it in a vector database, storing its metadata (task domain, tools used, participating roles, performance score, etc.) in a relational database, and updating the hybrid index. Furthermore, the system can dynamically update the weights or confidence levels of related historical planning experience units or planning pattern templates in the external memory based on the performance score of the current task, reflecting real-time changes in their reference value. More importantly, the system intelligently associates the planning correction rules extracted in step S42 (if they exist) with relevant knowledge in the external memory. For example, it binds or links the triggering conditions of the rule with the metadata of related planning pattern templates or historical planning experience units. In this way, when searching for similar planning tasks in the future, not only will historical cases and patterns be retrieved, but the associated correction rules may also be suggested or prioritized, thus proactively avoiding repeating past mistakes.

[0117] Through step S4, each task execution becomes nourishment for system evolution. Successful experiences are distilled into reusable cases, and lessons learned from failures are refined into preventative rules. The external memory bank thus becomes a dynamically growing and continuously optimizing knowledge ecosystem, fundamentally endowing the multi-agent system with the ability to self-improve and continuously learn.

[0118] Further reference Figure 2 As an implementation of the above method, this invention also proposes an embodiment of the structure diagram of a memory enhancement and task planning system 200 for large-scale multi-agent models. This system can be specifically applied to various electronic devices. The memory enhancement and task planning system 200 for large-scale multi-agent models includes the following modules:

[0119] The memory building and indexing module 210 is configured to perform structured parsing of historical multi-agent task data, extract planning experience and abstract patterns, in order to build and index an external memory.

[0120] The memory enhancement planning generation module 220 is configured to retrieve relevant planning experience and planning patterns from an external memory bank based on the description of a new task, and generate a task planning document as the initial task planning scheme for memory enhancement based on the retrieval results.

[0121] The execution monitoring and deviation detection module 230 is configured to distribute the initial task planning scheme to the multi-agent network for execution, monitor the execution status to record the actual execution trajectory, and calculate the deviation between the actual execution trajectory and the planning expectation.

[0122] The evaluation and closed-loop update module 240 is configured to evaluate the initial task planning scheme based on the execution results and recorded deviations obtained by the execution monitoring and deviation detection module, extract planning correction rules based on the evaluation results, and update the experience and planning correction rules of this task to the external memory.

[0123] The present invention also proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it implements the steps of any of the above-described methods for memory enhancement and task planning for large-scale multi-agent models.

[0124] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described methods for memory enhancement and task planning for large-scale multi-agent models.

[0125] The following is for reference. Figure 3 It shows a schematic diagram of the structure of a computer system 300 suitable for implementing terminal devices or servers of the present invention. Figure 3 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0126] like Figure 3 As shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 302 or programs loaded from storage section 308 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the computer system 300. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0127] The following components are connected to I / O interface 305: an input section 306 including a keyboard, mouse, etc.; an output section 307 including a liquid crystal display (LCD) and speakers, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card and a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to I / O interface 305 as needed. A removable medium 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 310 as needed so that computer programs read from it can be installed into storage section 308 as needed.

[0128] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the functions defined in the methods of this invention. It should be noted that the computer-readable medium described in this invention can be a computer-readable signal medium or a computer-readable medium or any combination thereof. 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 thereof. More specific examples of computer-readable media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0129] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0130] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0131] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this invention.

Claims

1. A method for memory enhancement and task planning in large-scale multi-agent models, characterized in that, Includes the following steps: S1. Perform structured parsing on historical multi-agent task data to extract planning experience and abstract patterns in order to build and index an external memory database. This includes the following sub-steps: S11. Analyze the historical multi-agent task data and extract structured information to construct a planning experience unit. The planning experience unit includes task objectives, task decomposition structure, role-subtask mapping, and evaluation results. S12. Input multiple planning experience units into a large model for analysis, and summarize them to form a reusable planning pattern template. S13. Constructing the external memory bank specifically includes: vectorizing the text of the planning experience unit and the planning pattern template and constructing a vector database, storing the task metadata associated with the planning experience unit and the planning pattern template into a relational database, and constructing a hybrid index on the vector database and the relational database; S2. Based on the description of the new task, relevant planning experience and planning patterns are retrieved from the external memory bank, and a task planning document is generated based on the retrieval results as the initial task planning scheme for memory enhancement. This includes the following sub-steps: S21. Based on the description vector of the new task, retrieve semantically similar planning experience units from the vector database of the external memory, and filter out matching planning pattern templates from the relational database of the external memory according to the metadata of the new task. S22. Based on the retrieved planning experience units and the planning pattern template, generate one or more candidate planning sketches through the planning agent, and pre-evaluate the candidate planning sketches; S23. Based on the results of the pre-evaluation, a planning sketch is selected from the candidate planning sketches. The planning agent, in conjunction with the capability profile of the currently available agents, dynamically fine-tunes the role division and task allocation in the selected planning sketch, generates and outputs a task planning document, which serves as the initial task planning scheme for memory enhancement. S3. Distribute the initial task planning scheme to the multi-agent network for execution, monitor the execution status to record the actual execution trajectory, and calculate the deviation between the actual execution trajectory and the planning expectation. S4. Based on the deviation between the execution result obtained in step S3 and the record, evaluate the initial task planning scheme, extract planning correction rules according to the evaluation results, and update the experience of this task and the planning correction rules to the external memory bank.

2. The memory enhancement and task planning method for large-scale multi-agent models according to claim 1, characterized in that, In step S22, the candidate planning sketches are pre-evaluated, specifically by scoring and ranking multiple candidate planning sketches based on the historical success rate of the planning experience unit on which each candidate planning sketch depends, and the matching degree between the resources required by the candidate planning sketch and the available resources of the current multi-agent network.

3. The memory enhancement and task planning method for large-scale multi-agent models according to claim 1, characterized in that, In step S3, the initial task planning scheme is distributed to the multi-agent network for execution, the execution status is monitored to record the actual execution trajectory, and the deviation between the actual execution trajectory and the planned expectation is calculated. This specifically includes the following sub-steps: S31. According to the role definitions in the task planning document, assign the subtasks to the corresponding agent instances for execution; S32. Monitor and record the interactions, tool calls, and state changes of each agent during the execution of sub-tasks to form the actual execution trajectory; S33. Compare the actual execution trajectory with the expected trajectory in the task plan, and trigger an alarm when the deviation exceeds a threshold.

4. The memory enhancement and task planning method for large-scale multi-agent models according to claim 1, characterized in that, In step S4, the initial task planning scheme is evaluated based on the deviation between the execution result obtained in step S3 and the recorded result. Planning correction rules are then extracted based on the evaluation results, and the experience from this task and the planning correction rules are updated to the external memory. This specifically includes the following sub-steps: S41. Based on the task completion rate and resource consumption ratio of the execution results, as well as the time deviation rate between the actual execution trajectory and the planning expectation, the initial task planning scheme is quantitatively evaluated to obtain a performance score. S42. If the performance score is lower than a preset threshold, the task plan is compared with the actual execution trajectory to locate planning defects, and a structured planning correction rule is generated based on the defects. S43. The task planning document and the actual execution trajectory of this task are constructed into a new planning experience unit and stored in the external memory bank, and the planning correction rules are associated with the relevant planning pattern templates or planning experience units in the external memory bank.

5. The memory enhancement and task planning method for large-scale multi-agent models according to claim 4, characterized in that, In step S43, the planning correction rule is associated with the relevant planning pattern template or planning experience unit in the external memory bank. Specifically, the triggering condition of the planning correction rule is bound to the task metadata of the relevant planning pattern template or planning experience unit so that the rule is matched first when similar tasks are executed in the future.

6. A memory enhancement and task planning system for large-scale multi-agent models, used to implement the method as described in any one of claims 1 to 5, characterized in that, The system includes: The memory building and indexing module is configured to perform structured parsing of historical multi-agent task data, extract planning experience and abstract patterns, in order to build and index an external memory. The memory enhancement planning generation module is configured to retrieve relevant planning experience and planning patterns from the external memory bank based on the description of the new task, and generate a task planning document as the initial task planning scheme for memory enhancement based on the retrieval results. The execution monitoring and deviation detection module is configured to distribute the initial task planning scheme to the multi-agent network for execution, monitor the execution status to record the actual execution trajectory, and calculate the deviation between the actual execution trajectory and the planning expectation. The evaluation and closed-loop update module is configured to evaluate the initial task planning scheme based on the execution results and recorded deviations obtained by the execution monitoring and deviation detection module, extract planning correction rules based on the evaluation results, and update the experience of this task and the planning correction rules to the external memory.

7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the memory enhancement and task planning method for large-scale multi-agent models as described in 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 memory enhancement and task planning method for large-scale multi-agent models as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Intelligent unmanned cluster autonomous task planning method based on large language model

    CN120524791A

  • Continuous relation extraction method and system based on large language model

    CN120849983A