An agent execution method and system based on LLM supporting breakpoint recovery and task concurrency

By using DAG Blueprint and node state persistence mechanism, complex tasks are decomposed into independently executable nodes. Combined with PReAct node-level thinking execution mechanism and human-machine supplementation, the instability and repetitiveness of task execution in existing technologies are solved, and the planarability, recoverability and efficient execution of complex tasks are realized.

CN123178013APending Publication Date: 2026-11-27WUXI ZHONGKE NORTH WEST STAR TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611511986.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

The existing ReAct mechanism lacks a global task structure and stable recovery capabilities. The Planning mechanism is inadequate in terms of dynamic adjustment, local failure recovery, concurrent scheduling, and human-machine supplementation. The memory management method has not yet fully solved the problems of task node-level breakpoint recovery and safe execution.

Method used

By adopting the DAG Blueprint task blueprint and node state persistence mechanism, complex tasks are decomposed into independently executable nodes. The PReAct node-level thinking execution mechanism is used for local planning and dynamic adjustment. Combined with human-computer supplementation and historical memory compression, the execution mode of tasks can be planned, decomposed, concurrent, interruptible, and recoverable.

Benefits of technology

It improves the execution stability, processing efficiency, and result controllability in complex and long-term task scenarios, reduces the time overhead of repeated analysis and modification, improves the efficiency of processing multi-source data, reduces the result bias caused by incorrect assumptions, and enhances the efficiency of context utilization in long-term tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178013A_ABST
    Figure CN123178013A_ABST
Patent Text Reader

Abstract

The application discloses an agent execution method and system based on LLM, which supports breakpoint recovery and task concurrency, solves the problems of breakpoint recovery and task concurrency, and belongs to the field of artificial intelligence; executable nodes in a DAG Blueprint task blueprint are dispatched to a PReAct execution queue, and a state snapshot is generated by updating the state in real time; when it is identified that the current node execution fails, is paused, tool calling is abnormal or the system is interrupted, the snapshot is read and the execution queue is reconstructed, and the execution is recovered from the breakpoint when the recovery condition is met; nodes with a dependency relationship are executed in series according to a topological sequence, and independent nodes without a dependency relationship are selected to be executed simultaneously, staggered or limited concurrently based on permission resource constraints; the execution history is compressed in multiple layers, and the output result is summarized after all nodes are executed; the application makes the task execution process have the effects of being programmable, decomposable, concurrent, interruptible, recoverable and cooperatively supplemented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical fields of artificial intelligence, large language model agents, automatic task planning, tool invocation and memory compression, and relates to an agent execution method and system based on LLM that supports breakpoint recovery and task concurrency. Background Technology

[0002] With the development of large language models, agent systems based on these models are increasingly being used for complex tasks such as code generation, data analysis, document processing, business process automation, and external tool invocation. These systems typically require task decomposition based on user goals and the integration of external capabilities such as file reading / writing, API access, code execution, and database queries to complete the task through multiple rounds of interaction.

[0003] The ReAct mechanism, proposed by Yao et al. in their paper "ReAct: Synergizing Reasoning and Acting in Language Models" published at the International Conference on Learning Representations (ICLR 2023), is authored by Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. Its core idea is to alternately generate reasoning content and external actions during the reasoning process of a large language model, enabling the model to dynamically adjust subsequent steps based on the results returned by tools or the environment. This mechanism offers good flexibility and is suitable for open-ended problems and tasks with high uncertainty. However, the ReAct mechanism typically focuses on single-step reasoning and immediate feedback, lacking a stable global task structure. When the task chain is long, the dependencies are complex, or multiple tools need to collaborate, problems such as divergent execution paths, repeated attempts, missed subtasks, continuous context expansion, and difficulty in tracking overall progress can easily arise. Meanwhile, due to the lack of continuous constraints on global goals and task dependencies, the ReAct mechanism is prone to "sub-goal offset" or "goal misalignment" in multi-sub-task scenarios. That is, the model over-optimizes local results in order to complete the current local step, but ignores the consistency between the step and the final task goal.

[0004] The planning mechanism typically generates an overall plan from a large model and then executes it step by step. Compared to the simple ReAct mechanism, this approach has a clearer task decomposition capability, but traditional planning mechanisms often suffer from static planning. Once the plan is generated, it is difficult to make fine-grained adjustments based on tool results, user-added information, or execution anomalies. When an intermediate step fails, the system often can only replan or temporarily modify the plan by the model, lacking structured management of task node status, dependencies, execution results, and reasons for failure. Therefore, in complex tasks, while the planning mechanism has overall planning capabilities, it still has shortcomings in dynamic execution, partial failure recovery, concurrent scheduling, and human-machine collaborative support.

[0005] To address the issue of historical context bloat in long-task agents, the paper "HiAgent: Hierarchical Working Memory Management for Solving Long-Horizon Agent Tasks with Large Language Model" by Mengkang Hu, Tianxing Chen, Qiguang Chen, Yao Mu, Wenqi Shao, and Ping Luo proposes a hierarchical working memory management method. This method organizes the task process through sub-goals and summarizes historical actions and observations to reduce the impact of redundant context on model execution in long tasks. While this method demonstrates the importance of memory management in long-task agents, its focus is on the organization and compression of working memory, and it has not yet established a complete recoverable execution mechanism for task node states, failure reasons, user-supplemented information, and execution results from external tools.

[0006] Furthermore, in her paper "Task Memory Engine Spatial Memory for RobustMulti-Step LLM Agents," Ye Ye proposed a task graph representation method based on spatial memory. This method uses tree or directed acyclic graph structures to track user intent, subtasks, and dependencies in multi-step tasks, mitigating issues such as illusions, repetitive actions, and user correction misunderstandings caused by linear context. This method primarily focuses on task memory representation and user correction management. Its task graph is mainly used to maintain semantic state and generate consistent responses, and has not yet directly formed a runtime blueprint for tool invocation and task execution. On the one hand, this method requires continuous intent classification, node updates, and related subgraph retrieval in multiple rounds of interaction, which incurs overhead for graph maintenance and retrieval during inference. On the other hand, nodes in the graph do not establish strong binding relationships with actual execution states, tool invocation records, failure reasons, and recovery points, making it difficult to directly trace the specific execution process based on the task graph. In addition, existing task graphs mainly serve context organization and do not treat nodes without dependencies as parallel schedulable execution units. Therefore, it remains difficult to achieve concurrent execution, node-level recovery, and continuous progress after local failures in complex tasks.

[0007] In practical applications, complex agent tasks are typically not simple linear processes. For example, in software development tasks, an agent might need to analyze code repositories, locate problems, modify multiple files, run tests, and continue fixing issues based on the test results. In enterprise report generation tasks, an agent might need to read multiple documents in parallel, retrieve historical data, call databases, and generate the final file. If execution is interrupted due to abnormal test environments, external interface timeouts, insufficient permissions, or missing user information, existing ReAct or Planning methods often struggle to accurately determine which steps have been completed, which intermediate results are still valid, and which nodes need to be retried, leading to overall task rollback, repeated execution, or inconsistent states.

[0008] In summary, while the existing ReAct mechanism has dynamic feedback capabilities, it lacks a global task structure and stable recovery capabilities; while the existing Planning mechanism has task decomposition capabilities, it still has shortcomings in dynamic adjustment, partial failure recovery, concurrent scheduling, and human-machine supplementation; while existing memory management methods can alleviate the context bloat problem of long tasks, they have not yet fully solved the problems of task node-level breakpoint recovery and safe execution. Summary of the Invention

[0009] This invention aims to provide an agent execution method and system based on LLM that supports breakpoint recovery and task concurrency, addressing the shortcomings of existing ReAct mechanisms in lacking a global task structure and stable recovery capabilities; the deficiencies of existing Planning mechanisms in dynamic adjustment, local failure recovery, concurrent scheduling, and human-machine supplementation; and the inadequacy of existing memory management methods in fully resolving task node-level breakpoint recovery and secure execution issues. This invention discloses an agent execution method combining a global task blueprint and local dynamic reasoning, enabling the system to generate a traceable DAG Blueprint at the start of a task, schedule task nodes according to dependencies during execution, and save node states when encountering failures, pauses, missing information, or manual intervention, thereby supporting continuation of execution from the breakpoint. Meanwhile, this invention also includes a historical memory compression mechanism, which reduces context costs and improves task recovery reliability. Compared with existing ReAct mechanisms, Planning mechanisms, and simple history appending agent operation methods, this invention transforms complex agent tasks from the traditional one-time continuous execution mode into a structured execution mode based on task nodes. This enables the task execution process to have the technical effects of being plannable, decomposable, concurrent, interruptible, recoverable, and collaboratively supplementary, thereby improving the execution stability, processing efficiency, and result controllability in complex long-task scenarios.

[0010] The objective of this invention is specifically achieved through the following technical solutions: This invention discloses, in one aspect, an agent execution method based on LLM that supports breakpoint recovery and task concurrency, comprising: Step 1: The Large Language Model (LLM) acts as the planner, and the Agent acts as the executor. The received complex task is recursively decomposed into a DAG Blueprint, where each node corresponds to an independently executable local task, and the input-output dependencies between nodes drive the execution order. Step 2: Assign the first node in the dependency relationship that is executable to the PReAct execution queue; the nodes in the queue follow the PReAct node-level thinking execution mechanism, and within the node, they sequentially execute the following: generate a local plan, determine whether the execution conditions (Reason) are met, execute the specific action (Act), and verify the node output result (Check); during the execution process, the current state of each node is updated in real time and the gateway is synchronized to write back the task blueprint, generating a persistent node state snapshot; Step 3: After the predecessor nodes in the dependency relationship of the current node that is in the executable state have completed their execution, the current node is put into the PReAct execution queue. If the execution of the current node fails, is paused, or is interrupted by a tool call abnormally or the system is interrupted during the execution process, the persistent node state snapshot is read and the execution queue is rebuilt according to the dependency relationship. After the recovery conditions are met, the current node state is changed to executable and execution is resumed from the breakpoint. Step 4: Real-time analysis of the dependencies of the current nodes in the queue. For current nodes with dependencies, execute them sequentially in topological order. For independent nodes without dependencies, select simultaneous, staggered, or limited concurrent execution based on permission and resource constraints. Step 5: Perform multi-layer compression on the execution history according to preset rules to retain key results and recovery clues; after all nodes have been executed, summarize the output results of each node to obtain the final result.

[0011] Another aspect of the present invention discloses an agent execution system based on LLM that supports breakpoint recovery and task concurrency, comprising: The task blueprint generation module uses a large language model (LLM) as the planner and an agent as the executor to recursively decompose the received complex tasks into a DAG Blueprint. Each node in the blueprint corresponds to an independently executable local task, and the input-output dependencies between nodes drive the execution order. The PReAct module is used to dispatch the first executable node in the dependency relationship to the PReAct execution queue. The nodes in the queue follow the PReAct node-level thinking and execution mechanism, which sequentially generates a local plan, determines whether the execution conditions are met (Reason), executes the specific action (Act), and verifies the node output result (Check). During the execution process, the current state of each node is updated in real time and the gateway is synchronized to write back the task blueprint, generating a persistent snapshot of the node state. The breakpoint recovery module is used to add the current node to the PReAct execution queue after the execution of the predecessor node in the dependency relationship of the current node that is detected as executable. If the execution of the current node fails, is paused, or is interrupted by a tool call, or is interrupted during the execution process, it reads the persistent node state snapshot and rebuilds the execution queue according to the dependency relationship. After the recovery conditions are met, the current node state is changed to executable and execution is resumed from the breakpoint. The serial concurrent execution module is used to parse the dependencies of the current nodes in the queue in real time. For the current nodes with dependencies, they are executed serially in topological order. For independent nodes without dependencies, they are executed simultaneously, staggered, or with limited concurrent execution based on permission and resource constraints. The compression and aggregation module is used to compress the execution history in multiple layers according to preset rules, retaining key results and recovery clues; after all nodes have been executed, the output results of each node are aggregated to obtain the final result.

[0012] The beneficial effects of this invention are: 1. Compared with existing ReAct mechanisms, Planning mechanisms, and simple history appending Agent operation methods, this invention transforms complex Agent tasks from the traditional one-time continuous execution mode into a structured execution mode based on task nodes. This enables the task execution process to have the technical effects of being plannable, decomposable, concurrent, interruptible, recoverable, and collaboratively supplemented, thereby improving the execution stability, processing efficiency, and result controllability in complex long-task scenarios.

[0013] 2. In software development and code repair scenarios, traditional agents, in their long chain of analyzing code repositories, modifying files, and running tests, often need to re-analyze the repository and repeat previous steps if interrupted due to test environment anomalies, missing dependencies, or tool call failures. This invention, through a DAG Blueprint task blueprint and node state persistence mechanism, can record the completion status, intermediate results, and recovery points of each node. This allows the system to directly resume execution from specific nodes such as "run tests" or "continue repair" after an anomaly recovery, reducing the time overhead of repeated analysis and modification, thereby improving the continuous execution capability of complex code-related tasks.

[0014] 3. In document processing, report generation, and data organization scenarios, tasks typically involve multiple stages such as multi-document reading, historical data retrieval, content extraction, summary analysis, and result generation. Traditional linear agents often proceed sequentially, resulting in low overall processing efficiency. This invention utilizes a dynamic concurrent scheduling mechanism to execute multiple data reading, database query, and content retrieval nodes without dependencies or conflicts in parallel, thereby shortening the overall task time and improving execution efficiency in multi-source data processing scenarios.

[0015] 4. In scenarios requiring user confirmation, such as contract review, form processing, and business rule analysis, traditional agents are prone to making assumptions about key conditions when information is insufficient, leading to inconsistencies between the final output and the user's actual needs. This invention, through a human-machine supplementation mechanism, proactively suspends the corresponding node and initiates structured questions to the user when unclear task boundaries, missing inputs, ambiguous output formats, or business rules awaiting confirmation. After receiving the necessary supplementary information, execution resumes from the original breakpoint. Therefore, this invention reduces result deviations caused by erroneous assumptions, improving the accuracy and user controllability in complex business scenarios.

[0016] 5. In cross-system calls and business process automation scenarios, agents often need to access the file system, database, retrieval service, and third-party interfaces sequentially. Existing agents, during long-running processes, are prone to a decline in their focus on key task objectives, latest status, and failure reasons due to the continuous accumulation of historical context. This invention employs a multi-layered historical memory compression mechanism to process excessively long tool outputs, expired tool messages, failed call trajectories, and remote history in layers. This allows the model to retain key conclusions and recovery clues in subsequent executions without repeatedly carrying large amounts of redundant information, thereby improving the efficiency of context utilization in long-cycle tasks and reducing the inference burden.

[0017] 6. In agent application scenarios requiring multi-step collaboration and long execution cycles, such as software development assistance, automatic organization of enterprise data, complex document generation, and business process concatenation, this invention unifies global task blueprints, node-level dynamic execution, breakpoint recovery, concurrent scheduling, human-machine supplementation, and historical compression mechanisms into a single operational framework. This transforms the agent from a traditional one-time continuous generation mode to an engineered execution mode that is plannable, pauseable, supplementable, recoverable, and traceable. This invention is more suitable for implementing complex tasks in real-world production environments and has strong practical value. Attached Figure Description

[0018] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.

[0019] Figure 1 This is a schematic diagram of the execution architecture provided in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the overall execution flow provided in the embodiments of the present invention.

[0021] Figure 3 This is a schematic diagram of the node breakpoint recovery mechanism provided in an embodiment of the present invention.

[0022] Figure 4 This is a schematic diagram of the single-node thinking and execution mechanism provided in an embodiment of the present invention.

[0023] Figure 5 This is a schematic diagram of the human-machine complementarity mechanism provided in an embodiment of the present invention.

[0024] Figure 6 This is a schematic diagram of the dynamic concurrent scheduling mechanism provided in an embodiment of the present invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0026] This invention provides an LLM-based agent execution method that supports breakpoint recovery and task concurrency. It relates to an agent running method that supports DAG task blueprints, concurrent execution, human-machine supplementation, breakpoint recovery, and historical context compression, including: Step 1: The Large Language Model (LLM) acts as the planner, and the Agent acts as the executor. The received complex task is recursively decomposed into a DAG Blueprint, where each node corresponds to an independently executable local task, and the input-output dependencies between nodes drive the execution order. For example, after receiving a user's task request, the system first uses a large language model to parse the user's goals, constraints, expected output format, and available external capabilities. It then breaks down the complex task into multiple task nodes with clear input-output relationships, generating a traceable DAG Blueprint. This task blueprint not only describes which subtasks the task includes, but also the dependencies between nodes, executable conditions, state information, and key records required for subsequent recovery.

[0027] Step 2: Assign the first node in the dependency relationship that is executable to the PReAct execution queue; the nodes in the queue follow the PReAct node-level thinking execution mechanism, and within the node, they sequentially execute the following: generate a local plan, determine whether the execution conditions (Reason) are met, execute the specific action (Act), and verify the node output result (Check); during the execution process, the current state of each node is updated in real time and the gateway is synchronized to write back the task blueprint, generating a persistent node state snapshot; For example, each node in the queue first generates a local execution plan around the current node's goal, then determines whether the existing inputs, prerequisite results, and execution conditions are sufficient, then calls the corresponding tools to complete the specific actions, and finally verifies the node's output. In this way, the system combines global task planning with local dynamic execution, enabling nodes to adjust based on actual feedback during execution without deviating from the overall task goal.

[0028] Step 3: After the predecessor nodes in the dependency relationship of the current node that is in the executable state have completed their execution, the current node is put into the PReAct execution queue. If the execution of the current node fails, is paused, or is interrupted by a tool call abnormally or the system is interrupted during the execution process, the persistent node state snapshot is read and the execution queue is rebuilt according to the dependency relationship. After the recovery conditions are met, the current node state is changed to executable and execution is resumed from the breakpoint. For example, when insufficient input information, user confirmation required for results, or unsuitable conditions for continued automatic inference occur during node execution, the system triggers a human-machine supplementation mechanism. This updates the corresponding node's status to "to be supplemented" and sends a structured question to the user. After the user provides the necessary information, the system writes the response back to the node's input or confirmation field and re-enters the executable state, allowing the process to continue from the original breakpoint without reanalyzing the entire task. In this way, the present invention establishes a recoverable connection between automatic execution and manual confirmation.

[0029] When a node fails to execute, a tool call fails, the process is paused, or a system interruption occurs, the system does not consider the entire task a failure. Instead, it uses persistent node state records and DAG Blueprints to determine which nodes have completed, which need to be retried, which are waiting to be added, and which can continue execution once recovery conditions are met. After restarting or resolving the exception, the system can directly resume execution from the unfinished or failed nodes, thus avoiding rerunning completed preceding steps and reducing resource consumption caused by repeated inference and calls.

[0030] Step 4: Real-time analysis of the dependencies of the current nodes in the queue. For current nodes with dependencies, execute them sequentially in topological order. For independent nodes without dependencies, select simultaneous, staggered, or limited concurrent execution based on permission and resource constraints. For example, during node execution, the system continuously records node status, inputs and outputs, intermediate results, failure reasons, and recovery points. When a node executes successfully and passes verification, its status is updated to "completed," and its output is written back to the status synchronization gateway, serving as one of the input sources for subsequent nodes. When there are no dependency conflicts between multiple nodes, and their execution conditions are all met, the system can schedule multiple nodes to execute concurrently, thereby improving the overall efficiency of complex tasks. For nodes that still have dependencies, the system continues to schedule subsequent nodes according to the order constraints in the task blueprint.

[0031] Step 5: Perform multi-layer compression on the execution history according to preset rules to retain key results and recovery clues; after all nodes have been executed, summarize the output results of each node to obtain the final result.

[0032] For example, for excessively long tool outputs, expired tool results, invalid failure trajectories, and earlier historical messages, the system performs preview replacement, placeholder compression, failure combination cleanup, or boundary summary folding according to preset rules. This reduces redundant content entering the model context while preserving key execution clues, recovery information, and the most recent state. Thus, the system can continuously maintain focus on key objectives, current state, and pending issues in long-chain tasks.

[0033] Once all target nodes have completed their execution, the system summarizes the output of each node and generates the final result based on the user's initial task requirements, returning it to the user. Thus, this invention forms a complete agent runtime loop from task parsing, global planning, node execution, concurrent scheduling, human-machine supplementation, state persistence, breakpoint recovery to result output, enabling the agent to adapt to complex task scenarios involving long cycles, multiple steps, and multi-tool collaboration. Figure 1 and Figure 2 As shown.

[0034] In step one, the DAG Blueprint task blueprint is represented as follows: ; In the formula, B represents the DAG Blueprint task blueprint, V represents the set of nodes, E represents the input-output dependencies between nodes, S represents the set of node states, M represents the historical memory summary corresponding to the node, and R represents the node recovery information. Through this structure, the system can simultaneously know "what the task plan is" and "where the task has progressed".

[0035] Upon receiving a user task, this invention does not immediately execute the large model according to a linear plan from beginning to end. Instead, it first allows the large model planner to break down the user task into an executable, traceable, and reversible task blueprint. This task blueprint is called a DAG Blueprint. Its function is similar to a construction drawing in a complex project: it not only indicates what needs to be done, but also which things must be done first, which things can be done simultaneously, what inputs are needed for each step, what outputs will be produced, and where to continue from if execution fails.

[0036] For example, when a user requests the Agent to "analyze a code project and fix test failures," the traditional approach might simply generate linear steps like "read the project, analyze errors, modify code, run tests, and output results." However, in this solution, the system further breaks the task down into multiple manageable nodes, such as "read the project structure," "read test logs," "locate relevant source code," "analyze the cause of failure," "generate a modification plan," "modify code files," "run tests," "continue fixing based on test results," and "generate final documentation." Each node has its own goal, input, output, and status. This way, even if one node fails, the system knows which step failed, rather than treating the entire task as a failure.

[0037] Each task node can be understood as a small task list with status. It includes not only "what to do," but also "what is needed," "what tools can be used," "whether it has been completed," and "how to recover in case of failure." In step one, each node is represented as follows: ; In the formula, For the current node, `goal_i` represents the goal of the current node, indicating an independently executable local task, i.e., what the current node needs to accomplish; `input_i` represents the input required for the current node's execution, i.e., the files, data, user-added information, or results from upstream nodes that the current node needs to read; `output_i` represents the output result after the current node's execution, i.e., the text, files, data, or tool results generated after the current node completes; `dep_i` represents the prerequisites, indicating the preceding nodes in the dependency relationship, i.e., which nodes must be completed before the current node can execute; `tool_i` represents the tools that can be called, such as file reading, code execution, database queries, and API requests; `perm_i` represents the permission scope, i.e., which resources the current node can and cannot access; `mem_i` represents the memory summary of the current node, i.e., the key conclusions, user requirements, and tool results during the execution process of the current node; `rec_i` represents the failure reason and recovery point, recording the failure reason, recovery location, and next step if the node fails; `state_i` represents the current node's state, including: pending execution, executable, running, pending supplementation, paused, failed execution, and completed. "Pending execution" indicates that the predecessor nodes in the dependency relationship of the current node have not completed execution. An executable node indicates that after the preceding nodes in the preceding dependencies have completed execution and the current node meets the execution conditions, the current node can be dispatched by the scheduler. Running indicates that the current node is executing the PReAct node-level thinking execution mechanism; The missing information indicates that the current node is missing information during execution. "Paused" indicates that the current node is temporarily suspended due to permission restrictions, manual intervention, or system policies. Execution failure indicates that an exception occurred during the current node's tool invocation, result verification, or external access. "Completed" indicates that the output of the current node has passed verification and can be used by subsequent nodes.

[0038] The value of this state design lies in the system's ability to clearly understand the actual progress of each node. For example, if a node enters a "pending completion" state due to a lack of user confirmation, the system will not halt the entire task but can continue executing other nodes that do not depend on this information. Once the user confirmation is complete, the node will re-enter the execution queue. Similarly, if a node enters an "execution failed" state due to a tool call failure, the system will record the reason for the failure and the recovery point, allowing for subsequent options such as retrying, using other tools, or requesting user assistance.

[0039] Even after a task is interrupted or the system restarts, the system doesn't need to reread the entire dialogue and re-reason the task. It only needs to read the saved DAG Blueprint to determine which nodes have been completed, which haven't been executed, which have failed, and which are awaiting user input. For completed nodes, the system directly reuses their output; for failed nodes, the system continues processing based on recovery information; and for nodes awaiting input, the system waits for user input before continuing execution. In this way, complex tasks can be recovered from specific nodes, just like engineering tasks, instead of starting from scratch.

[0040] Therefore, the DAG Blueprint in this scheme is not a simple list of plans, but an executable task blueprint. It simultaneously serves the functions of task decomposition, dependency management, state tracking, parallel scheduling, and breakpoint recovery. Through this task blueprint, the Agent can maintain global goal constraints while executing complex and long tasks, avoiding the divergence of execution paths and sub-goal offsets in traditional ReAct, and also avoiding the problem of having to replan the entire process after a failure in a step in traditional Planning.

[0041] The system determines whether a node can begin execution based on its dependencies. The decision rule can be simplified as follows: A node is executable if all preceding nodes are completed and the current node's permissions are satisfied. In other words, a node will only be placed in the execution queue when all its prerequisite tasks have been completed and its required file, tool, network, or interface permissions are met. If multiple nodes meet the execution conditions and are independent of each other, the system can allow these nodes to execute in parallel. For example, in a report generation task, the three nodes "read document A," "read document B," and "query database C" are independent of each other and can be executed simultaneously without having to wait one after another.

[0042] In step two, the persistent node state snapshot generated for a single node is represented as follows: ; In the formula, This represents a persistent snapshot of the node's state. state_i represents the current state of the node, input_i represents the input used by the node during execution, output_i represents the output or intermediate results generated by the node, log_i represents the execution log and tool call records, failure_i represents the reason for failure, checkpoint_i represents the recovery point information, and time_i represents the timestamp information.

[0043] Tasks executed by agents are typically characterized by numerous steps, long durations, complex dependencies, and high levels of external tool involvement. Therefore, relying solely on the current context memory of the large model to maintain the execution process is unstable. To address task interruptions caused by tool malfunctions, system interruptions, insufficient permissions, user intervention delays, or manual pauses, this solution establishes a node state persistence and breakpoint recovery mechanism based on the DAG Blueprint. The core idea of ​​this mechanism is not to base task completion on the success of a single continuous execution, but rather to break down the entire task into multiple independently recordable, independently judged, and independently recoverable nodes. During the execution of each node, its state, intermediate results, and recovery information are continuously saved, allowing the system to resume execution from the specific breakpoint after an interruption, rather than starting from scratch.

[0044] Specifically, when each node in the task blueprint is scheduled for execution, the system establishes a corresponding status record for that node. This status record doesn't just store "success" or "failure" results, but rather saves key operational information throughout the entire process from preparation to completion, including current status, start time, last update time, input source, intermediate results, tool call records, failure reason, user assistance, and recovery location. In this way, the system can accurately determine whether a node has not yet started, is currently executing, is waiting for assistance, has failed, or has already completed. It can also determine what step the node reached before failure, which results can still be reused, and which actions need to be re-executed.

[0045] For unified management, the node status in this solution can include the following categories: Pending Execution, Executable, Running, Pending Supplementation, Paused, Execution Failed, and Completed. "Pending Execution" indicates that the node still has unmet prerequisites; "Executable" indicates that the prerequisites have been met and the node can be assigned by the scheduler; "Running" indicates that the node is executing a partial PReAct process; "Pending Supplementation" indicates that the node has encountered missing necessary information during execution and needs to wait for user or external system supplementation; "Paused" indicates that the node has been temporarily stopped due to permission restrictions, manual intervention, or system policies; "Execution Failed" indicates that the node encountered an exception during tool invocation, result verification, or external access; and "Completed" indicates that the node's output has passed verification and can be used by subsequent nodes. Through these statuses, the system can break down the execution process of a complex task into multiple observable and recordable stages, rather than treating the entire task as an indivisible continuous action.

[0046] Persistent node state snapshots do not require saving in a specific database format, but rather illustrate that the system will structurally preserve key content that affects subsequent recovery during node execution.

[0047] The value of node state persistence lies in ensuring that system interruption is not directly equivalent to task failure. For example, in a code repair task, the agent might have completed three nodes: "reading the project structure," "locating failed test cases," and "analyzing relevant source code," but the process is interrupted at the "running tests" node due to missing dependencies in the test environment. Without state persistence, after a system restart, it would often have to re-analyze the entire code repository, relocate the problem, and regenerate the solution, wasting computational resources and potentially leading to different processing paths due to context changes. In this solution, the system retains the completion status and output of the first three nodes, marks the "running tests" node as failed or paused, and records the reason for failure: missing environment. Subsequently, as long as the dependency issue is resolved, the system can directly continue from the "running tests" node without re-executing the completed parts.

[0048] Besides system anomalies, user-supplemented information is another important scenario for breakpoint recovery. In complex tasks, agents often encounter situations where information is insufficient but not suitable for self-assumption, such as requiring user confirmation of output format, supplementation of account permissions, provision of missing files, or confirmation of business rules. Traditionally, such missing information often halts the entire task, or the model guesses to continue execution, leading to subsequent results deviating from the true objective. In this solution, when a node detects missing necessary information, it updates its status to "pending supplementation," while saving the currently completed judgment results, the missing information items, and the pause point. After the user supplements the information, the system does not need to reanalyze the entire task; it only needs to read the previously saved record of that node, write the supplemented information into the corresponding input fields, and then continue execution from the original breakpoint. This reduces redundant reasoning and minimizes bias caused by incomplete context reconstruction.

[0049] During breakpoint recovery, the system first reads the persistent DAG Blueprint and the status records of each node to identify which nodes in the current task have been completed, which are still pending execution, which are in a failed or paused state, and which are waiting for user intervention. Then, the system reconstructs the executable queue based on node dependencies. For completed nodes, the system directly reuses their output; for nodes awaiting intervention, the system determines whether the intervention conditions have been met; for failed nodes, the system decides whether to retry, replace tools, adjust permissions, or request manual intervention based on the reason for failure; for nodes that can continue execution, the system re-enters the scheduling process. Therefore, task recovery no longer relies on re-enacting the complete historical dialogue, but rather on a joint judgment based on node-level status records and the task blueprint.

[0050] To ensure that the recovery process has clear boundaries, this solution simplifies the node recovery conditions to the following logic: A node is recoverable if: the node has persistent records, the results of its prerequisites are available, and the recovery conditions are met. The "recovery conditions met" can include the availability of supplementary information, authorization of permissions, re-availability of external tools, and system restart completion. Only when these conditions are met will a node transition from a failed, paused, or pending state back to an executable state. This mechanism avoids blindly retries when conditions are not met, reducing invalid calls and repeated failures.

[0051] For ease of explanation, typical information regarding node state persistence and recovery processes can be summarized in Table 1: Table 1 Compared to the traditional ReAct mechanism, this solution does not rely on the model "remembering" its progress within a continuous context. Instead, it saves task progress through externalized, structured node state records. Compared to the traditional Planning mechanism, this solution does not simply reread a static plan text but can conditionally recover by combining real-time node states, intermediate artifacts, and failure reasons. Therefore, this mechanism transforms the Agent task from a "one-time completion mode" to an "interruptible, resumable, and partially retryable mode," making it more suitable for complex real-world scenarios such as software development, document processing, cross-system calls, and long-process automation. Figure 3 As shown.

[0052] In step two, when each node in the queue follows the PReAct node-level thinking execution mechanism, if the node output result fails the verification, Check returns the Reason based on the failure reason, re-executes Act, or suspends the node; The execution conditions in Reason include the files, tools, network, resources, priority, and interface permissions required for a node to execute a task.

[0053] After the DAG Blueprint is built, the system does not directly execute each node as a fixed command. Instead, it initiates the PReAct node-level execution mechanism for each executable node, such as... Figure 4 As shown. PReAct refers to the execution flow of planning, reasoning, acting, and checking sequentially within a single task node, namely Plan, Reason, Act, and Check. The purpose of this mechanism is to enable each node to have local autonomous processing capabilities while remaining within the global task blueprint.

[0054] Traditional ReAct mechanisms typically involve a continuous cycle of "think, act, observe" at the overall task level. While this offers flexibility, it can easily lose its global direction in long tasks. This approach confines the dynamic feedback capability of ReAct within a defined DAG node. In other words, a node can make local adjustments based on tool results during execution, but its goals, inputs, outputs, available tools, and scope of permissions are all pre-defined by the DAG Blueprint. This prevents the model from deviating from the overall task objective in pursuit of a local action.

[0055] The Plan phase in PReAct is used to generate a local execution plan for the current node. This plan is only for the current node, rather than replanning the entire task. For example, when the node goal is "analyze the reasons for test failures," the Plan phase will first determine which logs need to be read, which error messages to focus on, and whether relevant source code needs to be reviewed, without arbitrarily modifying the code or jumping to the report generation phase. In this way, the system can separate global planning from local planning: global planning is handled by the DAG Blueprint, and local execution paths are handled by the PReAct nodes.

[0056] The Reason phase determines whether the current node meets the execution requirements and analyzes existing information. In this phase, the node checks if the output of the preceding node is complete, if the current input is sufficient, if there is any unconfirmed user information, if tools need to be invoked, and if the current operation might exceed the scope of permissions. If necessary information is missing, the node will not continue to speculate but will update its status to "Pending Supplementation" and request confirmation from the user through the human-machine supplementation module. If insufficient permissions are found, the node will enter a "Paused" or "Pending Authorization" state instead of directly executing a high-risk operation.

[0057] The Act phase is used to execute specific actions. These actions can include reading files, retrieving information, calling APIs, executing code, querying databases, generating text, modifying files, or calling business system interfaces. Unlike ordinary tool calls, the Act phase in this solution is restricted by node fields: nodes can only call tools declared in their tool_i, and can only execute within the permission scope defined by perm_i. This way, even if multiple nodes execute concurrently, permission violations, environment contamination, or resource conflicts between different nodes can be avoided.

[0058] The Check phase is used to validate the node output. Validation includes: whether the node output meets the current node's objective, whether the output format conforms to the input requirements of subsequent nodes, whether the tool call was successful, whether there is any obvious missing information, and whether a retry or user request for supplementation is necessary. If the validation passes, the system updates the node status to "Completed" and writes the node output to the status synchronization gateway; if the validation fails, the system updates the node status to "Execution Failed," "Pending Supplementation," or "Paused" based on the failure type, and records the reason for the failure and the recovery point.

[0059] The execution process of PReAct can be simplified as follows: ; Here, vi represents the current task node. If the Check phase fails, the system will not abandon the entire task directly. Instead, it will return to the Reason phase, re-execute the Act phase, or suspend the node for user intervention, depending on the reason for failure. In this way, the failure is confined to the current node and will not immediately affect the entire DAG Blueprint.

[0060] Within a node, PReAct can form a small loop. For example, when the "Run Tests" node fails, the Check phase determines the cause of the failure. If the failure is due to missing dependencies, the node can record the missing information and enter a "Pending Supplement" or "Paused" state; if the failure is due to a code logic error, the node can pass the test results to the subsequent "Continue to Fix" node; if the failure is a temporary tool exception, the Act phase can be re-executed according to the retry strategy. Thus, the system can adopt different handling methods for different failure types, rather than simply retrying the entire process.

[0061] For ease of explanation, the internal flow of the PReAct node can be described as shown in Table 2: Table 2 The difference between this mechanism and traditional ReAct lies in the fact that traditional ReAct's thinking and actions typically revolve around the entire task, easily deviating from the original goal as the context changes; while this solution's PReAct operates only within the DAG node, where node goals, inputs and outputs, tools, and permissions are all constrained by the task blueprint. The difference between this mechanism and traditional Planning lies in the fact that traditional Planning typically executes statically according to a pre-generated plan, while this solution's PReAct nodes can make local dynamic adjustments during execution based on tool return results, verification results, and user-supplemented information.

[0062] Therefore, the PReAct node-level thinking and execution mechanism combines the structured task constraints of Planning with the dynamic feedback capabilities of ReAct. At the global level, the DAG Blueprint ensures that task objectives, dependencies, and execution states are traceable; at the local level, PReAct ensures that individual nodes can be flexibly adjusted based on actual execution results. Through this design, this solution avoids both the path divergence and target misalignment problems of traditional ReAct, and the lack of local recovery capabilities in abnormal scenarios that traditional Planning suffers from.

[0063] In step three, the recovery conditions that must be met include: For nodes that have already been completed, their output can be reused directly. For the node to be added, determine whether the addition conditions have been met; For failed nodes, decide whether to retry, replace tools, adjust permissions, or request manual intervention based on the reason for the failure. For nodes that can continue execution, they are re-entered into the PReAct execution queue.

[0064] In step three, when the breakpoint status is identified as needing to be supplemented during execution, the execution of the current node is paused, the node is suspended, the node record and breakpoint position are saved, and the human-machine supplementation mechanism is triggered to send a structured question or optional supplementation request to the user. Upon receiving confirmation and supplementary information from the user, read the saved node record, write the confirmation and supplementary information into the corresponding input field, change the current node status to executable, and resume execution at the saved breakpoint. Upon receiving a negative supplementary message from the user, the current task link is terminated, and subsequent nodes on that link are no longer scheduled.

[0065] In step three, the breakpoint status during execution is identified as a trigger scenario to be supplemented as follows: Input is missing, including missing files, parameters, accounts, paths, or business fields; The constraints are unclear, including the output format, task boundaries, or priorities not being clearly defined; High-risk assumptions include those where the system is inferable but the cost of inference errors exceeds a threshold. Permissions are not confirmed, including the need to access restricted files, commands, interfaces, or external systems; The results are pending confirmation, including those that have already been generated, but a final solution still needs to be selected.

[0066] In complex agent tasks, not all nodes can automatically complete the task solely based on existing context and tool results. In practice, situations often arise where the task objective is clear, but local execution conditions are insufficient. These conditions may include missing necessary files, incomplete user constraints, unconfirmed output formats, multiple interpretations of business rules, unauthorized tool access, or, while the system could continue inference, doing so would significantly increase the risk of result bias. In traditional ReAct mechanisms, these situations often lead the model to directly guess the missing information or repeatedly attempt to solve incomplete conditions, resulting in results that deviate from the user's true intent. To address these issues, this solution introduces a human-machine supplementation mechanism into the PReAct node-level thinking and execution mechanism. This allows nodes to proactively pause execution when they detect insufficient key information, initiate a structured supplementation request to the user, and resume execution from the original breakpoint after the user completes the supplementation.

[0067] This mechanism is essentially a branch capability within the PReAct node execution process. Specifically, when a node enters the Reason phase, the system determines whether the current node has all the necessary execution conditions; when the node enters the Check phase, the system determines whether the current output still requires user or business confirmation. If either phase detects missing information, unclear conditions, or high-risk assumptions that cannot be resolved by the system itself, the current node will not continue blindly but will trigger a human-machine supplementation process. In other words, human-machine supplementation is not an additional layer of human dialogue outside the task, but a conditional branch embedded in the node execution mechanism, used to establish a recoverable connection between automated execution and human confirmation.

[0068] In its implementation, this solution utilizes a dedicated system questioning tool to initiate supplementary requests to the user. This tool receives structured question content and a list of options, and after initiating the question, interrupts the current graph execution flow, waiting for a response from the external user before resuming execution. Unlike ordinary natural language follow-up questions, this approach allows the system to clearly distinguish between "normal task messages" and "interruption messages awaiting user supplementation," treating the user's supplementary action as one of the triggering conditions for task node recovery. In other words, the system does not allow the model to freely and continuously ask follow-up questions; instead, it incorporates the questioning behavior itself into the task execution control chain, ensuring that each question corresponds to a clear suspension and a clear resumption.

[0069] To reduce user burden and improve the effectiveness of supplementary information, the question generation in this solution follows the principle of "minimum necessary supplementation." That is, when a node lacks information, the system prioritizes asking only the one critical question necessary to continue execution, rather than throwing out too many open-ended questions at once; when candidate solutions can be enumerated, the system prioritizes providing a limited number of options, guiding the user to complete confirmation with lower cognitive cost; when different options affect subsequent execution paths, the system can briefly explain the differences in the question, but avoids lengthy explanations unrelated to the current node. The aim is to make the human-computer supplementation mechanism more like a "confirmation action in execution control," rather than degenerating into an endless, casual conversation.

[0070] For example, when a node's objective is to "generate a contract summary" but the contract type is not specified, the system will not directly assume a contract category, nor will it require the user to re-describe the complete task. Instead, it will only issue a structured question such as "We need to confirm the contract type so that we can extract key information according to the correct template," and provide options such as "employment contract," "purchase contract," and "service contract." Similarly, when a node discovers insufficient permissions before executing a command or accessing external resources, the system can initiate supplementary requests such as "Allow access to this directory?" or "Allow the use of this tool?" Furthermore, when a node has already generated results but finds that the output format may have multiple possible directions, the system can also request the user to confirm the final output preference during the Check phase, instead of directly outputting an uncertain result.

[0071] For ease of explanation, the triggering conditions for human-machine supplementation can be summarized as shown in Table 3: Table 3 When a node triggers human-machine supplementation, the system updates the node's status to "Pending Supplementation" or "Paused," while recording the current node's objective, completed steps, missing information items, and paused position. This way, the supplementation request does not disrupt the current task context, and the system does not lose previously completed analysis processes due to the question. Once the user's response arrives, it is written back to the current node's input or confirmation field and serves as part of the recovery condition, triggering the node to re-enter the executable state. At this point, the node does not need to re-analyze the entire task from scratch; instead, it directly loads the previously saved state record and continues execution from the supplementation point. Through this mechanism, human-machine supplementation seamlessly integrates with the aforementioned node state persistence and breakpoint recovery mechanisms.

[0072] In some scenarios, a user's supplementary response may not only provide the information needed to continue execution, but may also indicate that the task should be terminated. For example, when the system initiates a supplementary request, if the user replies with "no need," "cancel," or "no need to continue," the system can recognize this type of response as an end signal and terminate the current task chain accordingly, without scheduling subsequent nodes. This design ensures that the human-machine supplementation mechanism not only serves the purpose of "collecting missing information" but also allows the user to decide whether to continue at critical forks in the chain, thereby improving the controllability of complex task execution.

[0073] Compared to the free-flowing questioning of traditional conversational agents, the human-machine supplementation mechanism in this solution has three distinct characteristics. First, it is triggered on a node-by-node basis, only initiating a question when a specific node lacks the necessary conditions, preventing it from spreading indefinitely across the entire task. Second, it primarily uses structured questions and optional options, reducing invalid question-and-answer exchanges and multi-turn ambiguity. Third, it is directly linked to the task execution state; asking a question triggers execution suspension, and answering triggers node resumption, thus the supplementation behavior inherently possesses the characteristics of being traceable, auditable, and recoverable.

[0074] Therefore, the human-machine supplementation mechanism is not simply a manual fallback for the automated agent, but rather an embedded human-machine collaborative execution control method. It enables the system to maintain its automated execution capabilities while promptly introducing user confirmation at uncertain, high-risk, or information-scarce nodes, preventing the model from making baseless assumptions or executing incorrectly. Furthermore, it maintains the continuity and stability of the overall task execution chain through a closed-loop process of suspension, supplementation, and resumption. Figure 5 As shown.

[0075] In step four, the methods for selecting simultaneous, staggered, or limited concurrent execution of independent nodes without dependencies based on permission and resource constraints include: S41, If ​​multiple nodes in the current round of the PReAct execution queue are all executable and have no direct or indirect dependencies, and there are no permission or resource conflicts during the execution process, then the nodes in the current round are marked as concurrent execution nodes. S42: Select nodes with no conflicting permissions and resources among the concurrent execution nodes to form a concurrent execution set, and execute them concurrently; stagger or limit the concurrent execution of the remaining nodes according to the constraint of permission and resource conflict; update the current state and return to S41 to reschedule the next round.

[0076] In S42, after updating the current state, the step of marking the node state is also included; If the marked node is not executable, pause the execution of that node and allow other nodes in the same round to continue executing concurrently; If the node at the breakpoint is detected to have become executable, the corresponding node and subsequent nodes in the link are re-added to the current round of PReAct execution queue.

[0077] In complex agent tasks, different subtasks are often not strictly sequential. Some subtasks must wait for the preceding node to complete before they can execute, while others have no direct dependencies and can proceed simultaneously. If the system still uses a traditional linear execution method, even if several nodes are independent of each other, they can only be processed sequentially, leading to increased overall time consumption. Furthermore, a blockage in a local node can easily slow down the entire task progress. To address this, this solution sets up a dynamic concurrent scheduling mechanism based on the DAG Blueprint. This mechanism identifies currently executable nodes in real time based on node dependencies, node status, tool availability, and permission conditions, and assigns multiple independent nodes to different PReAct execution units for parallel processing, thereby improving the overall execution efficiency of complex tasks.

[0078] The core of this mechanism is not simply "executing multiple tasks simultaneously," but rather determining which nodes are suitable for concurrency and which must be executed sequentially. In other words, concurrency is not predetermined but dynamically determined by the system during execution based on the task blueprint and runtime status. For any given node, it is only added to the current executable queue when all its preceding dependent nodes have completed, and the node itself meets the required tools, resources, and permissions. Furthermore, if multiple nodes do not have direct or indirect dependencies and their execution does not generate resource or permission conflicts, these nodes can be considered as nodes executing concurrently in the same round.

[0079] To describe this scheduling logic, the current set of executable nodes can be simplified as follows: ; Within this set, the scheduler further filters nodes that have no dependencies or conflicts and whose resource conditions permit, forming a concurrent execution set, which is then distributed to multiple PReAct execution units. In other words, the scheduler does not send out all nodes at once, but rather recalculates the next round of executable queues based on the latest state after each round of node execution. This allows the scheduling process to continuously change as the task progresses, providing dynamic adjustment capabilities.

[0080] For example, in the task of "generating an analysis report," the system might break the task down into multiple nodes such as "reading document A," "reading document B," "querying database C," "retrieving historical data D," "summarizing analysis results," and "generating the final report." Among these, "reading document A," "reading document B," "querying database C," and "retrieving historical data D" have no direct dependencies and can therefore be executed simultaneously in the same round. The "summarizing analysis results" node, however, must wait for all the aforementioned nodes to complete before it can start. "Generating the final report" depends on the output of the "summarizing analysis results." This scheduling method significantly reduces overall waiting time compared to serial execution and is more in line with the "parallel collection followed by centralized processing" workflow in complex real-world tasks.

[0081] To keep concurrent execution under control, the scheduler in this solution also considers node permissions and resource conditions. That is, even if two nodes are independent in terms of dependency, if they need to access the same restricted resource, share the same high-risk execution environment, or simultaneously call the same restricted interface, potentially causing conflicts, the system can choose to stagger their execution or limit concurrency. For example, if two nodes simultaneously modify the same file, write to the same database record, or simultaneously call an external interface with frequency restrictions, the scheduler can allocate them to different rounds based on resource policies to avoid result overwriting, inconsistent states, or external call failures. Therefore, the "dynamic concurrency" in this solution is not unconstrained concurrency, but rather controlled concurrency under the constraints of dependencies, permissions, and resources.

[0082] During each round of scheduling, the scheduler typically refers to the following types of information, as shown in Table 4: Table 4 In actual operation, the dynamic concurrent scheduling mechanism does not generate the complete execution order all at once, but rather uses a cyclical approach of "execute one round, update the state, and reschedule the next round." Whenever a node completes, fails, pauses, or enters a pending state, the state synchronization gateway writes the latest result back to the DAG Blueprint. The scheduler then re-examines the entire task graph to identify whether any new nodes have become executable due to satisfied dependencies, or whether any previously pending, paused, or failed nodes have become ready to recover. In this way, the task execution order is continuously adjusted based on the node results, rather than being fixed in the initial plan.

[0083] This scheduling approach differs significantly from the traditional ReAct mechanism. Traditional ReAct typically determines the next action step-by-step based on the current context, resulting in an execution chain that resembles a single-threaded progression, making it difficult to naturally support multiple independent subtasks running simultaneously. In contrast to the traditional Planning mechanism, this approach does not simply execute according to a pre-generated list of steps; instead, it dynamically adjusts the execution rhythm based on the actual runtime state while preserving the global planning structure. Therefore, this approach avoids both the low efficiency of linear execution and the inability of static plans to adapt to abnormal changes.

[0084] Furthermore, the dynamic concurrent scheduling mechanism works in conjunction with the aforementioned node state persistence and breakpoint recovery mechanisms. When a concurrent node fails, the system does not need to roll back the entire round of concurrent tasks; instead, it only marks the failed node as failed or paused, allowing other nodes in the same round to continue. During subsequent recovery, the system only needs to reschedule the failed node and its affected successor nodes, without re-executing already completed concurrent nodes. This significantly reduces the impact of local anomalies on the overall task, improving the agent's robustness in complex scenarios. Figure 6 As shown.

[0085] In step five, the multi-layer compression is changed to four-layer compression, and the compression methods include: The first layer of compression writes the complete content of tool call results that exceed the length threshold to external storage, while the dialog list only retains preview messages. For example, the simplified information for "[Tool output has been compressed]" is as follows: The original message is a fixed-length truncation, and the complete message is stored at "external storage address", with an original length of 2000 characters.

[0086] The second layer of compression replaces tool messages that have exceeded the timeliness threshold with expired placeholder messages and cleans them up periodically. The third layer of compression removes failed tool call interactions from the query window, and the dialog list retains only the necessary failure conclusions. The fourth layer of compression folds the entire historical messages that meet the historical threshold into a boundary summary using LLM.

[0087] In complex agent tasks, execution history typically includes not only user dialogues but also a large amount of tool call results, code execution output, search content, intermediate analysis conclusions, and failure logs. Continuously appending all of this historical information to the context in its raw form would cause the context window to expand rapidly, making it difficult for the model to focus on truly important task objectives, recent execution states, and pending issues during subsequent inference. To address this issue, this solution employs a multi-layered historical memory compression mechanism. Instead of generating a summary all at once after the task ends, this mechanism uses different compression strategies for different types of historical messages during task progression, processing them layer by layer according to triggering conditions. This reduces the historical load entering the model context while preserving as much key execution information as possible.

[0088] The historical compression objects in this scheme mainly include user messages, model messages, tool call messages, and execution result messages related to tool calls. Among these, tool call results are usually the main source of historical inflation. For example, a code search, web scraping, log analysis, or database query may return large chunks of text. If these are directly retained in the context, they will not only occupy a large amount of window space but also dilute the task status information that truly needs to be preserved. Therefore, this scheme first prioritizes tool outputs as the first type of compression object.

[0089] In the first layer of compression, the system checks whether the content returned by the tool exceeds a preset length threshold. When a tool's result is too long, the system no longer directly retains the complete content in the context. Instead, it writes the complete result to an external storage location, such as the sandbox path or temporary file path corresponding to the current node, while only retaining a preview information in the message history. This preview information includes at least a brief summary of the tool's output, the storage location of the complete content, and a description of the original length. After this processing, the model can still know what type of information the tool returned, what the content was roughly, and where to retrieve the complete result if needed during subsequent inference, but it does not need to carry the complete long text again in every round of inference. In other words, this solution does not simply truncate the tool's result, but rather uses a method of "externalizing the complete content and retaining only a preview reference in the context" for compression.

[0090] To further prevent old tool messages from occupying the context for extended periods, this solution also includes a second layer of timeliness compression. The system performs timeliness checks on tool messages with time information. When a tool message exceeds a preset validity period, the system replaces it with an expired placeholder message instead of retaining the original content. This placeholder message indicates that the tool result once existed, but its original detailed content is no longer directly involved in the current round of inference. The purpose of this is to prevent older tool results from continuously entering subsequent contexts, especially in long-chain tasks, where many early tool outputs, while still valuable for auditing, are no longer important for the current node's execution. By introducing timeliness pruning, the system can focus the historical context more on recently valid information, rather than being burdened by a large number of old results.

[0091] Besides excessively long and expired tool results, failed tool calls are another unique source of historical information. Failed tool calls often form a series of consecutive messages, including the instruction message initiating the tool call and the subsequent error return message. If these failure combinations are retained in the context for an extended period, the model may be repeatedly interfered with by invalid failure paths, and may even re-perform inference based on already confirmed failed call methods. To address this, this solution implements a third-layer activation compression mechanism. When the system identifies a tool call result as a failure message—for example, an error status, content containing exceptions, timeouts, not found, or traceback errors—the system can remove the failed tool call combination from the current query window, retaining only the necessary failure conclusions or failure status records, without continuing to retain its complete failure interaction process. Through this processing, the system can reduce the interference of invalid error trajectories on subsequent inference, allowing the model to focus more on recoverable paths and subsequent feasible steps.

[0092] After the aforementioned compression layers, if the overall historical message length is still too long, the system activates the final boundary compression mechanism. This mechanism does not target a specific message but rather folds the entire earlier history. Specifically, the system retains several recent original messages and merges earlier compressible historical messages into a single boundary summary message. This summary message does not need to reiterate all details but summarizes the message types and main content from earlier history in a sequential list, thus significantly reducing the context size while preserving the execution flow. For system messages and other content with global constraints, the system can choose not to participate in folding to ensure that the basic rules remain visible. Through this mechanism, the system can automatically fold "a large amount of distant history" into a summary boundary when the context approaches its limit, while retaining "recent important messages" as is, facilitating the model's continued progress around the current task.

[0093] Therefore, the historical compression in this scheme is not a single digest, but a multi-layered processing flow executed step by step according to message characteristics and triggering conditions. Its compression logic can be summarized as shown in Table 5: Table 5 To facilitate the implementation of the above mechanism, the system can also perform a lightweight estimation of the total historical message volume. For example, it can approximate the context size based on message type, message content length, and message name length, and trigger the corresponding compression layer when the value exceeds a preset threshold. Since the goal of this estimation is mainly to determine "whether compression is needed" rather than to perform precise billing, it can be accomplished using lightweight methods such as character length approximation. This design allows the compression logic to be stably embedded in the actual Agent execution chain without relying on additional complex tokenizers to run.

[0094] Unlike traditional conversational summarization, this solution's multi-layered historical memory compression mechanism is more suitable for agent scenarios focused on tool execution. Instead of simply summarizing all old messages into a single text, it differentiates messages based on their content type, length, timeliness, failure attributes, and relative position. For long tool results that may still require review, this solution preserves traceability through external storage references; for expired old tool messages, it reduces contextual burden through placeholder replacements; for failed call paths that have proven invalid, it reduces interference by removing failure combinations; and for excessively long remote histories, it preserves the overall context through boundary summaries. This approach reduces contextual costs while ensuring the system retains sufficient historical clues and critical state information when resuming execution.

[0095] This invention also provides an LLM-based agent execution system that supports breakpoint recovery and task concurrency, comprising: The task blueprint generation module uses a large language model (LLM) as the planner and an agent as the executor to recursively decompose the received complex tasks into a DAG Blueprint. Each node in the blueprint corresponds to an independently executable local task, and the input-output dependencies between nodes drive the execution order. The PReAct module is used to dispatch the first executable node in the dependency relationship to the PReAct execution queue. The nodes in the queue follow the PReAct node-level thinking and execution mechanism, which sequentially generates a local plan, determines whether the execution conditions are met (Reason), executes the specific action (Act), and verifies the node output result (Check). During the execution process, the current state of each node is updated in real time and the gateway is synchronized to write back the task blueprint, generating a persistent snapshot of the node state. The breakpoint recovery module is used to add the current node to the PReAct execution queue after the execution of the predecessor node in the dependency relationship of the current node that is detected as executable. If the execution of the current node fails, is paused, or is interrupted by a tool call, or is interrupted during the execution process, it reads the persistent node state snapshot and rebuilds the execution queue according to the dependency relationship. After the recovery conditions are met, the current node state is changed to executable and execution is resumed from the breakpoint. The serial concurrent execution module is used to parse the dependencies of the current nodes in the queue in real time. For the current nodes with dependencies, they are executed serially in topological order. For independent nodes without dependencies, they are executed simultaneously, staggered, or with limited concurrent execution based on permission and resource constraints. The compression and aggregation module is used to compress the execution history in multiple layers according to preset rules, retaining key results and recovery clues; after all nodes have been executed, the output results of each node are aggregated to obtain the final result.

[0096] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0097] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An agent execution method based on LLM that supports breakpoint recovery and task concurrency, characterized in that, include: Step 1: The Large Language Model (LLM) acts as the planner, and the Agent acts as the executor. The received complex task is recursively decomposed into a DAG Blueprint, where each node corresponds to an independently executable local task, and the input-output dependencies between nodes drive the execution order. Step 2: Assign the first node in the dependency relationship that is executable to the PReAct execution queue; the nodes in the queue follow the PReAct node-level thinking execution mechanism, and within the node, they sequentially execute the following: generate a local plan, determine whether the execution conditions (Reason) are met, execute the specific action (Act), and verify the node output result (Check); during the execution process, the current state of each node is updated in real time and the gateway is synchronized to write back the task blueprint, generating a persistent node state snapshot; Step 3: After the predecessor nodes in the dependency relationship of the current node that are in the executable state have been executed, put the current node into the PReAct execution queue. When the execution of the current node is detected to have failed, paused, or the tool call is abnormal or the system is interrupted during the execution process, the persistent node state snapshot is read and the execution queue is rebuilt according to the dependencies. After the recovery conditions are met, the current node state is changed to executable and the execution is resumed from the breakpoint. Step 4: Real-time analysis of the dependencies of the current nodes in the queue. For current nodes with dependencies, execute them sequentially in topological order. For independent nodes without dependencies, select simultaneous, staggered, or limited concurrent execution based on permission and resource constraints. Step 5: Perform multi-layer compression on the execution history according to preset rules to retain key results and recovery clues; After all nodes have completed their execution, the output results of each node are summarized to obtain the final result.

2. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 1, characterized in that, In step one, the DAG Blueprint task blueprint is represented as follows: ; In the formula, B is the DAG Blueprint task blueprint, V represents the set of nodes, E represents the input-output dependencies between nodes, S represents the set of node states, M represents the historical memory summary corresponding to the node, and R represents the node recovery information.

3. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 2, characterized in that, In step one, each node is represented as follows: ; In the formula, For the current node, `goal_i` represents the goal of the current node, indicating that the current node corresponds to an independently executable local task. `input_i` represents the input required for the execution of the current node. `output_i` represents the output result after the execution of the current node. `dep_i` represents the previous node in the dependency relationship. `tool_i` represents the tools that can be called. `perm_i` represents the permission scope. `mem_i` represents the memory digest of the current node. `rec_i` represents the reason for failure and the recovery point. `state_i` represents the state of the current node, including: pending execution, executable, running, pending supplementation, paused, failed execution, and completed. "Pending execution" indicates that the predecessor nodes in the dependency relationship of the current node have not been completed. An executable node indicates that after the preceding nodes in the preceding dependencies have completed execution and the current node meets the execution conditions, the current node can be dispatched by the scheduler. Running indicates that the current node is executing the PReAct node-level thinking execution mechanism; The missing information indicates that the current node is missing information during execution. "Paused" indicates that the current node is temporarily suspended due to permission restrictions, manual intervention, or system policies. Execution failure indicates that an exception occurred during the current node's tool invocation, result verification, or external access. "Completed" indicates that the output of the current node has passed verification and can be used by subsequent nodes.

4. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 3, characterized in that, In step two, the persistent node state snapshot generated for a single node is represented as follows: ; In the formula, This represents a persistent snapshot of the node's state. state_i represents the current state of the node, input_i represents the input used by the node during execution, output_i represents the output or intermediate results generated by the node, log_i represents the execution log and tool call records, failure_i represents the reason for failure, checkpoint_i represents the recovery point information, and time_i represents the timestamp information.

5. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 4, characterized in that, In step two, when each node in the queue follows the PReAct node-level thinking execution mechanism, if the node output result fails the verification, Check returns the Reason based on the failure reason, re-executes Act, or suspends the node; The execution conditions in Reason include the files, tools, network, resources, priority, and interface permissions required for a node to execute a task.

6. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 5, characterized in that, In step three, the recovery conditions that must be met include: For nodes that have already been completed, their output can be reused directly. For the node to be added, determine whether the addition conditions have been met; For failed nodes, decide whether to retry, replace tools, adjust permissions, or request manual intervention based on the reason for the failure. For nodes that can continue execution, they are re-entered into the PReAct execution queue.

7. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 6, characterized in that, In step three, when the breakpoint status is identified as needing to be supplemented during execution, the execution of the current node is paused, the node is suspended, the node record and breakpoint position are saved, and the human-machine supplementation mechanism is triggered to send a structured question or optional supplementation request to the user. Upon receiving confirmation and supplementary information from the user, read the saved node record, write the confirmation and supplementary information into the corresponding input field, change the current node status to executable, and resume execution at the saved breakpoint. Upon receiving a negative supplementary message from the user, the current task link is terminated, and subsequent nodes on that link are no longer scheduled.

8. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 7, characterized in that, In step three, the breakpoint status during execution is identified as a trigger scenario to be supplemented as follows: Input is missing, including missing files, parameters, accounts, paths, or business fields; The constraints are unclear, including the output format, task boundaries, or priorities not being clearly defined; High-risk assumptions include those where the system is inferable but the cost of inference errors exceeds a threshold. Permissions are not confirmed, including the need to access restricted files, commands, interfaces, or external systems; The results are pending confirmation, including those that have already been generated, but a final solution still needs to be selected.

9. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 8, characterized in that, In step four, the methods for selecting simultaneous, staggered, or limited concurrent execution of independent nodes without dependencies based on permission and resource constraints include: S41, If ​​multiple nodes in the current round of the PReAct execution queue are all executable and have no direct or indirect dependencies, and there are no permission or resource conflicts during the execution process, then the nodes in the current round are marked as concurrent execution nodes. S42: Select nodes with no conflicting permissions and resources among the concurrent execution nodes to form a concurrent execution set, and execute them concurrently; stagger or limit the concurrent execution of the remaining nodes according to the constraint of permission and resource conflict; update the current state and return to S41 to reschedule the next round.

10. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 9, characterized in that, In S42, after updating the current state, the step of marking the node state is also included; If the marked node is not executable, pause the execution of that node and allow other nodes in the same round to continue executing concurrently; If the node at the breakpoint is detected to have become executable, the corresponding node and subsequent nodes in the link are re-added to the current round of PReAct execution queue.

11. The LLM-based agent execution method supporting breakpoint recovery and task concurrency as described in claim 10, characterized in that, In step five, the multi-layer compression is changed to four-layer compression, and the compression methods include: The first layer of compression writes the complete content of tool call results that exceed the length threshold to external storage, while the dialog list only retains preview messages. The second layer of compression replaces tool messages that have exceeded the timeliness threshold with expired placeholder messages and cleans them up periodically. The third layer of compression removes failed tool call interactions from the query window, and the dialog list retains only the necessary failure conclusions. The fourth layer of compression folds the entire historical messages that meet the historical threshold into a boundary summary using LLM.

12. An agent execution system based on LLM that supports breakpoint recovery and task concurrency, characterized in that, include: The task blueprint generation module uses a large language model (LLM) as the planner and an agent as the executor to recursively decompose the received complex tasks into a DAG Blueprint. Each node in the blueprint corresponds to an independently executable local task, and the input-output dependencies between nodes drive the execution order. The PReAct module is used to dispatch the first executable node in the dependency relationship to the PReAct execution queue. The nodes in the queue follow the PReAct node-level thinking and execution mechanism, which sequentially generates a local plan, determines whether the execution conditions are met (Reason), executes the specific action (Act), and verifies the node output result (Check). During the execution process, the current state of each node is updated in real time and the gateway is synchronized to write back the task blueprint, generating a persistent snapshot of the node state. The breakpoint recovery module is used to add the current node to the PReAct execution queue after the predecessor node in the dependency relationship of the current node, which is detected as executable, has been executed. When the execution of the current node is detected to have failed, paused, or the tool call is abnormal or the system is interrupted during the execution process, the persistent node state snapshot is read and the execution queue is rebuilt according to the dependencies. After the recovery conditions are met, the current node state is changed to executable and the execution is resumed from the breakpoint. The serial concurrent execution module is used to parse the dependencies of the current nodes in the queue in real time. For the current nodes with dependencies, they are executed serially in topological order. For independent nodes without dependencies, they are executed simultaneously, staggered, or with limited concurrent execution based on permission and resource constraints. The compression and aggregation module is used to compress the execution history in multiple layers according to preset rules, preserving key results and recovery clues; After all nodes have completed their execution, the output results of each node are summarized to obtain the final result.