Multi-agent task planning method and system based on memory and reflection mechanism

CN122927367APending Publication Date: 2026-10-16HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611083337.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

然而,随着真实业务场景向开放域、多工具、跨领域方向发展,高度依赖单一Master(规划器,其用于根据用户Query选出所需的Agent/Tool链)进行全局路由与执行调度的架构暴露出严重的机制性缺陷

Benefits of technology

[0024]Regarding Retrieval-Augmented Generation (RAG) technology: By converting text into high-dimensional vectors and storing them in a vector database, and performing Top-K similarity retrieval at runtime using an embedding model, this provides external knowledge expansion for large models. Traditional RAG often relies on literal or purely semantic matching. To overcome this limitation, this invention references advanced RAG technology concepts such as HyDE and TART, advocating for the extraction of "logic-based" keywords based on user questions. For example, for the question "query Tesla prices," the extracted logical keywords should be abstracted as "query" and "car prices," rather than being rigidly extracted as "query" and "Tesla prices," thereby improving the logical accuracy and generalization recall capability of vector space retrieval. Regarding the reflection mechanism for large language models: Reflection mechanisms (such as Reflexion) are a reinforcement mechanism that achieves self-correction through natural language feedback. In traditional interactive environments, agents often only receive simple error codes or binary "failure" signals when a task fails. Reflection mechanisms, however, emphasize self-correction based on language feedback (Self-Correction via Verbal). Feedback means that the agent should receive natural language feedback that clearly explains "why it failed and how to fix it"; through this mechanism, implicit failure experiences are made explicit into specific reflection suggestions, guiding the planner to correct the call chain in subsequent iterations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122927367A_ABST
    Figure CN122927367A_ABST
Patent Text Reader

Abstract

The application discloses a multi-agent task planning method and system based on a memory and reflection mechanism and belongs to the technical field of multi-agent scheduling. The application solves the problems of hallucination, tool misuse and instruction loss of a single planning model in the prior art for an open domain complex task. A keyword extraction model of a memory module extracts keywords based on logic for a user problem accepted by the system, and searches for a historical correct case. A planning module generates a preliminary execution plan, submits the execution plan for execution or performs pre-audit, generates a corrected current execution plan if an error is found in the execution or the audit, and outputs a correct result until the task is successful or the maximum number of retries is reached. A teacher model is called to supplement the planning reasons, a deduplication judgment model is used for deduplication audit, and new experience is stored in a vector database. The application improves the comprehensiveness and accuracy of multi-agent task planning and can be applied to a scheduling framework for planning and coordinating multiple agents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-agent scheduling technology, specifically to a multi-agent task planning method and system based on memory and reflection mechanisms. Background Technology

[0002] As an entity capable of perceiving its environment and performing tasks, an agent, when combined with a Large Language Model (LLM), exhibits powerful autonomous task planning and execution capabilities. In multi-agent systems, a core LLM-driven planner typically coordinates multiple agents from specific domains to complete complex tasks in an open domain. With the evolution of multi-agent technology, its application scenarios are gradually penetrating into vertical and complex domains, covering multiple dimensions such as text generation, data understanding, real-time search, application manipulation, personal life, information retrieval, and financial transactions. However, since a single agent cannot cover all professional fields, constructing a scheduling framework that can accurately route, effectively plan, and coordinate multiple agents has become one of the core research directions in the field of artificial intelligence.

[0003] In recent years, with the leap in the capabilities of Large Language Models (LLMs), agent planning frameworks driven by a single large language model (such as ReAct, i.e., the Reasoning-and-Acting mechanism) have been widely used. These frameworks demonstrate good autonomy in relatively simple single-step tasks by having the LLM alternate between reasoning and action. However, as real-world business scenarios evolve towards open domains, multiple tools, and cross-domain approaches, architectures that heavily rely on a single Master (planner, which selects the required Agent / Tool chain based on the user query) for global routing and execution scheduling have exposed serious systemic flaws. When the number of candidate agents / tools in the system surges, the context window of a single Master architecture becomes filled with massive tool descriptions. This not only severely dilutes the model's attention mechanism but also makes it difficult for a single-node planner lacking external memory anchoring to handle complex task decompositions.Specifically, existing architectures frequently encounter planning dilemmas in actual operation, which can be summarized in the following three aspects: 1) Hallucination problem: When the tool action space is too large, the attention of a single Master is easily distracted. Without historical correct call examples for context alignment, the parameterized prior knowledge pre-trained within the model will "overstep" and cover the description of the actual tool list provided by the system. That is, the model may generate and call tools that do not exist in the system during planning; for example, when a user queries the weather (user Query: Please check the weather for me), the model fabricates and calls the non-existent "weather forecast". 1) r_forcast instead of the actual "today_weather" in the system; 2) Tool misuse bias: In the absence of refined layering and professional historical experience, a single Master tends to take a "lazy" probabilistic shortcut when faced with complex intent allocation, calling the most general and conservative underlying tool, thus losing the ability to accurately match the expertise of specific domains. That is, the model tends to give general results, but fails to accurately match the best tool for a specific task; for example, when faced with a request that requires precise calculation (user query: calculate 1234 precisely), the model routes the task to the general Google search. Search, rather than a dedicated computational knowledge engine like Wolfram Alpha; 3) Loss of multi-hop instructions: In mainstream frameworks like ReAct, task planning is usually an autoregressive linear process. When faced with complex long-range instructions that require multiple steps, a single Master, due to the limitations of short-term context windows and the lack of global hierarchical memory, is prone to forgetting the initial global goal after executing a certain intermediate node, resulting in the inability to close the loop of multi-step logic. When faced with complex instructions that require multiple steps, the planner is prone to missing intermediate steps, leading to broken call chains. For example, when faced with the multi-hop instruction "search for the author of a paper and provide a translation of the paper's abstract", the model only calls "get_author_by_paper" to obtain the author, omitting the step "translate_with_google"; In addition, at the system architecture level, if all available Agents are directly exposed to the Master, the excessive number of Agents will lead to an excessively long context, which will severely dilute the Master's attention. At the same time, the existing system lacks a mechanism for reusing past successful experiences and a mechanism for correcting planning failures, making it impossible for the system to achieve dynamic evolution during operation.

[0004] In summary, existing single-planner multi-agent systems expose all agents in a flattened manner, leading to severe contextual redundancy and attention dilution. Furthermore, existing systems lack mechanisms for preserving and reusing past correct thought chains, and cannot self-correct through semantic-level reflection when task execution fails. Therefore, a multi-agent task planning method and system based on memory and reflection mechanisms is needed. Summary of the Invention

[0005] A brief overview of the invention is given below to provide a basic understanding of certain aspects of it. It should be understood that this overview is not an exhaustive summary of the invention. It is not intended to identify key or essential parts of the invention, nor is it intended to limit the scope of the invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to the more detailed description that follows.

[0006] In view of this, in order to solve the problems of illusion, tool misuse and instruction loss that are prone to occur in the single planning model for complex tasks in open domains in the existing technology, the present invention provides a multi-agent task planning method and system based on memory and reflection mechanisms.

[0007] Technical Solution 1 is as follows: A multi-agent task planning method based on memory and reflection mechanisms, including the following steps:

[0008] S1. The keyword extraction model of the memory module performs logic-based keyword extraction on the user questions received by the system, and uses the embedding model to vectorize the extracted features, and retrieves the Top-K highly relevant historical correct cases from the vector database of the memory module;

[0009] Specifically: Top-K highly relevant historical correct cases include user questions, agent call chains, agent sets, and thought chains;

[0010] S2. The planner in the planning module receives the original user question and historical correct cases as context, and combines them with the hierarchically designed agent name cards to perform planning reasoning, generating a preliminary agent call chain, i.e., preliminary planning;

[0011] S3. Submit the preliminary plan for execution or conduct a preliminary review. If errors are found during execution, the implicit failure experience is transformed into reflection suggestions by combining the original user questions and error status with the reflection model in the planning module. These suggestions are then input into the planner for secondary reasoning to generate a revised new call chain until the task is successful or the maximum number of repetitions is reached, producing the correct result.

[0012] S4. Input the planning data of the task execution in step S3 into the experience accumulation process. For cases that lack a record of the thinking process, call the teacher model of the memory module to supplement the planning reasons. Perform deduplication review through the deduplication judgment model of the memory module. On the premise of ensuring that the current case is not completely duplicated with the existing data in the vector database, store this new experience in the vector database for future task retrieval and reuse.

[0013] Furthermore, in S1, the keyword extraction model is achieved through... Function receives user User issues Call the keyword extraction model of Method, input user question Output runtime keywords Call the embedded model of Method, input runtime keywords Output query vector Call the vector memory retrieval function Input query vector Vector database and parameters Output the Top-K most relevant historical correct cases. .

[0014] Furthermore, in S2, the context formatting function is called. Input Top-K highly relevant historical correct cases Output in a format suitable for contextual learning. Call the main control module of The method takes in the user's question. Hierarchical Intelligent Agent Business Card A context-friendly format for planners to use in planning. Generate the current execution plan The current execution plan (Current_Plan) includes the agent call chain (Agent_Call_Chain). When the current number of attempts (attempts) is less than the maximum number of retries (Max_Retries), a loop is entered. The agent chain execution function (Execute_Agent_Chain) is called, taking the agent call chain (Agent_Call_Chain) from the current execution plan (Current_Plan) as input, and outputting the execution status (Execution_Status) and execution logs (Logs). If the execution status... Equals the sign of success If successful, the process will proceed to the success branch; the execution log will be updated. The final output in Assign a value to the final execution result ;

[0015] The hierarchical design of the agent business card includes an agent set and an agent list. When executing a task, the planner first interacts with the agent set to quickly identify the functional domain required for the current task, eliminates a large number of irrelevant sets, and then reads the agent list under the identified set to obtain specific tools.

[0016] Furthermore, in S3, if the execution state If the attempt fails, proceed to the failure handling branch; the current number of attempts will be recorded. Increment by 1, invoke the reflective model. of The method takes the user's question as input. Current Implementation Plan Execution Log A format suitable for contextual learning Output reflection information Call the planner of The method takes the user's question as input. Hierarchical Intelligent Agent Business Card A format suitable for contextual learning and reflective information A new current execution plan is generated and updated, including the revised agent call chain. After the failure handling branch ends, the retry loop condition is checked. If the current number of attempts is less than the maximum number of retries (Max_Retries), the agent call chain is executed again based on the updated current execution plan (Current_Plan). The above execution, reflection, and replanning process is repeated until the execution status (Execution_Status) is SUCCESS or the current number of attempts reaches the maximum number of retries (Max_Retries). If the task still fails after reaching the maximum number of retries, a failure report is returned: the string "Task execution failed, maximum number of retries reached" is displayed, along with the error information from the last execution log (Logs).

[0017] Furthermore, in step S4, the current correct case is determined. chain of thought Is it empty? If the thought chain is empty, then call the teacher model. of Method: Input the user question from the case. and the chain of execution steps of the intelligent agent Generate planning rationale and store it in the thought chain. Termination condition judgment, call the keyword extraction model Enter the user question from the case. Output case keywords Call the deduplication judgment model of Method: Input case keywords and vector database Output a list of similar cases. Call the deduplication function Enter the user in the case. and a list of similar cases If there are no complete duplicates, the database entry logic is executed, and the current correct case (Correct_Case) is added to the vector database Memory_Base, ending the deduplication judgment; the updated data in the vector database Memory_Base is used for future task retrieval and reuse.

[0018] Technical Solution 2: A multi-agent task planning system based on memory and reflection mechanisms, used to execute the multi-agent task planning method based on memory and reflection mechanisms described in Technical Solution 1, including a memory module, a planning module, and an embedded model;

[0019] The embedded model is connected to the memory module, and the memory module is connected to the planning module;

[0020] The memory module includes a vector database, a teacher model storage module, a keyword extraction model storage module, and a deduplication judgment model storage module. The teacher model storage module is connected to the deduplication judgment model storage module, and the deduplication judgment model storage module is connected to the vector database.

[0021] The planning module includes a planner and a reflective model storage module connected in sequence.

[0022] The beneficial effects of this invention are as follows: Combining the context learning ability of a large language model with the natural language feedback mechanism, a multi-agent task planning system framework based on a vector database and a reflection mechanism is proposed, which achieves dynamic evolution of system planning capabilities while controlling context redundancy. Regarding multi-agent task planning frameworks: In existing multi-agent task planning research, large language models are typically used as the core controller for intent analysis and task list generation; for example, typical frameworks (such as HuggingGPT) can drive agent routing through task planning and parsing descriptions. Some cutting-edge research (such as ExpeL) has begun to explore allowing agents to act as experiential learners, improving performance through a combination of experiential learning and principle reference; however, these basic frameworks are still prone to mechanical dependence and template limitations when facing complex tasks in open domains. This application improves adaptability and robustness through dynamic programming and memory-driven logical evolution.

[0023] Regarding contextual learning and knowledge distillation: Contextual learning allows large language models to master specific task patterns through a small number of examples contained in prompts without updating network parameters (Few-shot learning). Research shows that for contextual learning, especially few-shot learning, large language models perform better in learning and generalization when they receive similar but subtly different comparative examples. To further improve sample quality, this invention utilizes knowledge distillation techniques (such as the Distilling step-by-step method), which uses a more capable teacher model to generate detailed thought chains or reasons for cold-start data lacking reasoning processes, and then feeds them to the goal planning model, thereby achieving better planning performance with less training data and a smaller model size.

[0024] Regarding Retrieval-Augmented Generation (RAG) technology: By converting text into high-dimensional vectors and storing them in a vector database, and performing Top-K similarity retrieval at runtime using an embedding model, this provides external knowledge expansion for large models. Traditional RAG often relies on literal or purely semantic matching. To overcome this limitation, this invention references advanced RAG technology concepts such as HyDE and TART, advocating for the extraction of "logic-based" keywords based on user questions. For example, for the question "query Tesla prices," the extracted logical keywords should be abstracted as "query" and "car prices," rather than being rigidly extracted as "query" and "Tesla prices," thereby improving the logical accuracy and generalization recall capability of vector space retrieval. Regarding the reflection mechanism for large language models: Reflection mechanisms (such as Reflexion) are a reinforcement mechanism that achieves self-correction through natural language feedback. In traditional interactive environments, agents often only receive simple error codes or binary "failure" signals when a task fails. Reflection mechanisms, however, emphasize self-correction based on language feedback (Self-Correction via Verbal). Feedback means that the agent should receive natural language feedback that clearly explains "why it failed and how to fix it"; through this mechanism, implicit failure experiences are made explicit into specific reflection suggestions, guiding the planner to correct the call chain in subsequent iterations. Attached Figure Description

[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0026] Figure 1 A flowchart illustrating a multi-agent task planning method based on memory and reflection mechanisms;

[0027] Figure 2 A system diagram illustrating a multi-agent task planning method based on memory and reflection mechanisms;

[0028] Figure 3 This is a flowchart illustrating the dynamic loading and runtime retrieval process of the memory module;

[0029] Figure 4 A flowchart illustrating the initial planning and retry process for multi-agent systems with a reflective mechanism;

[0030] Figure 5 This is a schematic diagram of an embodiment of a multi-agent task planning method based on memory and reflection mechanisms.

[0031] Attached diagram descriptions: 1. Memory module; 2. Planning module. Detailed Implementation

[0032] To make the technical solutions and advantages of the embodiments of the present invention clearer, the exemplary embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0033] Example 1: Reference Figures 1-5 This embodiment describes a multi-agent task planning method based on memory and reflection mechanisms, specifically including the following steps:

[0034] S1. Intent parsing and experience retrieval stage: The keyword extraction model of the memory module performs logic-based keyword extraction on the user questions received by the system, and uses the embedding model to vectorize the extracted features, and retrieves the Top-K highly relevant historical correct cases from the vector database of the memory module;

[0035] Specifically: Top-K highly relevant historical correct cases include user questions, agent call chains, agent sets, and detailed thought chains;

[0036] S2. Preliminary planning stage combined with hierarchical business cards: The planner of the planning module receives the original user question and historical correct cases as context, and performs planning reasoning in combination with the hierarchical design of the agent business cards. Based on the macro intent, the planner locks the required set of agents at the routing layer, and then arranges the list of agents in the execution layer to generate a preliminary agent call chain, i.e., preliminary planning.

[0037] S3. Feedback, Reflection and Retry Mechanism Phase: The initial plan is submitted for execution or pre-review. If an error is confirmed during execution, the system will trigger the reflection model. By combining the reflection model in the planning module with the original user questions and error status, the implicit failure experience is transformed into reflection suggestions (specific natural language), which are input into the planner for secondary reasoning to generate a corrected new call chain until the task is successful or the maximum number of repetitions (customizable) is reached, and the correct result is produced.

[0038] S4. Experience Accumulation and Dynamic Storage Stage: Input the planning data of the task execution in step S3 into the experience accumulation process. For cases that lack a record of the thinking process, call the teacher model of the memory module to supplement the detailed planning reasons. Perform deduplication review through the deduplication judgment model of the memory module. On the premise of ensuring that the current case is not completely duplicated with the existing data in the vector database, store this new experience in the vector database for future task retrieval and reuse.

[0039] Specifically, the system architecture mainly consists of two parts: a memory module and a planning module with reflection. In order to avoid the problem of excessively long context and attention dilution caused by too many agents, the system has adopted a layered design for the agent business cards at the bottom layer, which are divided into agent sets (different sets divided according to the functions of the agents, describing what functions they can perform) and agent lists (specific agent information).

[0040] Furthermore, in S1, the keyword extraction model is achieved through... Function receives user User issues Call the keyword extraction model of Method, input user question Output runtime keywords Call the embedded model of Method, input runtime keywords Output query vector Call the vector memory retrieval function Input query vector Vector database and parameters (Number of searches), output the Top-K historical correct cases with high relevance. .

[0041] Furthermore, in S2, the context formatting function is called. Input Top-K highly relevant historical correct cases Output in a format suitable for contextual learning. Call the main control module of The method takes the user's question as input. Hierarchical Intelligent Agent Business Card A context-friendly format for planners to use in planning. Generate the current execution plan The current execution plan (Current_Plan) includes the agent call chain (Agent_Call_Chain); there is a current number of attempts. Less than the maximum number of retries When the loop begins, the smart agent chain execution function is called. Enter the current execution plan. Output: Execution status (success / failure) Execution Log (Including intermediate output, error messages, etc.); if the execution status Equals the sign of success If successful, the process will proceed to the success branch; the execution log will be updated. The final output in Assign a value to the final execution result ;

[0042] The hierarchical design of the agent business card includes an agent set and an agent list. When executing a task, the planner first interacts with the agent set to quickly identify the functional domain required for the current task, eliminates a large number of irrelevant sets, and then reads the agent list under the identified set to obtain specific tools.

[0043] Specifically, in traditional multi-agent architectures, the system typically inputs all available agent information as prompts to the planner at once. This leads to excessively long contexts due to the large number of agents, severely diluting the planner's (Master's) attention. To address this issue, this invention employs a layered design for the underlying agent profiles. Logically, the agent profiles are divided into two levels: agent sets, which are different collections categorized by agent function, primarily describing the macro-level functions that the collection can perform; and agent lists, which contain specific agent call information and parameter dictionaries within that collection. This layered design effectively compresses the context length of a single inference and improves the Master's planning focus without sacrificing the overall richness of the system's tools.

[0044] Furthermore, in S3, if the execution state If the attempt fails, proceed to the failure handling branch; the current number of attempts will be recorded. Increment by 1, invoke the reflective model. of The method takes the user's question as input. Current Implementation Plan Execution Log A format suitable for contextual learning Output reflection information Call the planner of The method takes the user's question as input. Hierarchical Intelligent Agent Business Card A format suitable for contextual learning and reflective information Generate a new execution plan and update the current execution plan. The new current execution plan includes the revised agent call chain (Agent_Call_Chain). After the failure handling branch ends, the condition for returning to the retry loop is checked. If the current number of attempts (attempts) is less than the maximum number of retries (Max_Retries), the agent call chain is executed again based on the updated current execution plan (Current_Plan). The above execution, reflection, and replanning process is repeated until the execution status (Execution_Status) is SUCCESS, or the current number of attempts (attempts) reaches the maximum number of retries (Max_Retries). If the maximum number of retries is reached but the task still fails, a failure report is returned: the string "Task execution failed, maximum number of retries reached" is displayed, along with the error information from the last execution log (Logs). Further, in S4, the current correct case is determined. chain of thought Is it empty? If the thought chain is empty, then call the teacher model. of Method: Input the user question from the case. and the chain of execution steps of the intelligent agent Generate planning rationale and store it in the thought chain. Termination condition judgment, call the keyword extraction model Enter the user question from the case. Output case keywords Call the deduplication judgment model of Method: Input case keywords and vector database Output a list of similar cases. Call the deduplication function Enter the user in the case. and a list of similar cases If there are no complete duplicates, the database entry logic is executed, the current correct case (Correct_Case) is added to the vector database Memory_Base, and the deduplication judgment ends; the updated data in the vector database Memory_Base is used for future task retrieval and reuse.

[0045] Specifically, at the data structure level, the cases stored in the vector database include user questions, agent call chains, agent sets, and detailed thought chains. Regarding runtime retrieval logic, when the system receives a new user question, the keyword extraction model first extracts logical keywords from the instruction; then, the embedding model vectorizes the features, retrieving Top-K highly relevant historical correct cases from the vector database; in terms of experience accumulation and dynamic storage, for data from the system's cold start phase or cases lacking thought process records, the system calls the teacher model to supplement detailed planning reasons. Subsequently, a deduplication review is performed by the judgment model, ensuring that the case does not completely duplicate existing data in the vector database before storing this new experience in the vector database for future task retrieval and reuse.

[0046] Specifically, in this embodiment, for a specific application scenario in the financial investment research field, when the user's question is "Compare the revenue changes of target company A and target company B over the past three years and generate an investment research summary containing risk warnings," the keyword extraction model abstracts the user's question into logical keywords such as "company financial comparison," "revenue trend," "risk warning," and "summary generation." The embedded model generates a query vector based on these keywords and retrieves historical correct cases from the vector database. The planner first locks the financial data retrieval set, numerical calculation set, risk analysis set, and text generation set at the agent set layer, and then reads the specific agent list under each set to form an agent call chain of "calling the financial data interface to obtain revenue data—calling the table calculation agent to calculate year-on-year changes—calling the risk analysis agent to identify abnormal fluctuations—calling the summary generation agent to output the investment research summary." If the execution log shows that the planner mistakenly replaced the financial data interface with the general search interface, the reflection model generates a reflection suggestion based on the error status: "The structured financial data interface should be used instead of the general search interface to obtain revenue data." The planner then generates a corrected call chain and re-executes the task. After the task is successful, the system uses the user's question, successful call chain, set of agents, and planning reason as the current correct case. After deduplication and verification, the case is written into the vector database for reuse in subsequent similar or identical financial investment research tasks.

[0047] Example 2: A multi-agent task planning system based on memory and reflection mechanism, used to execute the multi-agent task planning method based on memory and reflection mechanism described in Example 1, including memory module 1, planning module 2 and embedding model 3;

[0048] The embedded model 3 is connected to the memory module 1, and the memory module 1 is connected to the planning module 2;

[0049] The memory module 1 includes a vector database, a teacher model storage module, a keyword extraction model storage module, and a deduplication judgment model storage module. The teacher model storage module is connected to the deduplication judgment model storage module, and the deduplication judgment model storage module is connected to the vector database.

[0050] The planning module 2 includes a planner and a reflective model storage module connected in sequence.

[0051] Specifically, memory module 1 stores, manages, and retrieves historical correct cases, and its underlying implementation relies on a vector database. Planning module 2 is the scheduling center of the multi-agent system. This solution introduces a closed-loop feedback reflection and retry mechanism in this module. The planner (Master) receives the original user question and retrieved historical correct cases (Context_k) as context, and performs planning reasoning based on the hierarchically designed agent profiles. The Master model first locks down the required set of agents based on the macro-intention, and then specifically arranges the agent list to generate a preliminary agent call chain. The generated preliminary plan is then submitted for execution. If an error is confirmed during execution, the system will trigger the reflection model. The reflection model combines the original user question and error status to transform implicit failure experience into specific natural language suggestions. After receiving this reflection suggestion, the Master performs secondary reasoning to generate a corrected new call chain. This retry loop will continue until the task succeeds or the maximum number of repetitions set by the system is reached.

[0052] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A multi-agent task planning method based on memory and reflection mechanisms, characterized in that, Includes the following steps: S1. The keyword extraction model of the memory module performs logic-based keyword extraction on the user questions received by the system, and uses the embedding model to vectorize the extracted features, and retrieves the Top-K highly relevant historical correct cases from the vector database of the memory module; Specifically: Top-K highly relevant historical correct cases include user questions, agent call chains, agent sets, and thought chains; S2. The planner of the planning module receives the original user question and historical correct cases as context, and performs planning reasoning in combination with the hierarchical design of the agent's name card to generate a preliminary execution plan, which includes the agent call chain; S3. Submit the preliminary plan for execution or conduct a preliminary review. If errors are found during execution, the implicit failure experience is transformed into reflection suggestions by combining the original user questions and error status through the reflection model in the planning module. These suggestions are then input into the planner for secondary reasoning to generate a revised current execution plan. The revised current execution plan includes a revised agent call chain until the task is successful or the maximum number of retries is reached, and the correct result is produced. S4. Input the planning data of the task execution in step S3 into the experience accumulation process. For cases that lack a record of the thinking process, call the teacher model of the memory module to supplement the planning reasons. Perform deduplication review through the deduplication judgment model of the memory module. On the premise of ensuring that the current case is not completely duplicated with the existing data in the vector database, store this new experience in the vector database for future task retrieval and reuse.

2. The multi-agent task planning method based on memory and reflection mechanisms according to claim 1, characterized in that, In S1, the keyword extraction model uses... Function receives user User issues Call the keyword extraction model of Method, input user question Output runtime keywords Call the embedded model of Method, input runtime keywords Output query vector Call the vector memory retrieval function Input query vector Vector database and parameters Output the Top-K most relevant historical correct cases. .

3. The multi-agent task planning method based on memory and reflection mechanisms according to claim 2, characterized in that, In step S2, the context formatting function is called. Input Top-K highly relevant historical correct cases Output in a format suitable for contextual learning. Call the main control module of The method takes the user's question as input. Hierarchical Intelligent Agent Business Card A context-friendly format for planners to use in planning. Generate the current execution plan The current execution plan (Current_Plan) includes the agent call chain (Agent_Call_Chain); there is a current number of attempts. Less than the maximum number of retries When the loop begins, the smart agent chain execution function is called. Input: Current execution plan The Agent_Call_Chain in the intelligent agent call chain outputs: execution status. Execution Log If the execution status Equals the sign of success If successful, the process will proceed to the success branch; the execution log will be updated. The final output in Assign a value to the final execution result ; The hierarchical design of the agent business card includes an agent set and an agent list. When executing a task, the planner first interacts with the agent set to quickly identify the functional domain required for the current task, eliminates a large number of irrelevant sets, and then reads the agent list under the identified set to obtain specific tools.

4. The multi-agent task planning method based on memory and reflection mechanisms according to claim 3, characterized in that, In S3, if the execution state If the attempt fails, proceed to the failure handling branch; the current number of attempts will be recorded. Increment by 1, invoke the reflective model. of The method takes the user's question as input. Current Implementation Plan Execution Log A format suitable for contextual learning Output reflection information Call the planner of The method takes the user's question as input. Hierarchical Intelligent Agent Business Card A format suitable for contextual learning and reflective information Generate a new current execution plan and update the current execution plan. The new current execution plan includes the revised agent call chain (Agent_Call_Chain). After the failure handling branch ends, the condition for returning to the retry loop is checked. If the current number of attempts (attempts) is less than the maximum number of retries (Max_Retries), the agent call chain is executed again based on the updated current execution plan (Current_Plan). The above execution, reflection, and replanning process is repeated until the execution status (Execution_Status) is set to the success flag (SUCCESS), or the current number of attempts (attempts) reaches the maximum number of retries (Max_Retries). If the task still fails after reaching the maximum number of retries, a failure report is returned: the string "Task execution failed, maximum number of retries reached", along with the error information from the last execution log (Logs).

5. The multi-agent task planning method based on memory and reflection mechanisms according to claim 4, characterized in that, In step S4, the current correct case is determined. chain of thought Is it empty? If the thought chain is empty, then call the teacher model. of Method: Input the user question from the case. and the chain of execution steps of the intelligent agent Generate planning rationale and store it in the thought chain. Termination condition judgment, call the keyword extraction model Enter the user question from the case. Output case keywords Call the deduplication judgment model of Method: Input case keywords and vector database Output a list of similar cases. Call the deduplication function The input consists of the current correct case (Correct_Case) and the list of similar cases (Similar_Cases). If there are no complete duplicates, the input logic is executed, adding the current correct case (Correct_Case) to the vector database Memory_Base, and the deduplication judgment ends. The updated data in the vector database Memory_Base is used for future task retrieval.

6. A multi-agent task planning system based on memory and reflection mechanisms, characterized in that, The method for performing the multi-agent task planning method based on memory and reflection mechanism as described in any one of claims 1-5 includes a memory module (1), a planning module (2), and an embedding model (3). The embedded model (3) is connected to the memory module (1), and the memory module (1) is connected to the planning module (2); The memory module (1) includes a vector database, a teacher model storage module, a keyword extraction model storage module, and a deduplication judgment model storage module. The teacher model storage module is connected to the deduplication judgment model storage module, and the deduplication judgment model storage module is connected to the vector database. The planning module (2) includes a planner and a reflection model storage module connected in sequence.