A method and apparatus for executing complex sequence tasks driven by a large language model.

By introducing a long-range context management module and a real-time feedback mechanism, the problem of limited context windows in LLM for complex sequence tasks is solved, achieving deep collaboration between large language models and execution structures, and ensuring the reliability and intelligence of tasks.

CN120494115BActive Publication Date: 2026-03-06BEIJING CHAITIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510978858.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2026-03-06
Estimated Expiration
2045-07-16

AI Technical Summary

Technical Problem

Large language models (LLMs) suffer from problems such as limited context windows, difficulty in maintaining long-range dependencies, generation of outputs that do not conform to facts or logic, lack of deep feedback interaction, and fixed control logic when dealing with complex sequence tasks, resulting in insufficient reliability and controllability of task execution.

Method used

By introducing a long-term context management module, execution feedback information is collected in real time, and the context information of the cross-language model interaction window is updated and queried. This allows for the optimization and adjustment of structured task descriptions, forming a closed-loop execution-monitoring-feedback-adjustment process, and achieving deep collaboration between LLM and execution structure.

Benefits of technology

It achieves end-to-end, reliable, intelligent, and controllable execution of large language models in complex sequence tasks, overcomes the context window limitation, and utilizes task history information and domain knowledge spanning multiple execution steps to ensure the reliability and intelligence of the task.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120494115B_ABST
    Figure CN120494115B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for executing complex sequence tasks driven by a large language model, relating to the field of large-scale artificial intelligence models. The method includes: a task planning step to output a structured task description; a task execution step to drive the execution of the structured task object and collect execution feedback information in real time; a long-range context update and acquisition step to update key information from the acquired execution feedback information to a long-range context management module and acquire context information across the large language model interaction window; a task planning adjustment step to modify the structured task description or generate a completely new structured task description; and repeated execution of the above task execution step, long-range context update and acquisition step, and task planning adjustment step until the complex sequence task is completed or a preset termination condition is met. This invention can reliably, intelligently, and controllably complete highly complex and dynamic sequence tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large-scale artificial intelligence models, and in particular to a method and apparatus for executing complex sequence tasks driven by a large language model. Background Technology

[0002] Currently, there are two main technical solutions for using large language models (LLMs) to handle complex sequence tasks:

[0003] (1) Scheme for directly generating task steps or simple workflows based on LLM

[0004] This approach either directly relies on the LLM to output a series of task steps for subsequent execution, or embeds the LLM into a predefined, relatively simple linear or branching workflow as one of its processing nodes. However, this technical approach has significant drawbacks: First, the context window of an LLM is limited. For complex sequential tasks requiring long-range dependencies (i.e., the current decision depends on the state or result of an earlier step), the LLM struggles to maintain a comprehensive and consistent understanding of the entire task history, leading to short-sighted planning, logical breaks, or the forgetting of crucial information. Second, when generating long-sequence plans or decisions, the LLM may still produce output "illusions" that do not conform to reality or logic, and the certainty and repeatability of its output are sometimes difficult to guarantee, directly affecting the reliability of task execution. Third, traditional workflows struggle to effectively describe and manage complex tasks involving numerous dynamic conditions, concurrent operations, complex dependencies, flexible backtracking, and the need for fine-grained strategy adjustments based on real-time feedback. Fourth, the interaction between the LLM and the execution mechanism is typically unidirectional or shallow (e.g., the LLM outputs text, the executor executes), lacking deep, multi-dimensional feedback based on the execution process to guide the LLM in intelligent, global, and even forward-looking adjustments and optimizations. The execution process is often an "open loop" or a weak "closed loop". Fifth, the control logic for task execution is relatively fixed and difficult to dynamically reshape based on a deep understanding of LLM; at the same time, the internal decision-making process of LLM is black box, making it difficult to explain and audit the execution path and decision basis of the entire complex task.

[0005] (2) Schemes for LLM to generate specific structures or modify existing structures.

[0006] LLM (Language Modeling) is used to generate behavior trees based on input instructions and scene information. However, current technical solutions focus on the initial generation of behavior trees. They fail to provide mature solutions for the continuous evolution of behavior trees in complex and dynamic environments, deep bidirectional intelligent collaboration with LLM, and how to combine external mechanisms to overcome the limitations of LLM itself (such as context length) to guide the entire lifecycle of long-sequence tasks. They remain at the level of generating a relatively static structure. Some technical solutions can dynamically adjust behavior trees. However, such adjustments rely more on pre-set rules within the behavior tree or local adjustment logic based on simple sensor feedback, lacking the advanced cognitive intelligence and global planning capabilities at the level of large language models to guide such adjustments.

[0007] Even combining the two existing technologies mentioned above cannot solve the core challenges faced by LLMs in driving truly long, highly dynamic tasks that require complex reasoning and multi-source information fusion. For example, LLMs cannot fully utilize task history information across their own context windows when adjusting behavior trees, and it is difficult to achieve efficient, intelligent, and multi-dimensional information interaction protocols between LLMs and execution structures to support complex collaborative decision-making.

[0008] Therefore, how to enable large language models (LLMs) to effectively overcome their limitations in context understanding and long-range dependency handling, and to deeply collaborate with a structured execution mechanism to reliably, intelligently, and controllably complete highly complex and dynamic sequence tasks, has become an urgent technical problem to be solved. Summary of the Invention

[0009] In view of the above-mentioned defects or deficiencies in the prior art, the present invention provides a method and apparatus for executing complex sequence tasks driven by a large language model, which can effectively solve the technical problems mentioned in the background art.

[0010] One aspect of the present invention provides a method for executing complex sequence tasks driven by a large language model, for use in a large language model server, comprising the following steps:

[0011] Task planning steps: Semantic parsing of the input complex sequence task instructions, querying the long-range context management module to obtain background knowledge related to the complex sequence task, and outputting a structured task description based on the semantic understanding of the complex sequence task and the obtained background knowledge.

[0012] Task execution steps: Instantiate the structured task description into an executable structured task object, drive the execution of the structured task object, and collect the execution feedback information generated by the structured task object in real time during this execution process;

[0013] Steps for updating and obtaining long-range context: Update the key information in the obtained execution feedback information to the long-range context management module, and query the long-range context management module according to the execution feedback information to obtain the context information of the cross-language model interaction window;

[0014] Task planning adjustment steps: Based on the execution feedback information, the context information of the cross-language model interaction window, and the prediction results, determine whether the structured task description needs to be optimized and adjusted. If so, modify the structured task description or generate a completely new structured task description, and substitute the modified structured task description or the completely new structured task description back into the task execution steps.

[0015] Repeat the above task execution steps, long-term context update and acquisition steps, and task planning adjustment steps until the complex sequence task is completed or the preset termination condition is met.

[0016] In another aspect, the present invention provides an execution apparatus for complex sequence tasks driven by a large language model, for a large language model server, comprising:

[0017] The task planning module is used to perform semantic parsing on the input complex sequence task instructions, query the long-range context management module to obtain background knowledge related to the complex sequence task, and output a structured task description based on the semantic understanding of the complex sequence task and the obtained background knowledge.

[0018] The task execution module is used to instantiate the structured task description into an executable structured task object, drive the execution of the structured task object, and collect the execution feedback information generated by the structured task object in real time during the current execution process.

[0019] The long-range context update and acquisition module is used to update the key information in the acquired execution feedback information to the long-range context management module, and query the long-range context management module according to the execution feedback information to obtain the context information of the cross-language model interaction window;

[0020] The task planning and adjustment module is used to determine whether the structured task description needs to be optimized and adjusted based on the execution feedback information, the context information of the cross-language model interaction window, and the prediction results. If so, the structured task description is modified or a completely new structured task description is generated, and the modified or completely new structured task description is substituted back into the task execution module.

[0021] The repetitive execution module is used to repeatedly drive the execution of the above-mentioned task execution module, long-term context update and acquisition module, and task planning and adjustment module until the complex sequence task is completed or the preset termination condition is reached.

[0022] This invention provides a method and apparatus for executing complex sequence tasks driven by a large language model. It enables a large language model to perform an end-to-end, structured, and monitorable execution process of complex sequence tasks. It also provides a long-range context management mechanism, which allows the large language model to effectively overcome the limitations of its own context window, acquire and utilize task history information and domain knowledge spanning multiple execution steps, and use this information to guide the generation and dynamic adjustment of structured task representations. This enables the large language model to reliably, intelligently, and controllably complete highly complex and dynamic sequence tasks. Attached Figure Description

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

[0024] Figure 1 This is a flowchart illustrating the execution method of a complex sequence task driven by a large language model, provided in one embodiment of this application.

[0025] Figure 2 This is a schematic diagram of the structure of an execution device for a complex sequence task driven by a large language model, provided in one embodiment of this application.

[0026] Figure 3 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

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

[0028] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention are also intended to include the plural forms unless the context clearly indicates otherwise.

[0029] It should be understood that although the terms first, second, third, etc., may be used to describe the acquisition modules in the embodiments of the present invention, these acquisition modules should not be limited to these terms. These terms are only used to distinguish the acquisition modules from each other.

[0030] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0031] It should be noted that the directional terms such as "upper," "lower," "left," and "right" used in the embodiments of the present invention are used to describe the angles shown in the accompanying drawings and should not be construed as limiting the embodiments of the present invention. Furthermore, in the context, it should be understood that when it is mentioned that an element is formed "upper" or "lower" of another element, it can not only be formed directly "upper" or "lower" of the other element, but also indirectly "upper" or "lower" of the other element through an intermediate element.

[0032] See Figure 1 One embodiment of this application provides a method for executing complex sequence tasks driven by a large language model, comprising the following steps:

[0033] Step S101: Semantic parsing is performed on the input complex sequence task instruction, and the long-range context management module is queried to obtain background knowledge related to the complex sequence task. Based on the semantic understanding of the complex sequence task and the obtained background knowledge, a structured task description is output.

[0034] Specifically, users input complex sequence task instructions through the task input interface, such as: a natural language description of "harden application X and deploy it to the production environment," or in AI-assisted programming, "refactor module Y to improve its performance and fix known bug Z." The LLM cognition and planning core performs deep semantic parsing on the input complex sequence task instructions to identify task objectives, main stages, implicit constraints, potential dependencies, and initially queries the long-range context management module to obtain historical experience or domain knowledge related to this task. Based on the task understanding and the acquired historical experience or domain knowledge (a case of context information in a broad sense), the LLM cognition and planning core plans the initial execution strategy and control flow, and outputs a structured description of the structured task representation (TES), which in this embodiment is called a "structured task description or TES description," for example, describing the node types, hierarchical relationships, connection relationships, and initial parameters of key nodes in a behavior tree. If the structured task representation (TES) adopts a behavior tree, LLM will plan a behavior tree structure containing sequence nodes, selection nodes, parallel nodes, decorator nodes, behavior nodes, and condition nodes to handle the complex logic of the task.

[0035] Step S102: Instantiate the structured task description into an executable structured task object, drive the execution of the structured task object, and collect the execution feedback information generated by the structured task object in real time during this execution.

[0036] Specifically, the Structured Execution and Control (SEC) module instantiates an executable TES object, such as a behavior tree instance, based on the TES description output by the LLM. The execution engine within the SEC module then drives TES execution, interacting with the external environment or system through the underlying action interface. During TES execution, the execution feedback and monitoring module, embedded in the dynamic coordination interface, collects real-time data on the execution status (success, failure, running, etc.), performance metrics (time consumption, resource usage, etc.), quality assessment results of intermediate products, and any significant events or error information from the underlying interface. This execution feedback information is organized into structured, multi-dimensional data packets.

[0037] Step S103: Update the key information in the obtained execution feedback information to the long-range context management module, and query the long-range context management module according to the execution feedback information to obtain the context information of the cross-language model interaction window.

[0038] Specifically, structured execution feedback information is continuously or periodically provided to the LLM cognition and planning core through a dynamic collaboration interface. Key execution history and status information within the feedback is sent to the long-range context management module for recording and indexing. The LLM cognition and planning core analyzes the received execution feedback information, performs semantic similarity retrieval in the vector database based on this information, performs relational reasoning using a knowledge graph, and obtains contextual information for the cross-language model interaction window through indexing information, thereby overcoming the limitation of relying solely on information from the current interaction window. This cross-language model interaction window contextual information includes one or more of the following: complete task execution history, intermediate data generated during task execution, task-related background knowledge, user preferences, and task constraints. The execution feedback information includes one or more of the following: the current execution history, the current execution status, the current system resource consumption, the current execution time, and quality assessment indicators of the intermediate data generated during the current task execution.

[0039] Step S104: Based on the execution feedback information, the context information of the cross-language model interaction window, and the prediction results, determine whether the structured task description needs to be optimized and adjusted. If so, modify the structured task description or generate a completely new structured task description, and substitute the modified structured task description or the completely new structured task description back into step S102.

[0040] Specifically, the LLM integrates execution feedback information, contextual information from the cross-language model interaction window, and prediction results to perform deep reasoning and intelligent decision-making. It determines whether and how to adjust or optimize the TES (Task Execution System). Decision objectives include improving success rate, increasing efficiency, reducing risk, and meeting dynamically emerging constraints. If the LLM decision requires adjustment, it generates modification instructions for the TES, such as modifying nodes, parameters, connections, or replacing the entire subtree of the behavior tree. These instructions are sent to the structured execution and control module via a dynamic collaboration interface, which updates the TES in real time based on the instructions. In extreme cases, such as when the original plan proves completely infeasible, the LLM can perform a global replanning, generating a completely new TES description. The modified or entirely new structured task description is then reintroduced into step S102 for execution in subsequent steps.

[0041] Repeat steps S102-S104 to form a continuous closed loop of "execution-monitoring-feedback-analysis-decision-adjustment" until TES indicates successful task completion. If the goal cannot be achieved after multiple attempts and optimizations, the task will terminate when preset termination conditions are met, such as the maximum number of attempts or the total time limit. A detailed execution summary and failure reason analysis will be output through LLM.

[0042] This embodiment achieves intelligent lifecycle management of complex sequence tasks—from planning, execution, and monitoring to dynamic optimization—through deep bidirectional interaction and collaboration between LLM and Structured Task Representation (TES, preferably behavior tree). This effectively overcomes the inherent shortcomings of LLM in handling long-range dependencies, context window limitations, and robust execution. Furthermore, by introducing an external long-range context management module to persist and retrieve task history and domain knowledge across LLM interaction windows, and establishing a multi-dimensional structured feedback mechanism, highly complex and dynamic sequence tasks can be reliably, intelligently, and controllably completed.

[0043] In another embodiment, the entire process of applying the above method to automated network security incident response (taking an APT attack scenario as an example) is described in detail.

[0044] The system detected early signs of a suspected advanced persistent threat (APT) attack involving multiple phases and assets, requiring a complex and dynamic response.

[0045] Specific system implementation:

[0046] (1) Task input and understanding of LLM

[0047] Initial alerts, such as suspicious process behaviors detected by EEDR and malicious IOCs matched by the threat intelligence platform, are input into the system. LLM's core cognitive and planning function analyzes the alerts, querying the Long-Term Context Management module for TTPs (Tactics, Techniques, and Processes) related to this type of APT organization, historical records of similar incidents, and the current importance classification of enterprise assets and business impact assessment standards. LLM understands that the mission objectives are: in-depth analysis, confirmation of threat level, containment of lateral movement, elimination of malicious presence, tracing of attack paths, patching of vulnerabilities, and prevention of recurrence.

[0048] (2) Initial TES (Behavior Tree) Planning

[0049] Based on the above information, LLM plans a multi-stage, highly structured event response mechanism (TES), which is implemented in the form of a behavior tree in this embodiment. The root node of this behavior tree can be a sequential node, containing subtrees for major stages such as "preliminary assessment and information enrichment," "in-depth analysis and threat confirmation," "containment and isolation," "cleanup and recovery," and "source tracing and hardening." Each subtree contains more detailed selection nodes (for trying different analysis methods or containment strategies), parallel nodes (for concurrently executing certain investigative actions), and behavior nodes that call specific security tool APIs. LLM sets initial parameters for the nodes, such as query statements, IP lists, isolation levels, etc.

[0050] (3) TES Execution and Multidimensional Feedback

[0051] Behavior tree execution begins. During the "Deep Analysis" phase, after a behavior node is executed, its multi-dimensional feedback includes not only success / failure, but also detailed JSON data from the sandbox report (containing file behavior, network connectivity, extracted IOCs), analysis time, and a malicious rating given by the sandbox. A condition node determines whether an affected asset is critical by querying the Configuration Management Database (CMDB) (via an underlying interface, the results of which may also be interpreted and fed back by the LLM).

[0052] (4) LLM intelligent analysis and TES dynamic adjustment:

[0053] Scenario A (Containment Strategy Optimization): When the behavior tree reaches the "Containment and Isolation" phase, preparing to perform network isolation on a host, the LLM receives feedback: this host is a critical business server, and isolation will lead to significant business interruption. This judgment may come from a combination of CMDB information and pre-stored business impact rules in the long-range context management module. The execution effect prediction engine predicts that the loss from complete isolation will be enormous based on historical data. After analysis, the LLM dynamically modifies the behavior tree; instead of executing the complete isolation behavior node, it replaces it with a new sequential subtree containing actions such as "applying more granular access control policies (e.g., blocking only specific ports or protocols)," "initiating enhanced real-time monitoring of the host," and "immediately notifying the security manager for manual intervention." The LLM also updates the long-range context module, recording the specific handling strategy for this critical asset.

[0054] Scenario B (New TTP Response): During the "Attribution and Hardening" phase, if all known cleanup methods are successfully implemented, but monitoring feedback still shows slight anomalous activity, the LLM receives this "inconsistent" multidimensional feedback (i.e., successful cleanup vs. persistent anomalous activity). The LLM queries the Long Context Management module for the latest threat intelligence and zero-day vulnerability information, and combines this with all IOCs and host behavior data collected in the current incident for comprehensive reasoning. The LLM determines that this is an undocumented TTP. It dynamically generates a new behavior tree segment containing more advanced threat hunting actions and instructs that it be inserted into the attribution section of the current behavior tree, or as a parallel investigation branch.

[0055] (5) Task completed

[0056] Once the threat is effectively controlled and eliminated, the system recovers, and the LLM automatically generates and submits a complete event analysis report based on the execution process and long-term context logs.

[0057] See Figure 2Another embodiment of the present invention provides an execution device 200 for complex sequence tasks driven by a large language model, comprising: a task planning module 201, a task execution module 202, a long-range context update and acquisition module 203, a task planning adjustment module 204, and a repetitive execution module 205. This device 200 is capable of executing the execution method for complex sequence tasks driven by a large language model as described in the method embodiment.

[0058] Specifically, device 200 includes:

[0059] The task planning module 201 is used to perform semantic parsing on the input complex sequence task instructions, query the long-range context management module to obtain background knowledge related to the complex sequence task, and output a structured task description based on the semantic understanding of the complex sequence task and the obtained background knowledge.

[0060] The task execution module 202 is used to instantiate the structured task description into an executable structured task object, drive the execution of the structured task object, and collect the execution feedback information generated by the structured task object in real time during the current execution process.

[0061] The long-range context update and acquisition module 203 is used to update the key information in the acquired execution feedback information to the long-range context management module, and query the long-range context management module according to the execution feedback information to obtain the context information of the cross-language model interaction window;

[0062] The task planning and adjustment module 204 is used to determine whether the structured task description needs to be optimized and adjusted based on the execution feedback information, the context information of the cross-language model interaction window and the prediction results. If so, the structured task description is modified or a new structured task description is generated, and the modified or new structured task description is substituted back into the task execution steps of the task execution module 202.

[0063] The repeated execution module 205 is used to repeatedly drive the execution of the above-mentioned task execution module, long-term context update and acquisition module, and task planning adjustment module until the complex sequence task is completed or the preset termination condition is reached.

[0064] It should be noted that the execution device 200 for complex sequence tasks driven by a large language model provided in this embodiment is similar to the technical solutions that can be used to execute various method embodiments, and its implementation principle and technical effect are similar to the methods, so they will not be repeated here.

[0065] Figure 3This is a schematic diagram of an electronic device 300 provided in another embodiment of the present invention. The electronic device 300 is used to implement the execution method of a complex sequence task driven by a large language model in the method embodiment. The electronic device 300 in the embodiments of the present invention may include, but is not limited to, a PC, laptop computer, smartphone, PDA, tablet computer, etc. Figure 3 The electronic device 300 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0066] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes to implement the methods of the embodiments described herein, based on a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing device 301, ROM 302, and RAM 303 are interconnected via a bus 305. An input / output (I / O) interface 304 is also connected to the bus 305.

[0067] Typically, the following devices can be connected to I / O interface 304: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0068] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention also provide a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts, thereby implementing the execution method for complex sequence tasks driven by a large language model as described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a ROM 302. When the computer program is executed by the processing device 301, it performs the functions defined in the methods of the embodiments of the present invention.

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

Claims

1. A method for executing a complex sequence task driven by a large language model, for a large language model server, characterized in that, Comprising the following steps: Task planning step: semantic parsing of the input complex sequence task instruction, querying the long-range context management module to obtain the background knowledge related to the complex sequence task, outputting the structured description of the behavior tree based on the semantic understanding of the complex sequence task and the obtained background knowledge; Task execution step: instantiating the structured description of the behavior tree into an executable behavior tree, driving the execution of the behavior tree, and collecting the execution feedback information generated by the behavior tree in the current execution process in real time; Long-range context update and acquisition step: sending the execution history information and execution state information in the obtained execution feedback information to the long-range context management module for recording and indexing, and performing semantic similarity retrieval in the vector database according to the execution feedback information, utilizing the knowledge graph for relationship reasoning, and obtaining the context information across the large language model interaction window through the index information; Task planning adjustment step: according to the execution feedback information, the context information across the large language model interaction window and the prediction result, judging whether the structured description of the behavior tree needs to be optimized and adjusted, if so, modifying the structured description of the behavior tree or generating a new structured description of the behavior tree, and inputting the modified structured description of the behavior tree or the new structured description of the behavior tree into the task execution step again; Repeat the above task execution step, long-range context update and acquisition step, and task planning adjustment step until the complex sequence task is completed or the preset termination condition is reached.

2. The method of claim 1, wherein the method further comprises: The context information across the large language model interaction window includes one or more of complete task history execution record, intermediate data generated in the task execution process, task-related background knowledge, user preference, and task constraint condition.

3. The method of claim 1, wherein the method further comprises: The execution feedback information generated by the behavior tree in the current execution process includes one or more of the current execution history, the current execution state, the system resource consumption of the current execution, the current execution time, and the quality evaluation index of the intermediate data generated in the current task execution process.

4. An apparatus for executing a complex sequence task driven by a large language model, for a large language model server, characterized in that, Comprising: a task planning module for semantic parsing of the input complex sequence task instruction, querying the long-range context management module to obtain the background knowledge related to the complex sequence task, outputting the structured description of the behavior tree based on the semantic understanding of the complex sequence task and the obtained background knowledge; a task execution module for instantiating the structured description of the behavior tree into an executable behavior tree, driving the execution of the behavior tree, and collecting the execution feedback information generated by the behavior tree in the current execution process in real time; a long-range context update and acquisition module for sending the execution history information and execution state information in the obtained execution feedback information to the long-range context management module for recording and indexing, and performing semantic similarity retrieval in the vector database according to the execution feedback information, utilizing the knowledge graph for relationship reasoning, and obtaining the context information across the large language model interaction window through the index information; a task planning adjustment module, configured to determine whether the structured description of the behavior tree needs to be optimized and adjusted according to the execution feedback information, the context information across the large language model interaction window, and the prediction result, and if yes, modify the structured description of the behavior tree or generate a new structured description of the behavior tree, and then input the modified structured description of the behavior tree or the new structured description of the behavior tree into the task execution step again; a repeated execution module, configured to repeatedly drive the execution of the task execution module, the long-range context updating and obtaining module, and the task planning adjustment module until the complex sequence task is completed or a preset termination condition is reached.

5. The apparatus of claim 4, wherein the apparatus is configured to: The context information across the large language model interaction window includes one or more of the following: complete task history execution record, intermediate data generated during task execution, background knowledge related to the task, user preference, and task constraint condition.

6. The device of claim 4, wherein the device is configured to: The execution feedback information generated by the behavior tree during the current execution process includes one or more of the following: current execution history, current execution state, system resource consumption during current execution, current execution time, and quality evaluation index of intermediate data generated during current task execution process.

Citation Information

Patent Citations

  • Control method and device for intelligent agent with body and readable storage medium

    CN119416881A

  • Multi-agent cooperative task planning method, system and device and storage medium

    CN119917319A