A knowledge-enhanced agent task orchestration method

By constructing an HTN task knowledge graph and improving the HTN planning model, combined with agent capability profiling, the stability problem of agent task orchestration in complex task scenarios was solved, the accuracy of task decomposition and the controllability of anomaly handling were achieved, and the stability and efficiency of task execution were improved.

CN123114730APending Publication Date: 2026-11-17ANHUI PROVINCIAL CO OF CHINA NAT TOBACCO CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611203413.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing intelligent agent task orchestration methods struggle to reliably express the hierarchical and dependency relationships between tasks in complex task scenarios, leading to inconsistent task decomposition granularity, inaccurate tool matching, parallel task conflicts, inability to backfill execution results, and the need for overall retrying after anomalies. Furthermore, traditional HTN planning models are difficult to dynamically adjust.

Method used

By constructing an HTN task knowledge graph and improving the HTN planning model, and combining it with agent capability profiling technology, we can perform task decomposition, constraint compilation, conflict write-back, and subtree replacement-based local replanning to achieve a clear task decomposition structure, accurate agent matching, controllable anomaly handling, and continuous optimization based on historical feedback.

Benefits of technology

It improves the stability and reliability of complex task orchestration, reduces the scope of replanning, improves the efficiency of anomaly recovery, and ensures the accuracy and consistency of task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114730A_ABST
    Figure CN123114730A_ABST
Patent Text Reader

Abstract

This invention discloses a knowledge-enhanced agent task orchestration method, comprising the following steps: acquiring user task requests, agent tool registration data, domain knowledge data, and historical task execution data; constructing an HTN task knowledge graph and generating HTN task instance descriptions; invoking an improved knowledge-enhanced hierarchical task network (HTN) planning model to perform rule gating, layer-by-layer decomposition, and dependency generation on composite tasks to obtain an HTN task hierarchical network; constructing agent capability profiles and binding atomic task nodes to agents; generating agent task orchestration sequences based on HTN constraints; executing tasks and performing state backfilling, target effect condition verification, and subtree replacement-based local replanning. This invention belongs to the field of artificial intelligence task planning technology, achieving stable orchestration and anomaly recovery for complex agent tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence task planning and intelligent agent task orchestration technology, specifically to an intelligent agent task orchestration method based on knowledge enhancement. Background Technology

[0002] With the development of large language models, agent tool invocation, knowledge graphs, and automated task execution technologies, agent systems are now able to invoke different tools, interfaces, or models to complete complex tasks based on user-input task requests. Existing agent task orchestration methods typically decompose tasks using natural language understanding models and then select the corresponding agent to execute based on tool descriptions or prompt templates, which can achieve multi-tool collaborative invocation to a certain extent. However, in complex task scenarios, user tasks often contain multiple layers of objectives, preconditions, data dependencies, permission constraints, and result verification requirements. Simply relying on text prompts or ordinary task queues is insufficient to reliably express the hierarchical relationships and dependencies between tasks.

[0003] In existing technologies, some methods use knowledge graphs to assist task understanding and enhance the semantic expression of tasks through entity relationships and business rules. However, these methods usually remain at the stage of task information completion or tool retrieval, lacking a hierarchical planning structure oriented towards the task execution process. When a task needs to go through multiple subtasks, multiple agents, and multiple intermediate result transmissions to complete, the system is prone to problems such as inconsistent task decomposition granularity, inaccurate tool matching, parallel task conflicts, inability to backfill execution results, and the need for overall retry after anomalies, resulting in poor task orchestration stability.

[0004] Hierarchical Task Network (HTN) planning models have the ability to decompose complex tasks into sub-tasks and atomic tasks layer by layer, making them suitable for describing the hierarchical structure of complex tasks. However, traditional HTN planning models rely heavily on manually preset decomposition rules, making it difficult to dynamically adjust based on the real-time availability of agent tools, historical execution feedback, and target effect conditions. Furthermore, when tools become unavailable, fields mismatch, preconditions fail, or target effect conditions are not met during execution, traditional methods struggle to perform local subtree replacement-based replanning within the task hierarchy network.

[0005] Therefore, how to provide a knowledge-enhanced agent task orchestration method is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] One objective of this invention is to propose a knowledge-enhanced agent task orchestration method. This invention fully utilizes knowledge graphs, hierarchical task network (HTN) planning models, and agent capability profiling technology. It details the process of converting user task requests into HTN task instance descriptions, and performing composite task decomposition, HTN method rule gating, binding atomic tasks to agents, task dependency constraint compilation, conflict write-back, and subtree replacement-based local replanning based on an improved HTN planning model. It has the advantages of clear task decomposition structure, accurate agent matching, controllable anomaly handling range, continuous optimization based on historical feedback, and high stability in complex task orchestration.

[0007] A knowledge-enhanced agent task orchestration method according to an embodiment of the present invention includes the following steps: S1. Obtain task request data, intelligent agent tool registration data, domain knowledge data, and historical task execution data, and parse them to obtain task objectives, task constraints, and task context; S2. Construct an HTN task knowledge graph based on domain knowledge data and historical task execution data, complete the task objectives, and obtain HTN task instance descriptions; S3. Input the HTN task instance description into the improved knowledge-enhanced HTN planning model, decompose the composite task nodes layer by layer, and obtain the HTN task hierarchical network. S4. Construct a capability profile of the agent based on the agent tool registration data and historical task execution data, bind atomic task nodes to the agent, and obtain a binding execution scheme. S5. Based on the HTN task hierarchy network and binding execution scheme, perform constraint compilation, conflict resolution and network writeback to obtain the agent task orchestration sequence; S6. Execute tasks according to the agent task orchestration sequence, and perform HTN subtree replacement replanning based on execution anomalies to obtain the updated task orchestration execution results.

[0008] Optionally, step S2 includes the following steps: S21. Construct an HTN task knowledge graph that includes task type nodes, business object nodes, constraint rule nodes, target effect condition nodes, and HTN method rule nodes. S22. Align the task objects in the task objective with the business object nodes to obtain the task entity mapping result; S23. Retrieve associated nodes based on the task entity mapping results to obtain the HTN associated knowledge set used for task instantiation; S24. Based on the HTN associated knowledge set, complete the task slots, preconditions, and target effect conditions to obtain the HTN task instance description.

[0009] Optionally, step S24 includes the following steps: S241. Based on the task entity mapping result and the task type node, convert the task target into a composite task node; S242. Generate task object slots, input data slots, output result slots, and execution constraint slots for composite task nodes; S243. Generate the HTN prerequisite condition set and the target effect condition set based on the constraint rule node and the target effect condition node; S244. Write each slot, the set of HTN prerequisite conditions, and the set of target effect conditions into the composite task node to obtain the HTN task instance description.

[0010] Optionally, step S3 includes the following steps: S31. Take the composite task node in the HTN task instance description as the root node and obtain the candidate HTN method rule set. S32. Based on knowledge constraints, historical execution feedback and tool availability status, candidate HTN method rules are filtered to obtain a set of available HTN method rules; S33. Call the available HTN method rule set to decompose the root node and sub-task nodes layer by layer to obtain the atomic task node set; S34. Generate HTN task dependency edges based on parent-child relationships, preconditions, target effect conditions, and data flow relationships to obtain the HTN task hierarchy network.

[0011] Optionally, step S32 includes the following steps: S321. Perform semantic gating based on task type, task object, and output result slot to obtain the first HTN method rule set; S322. Perform knowledge constraint gating based on the HTN precondition set to obtain the second HTN method rule set; S323. Based on the successful decomposition records, abnormal rollback records, and HTN subtree replacement records, feedback filtering is performed to obtain the third HTN method rule set. S324. Based on the tool's online status, field support, and the number of alternative tools, perform accessibility filtering to obtain a set of available HTN method rules.

[0012] Optionally, step S4 includes the following steps: S41. Based on the tool function description, input and output parameters, field mapping template, calling permissions, and running status, obtain the static capability data of the intelligent agent; S42. Based on historical success rate, response latency, number of abnormal rollbacks, and records of achieving target effect conditions, obtain dynamic execution quality data of the agent; S43. Associate the static capability data and dynamic execution quality data of the intelligent agent to construct a capability profile of the intelligent agent; S44. Match the preconditions, input fields, output fields, and target effect conditions of the atomic task node with the agent's capability profile to obtain the binding execution plan.

[0013] Optionally, step S5 includes the following steps: S51. Generate a set of task dependency constraints based on the parent-child decomposition edges, preceding dependency edges, data dependency edges, and resource dependency edges in the HTN task hierarchy network. S52. Perform constraint compilation on the atomic task nodes according to the task dependency constraint set to obtain the initial task execution sequence; S53. Perform parallel merging of atomic task nodes under the same composite task node that do not conflict with each other to obtain HTN parallel task group. S54. Conflict resolution and write-back are performed on the initial task execution sequence and HTN parallel task group to obtain the agent task orchestration sequence.

[0014] Optionally, S54 includes the following steps: S541. Identify resource usage conflicts, data read / write conflicts, permission call conflicts, agent call conflicts, and target effect condition conflicts to obtain a set of task conflicts; S542. Based on the parent-child task relationship, dependency depth, scope of influence of target effect conditions, and substitutability of agents, the conflict resolution order is obtained; S543. Perform delayed execution, alternative agent selection, field remapping, or task splitting according to the conflict resolution order to obtain the conflict correction result; S544. Write the conflict correction results back to the HTN task hierarchy network, update the task dependency edges and binding execution scheme, and obtain the agent task orchestration sequence.

[0015] Optionally, step S6 includes the following steps: S61. Call the agents bound to the atomic task nodes according to the agent task orchestration sequence to obtain the atomic task execution results; S62. Backfill the execution results of the atomic tasks to the corresponding atomic task nodes, and update the node execution status and the status of meeting the target effect conditions. S63. Perform consistency verification based on the target effect conditions and HTN task dependencies to obtain the HTN execution verification result; S64. When the HTN execution verification result is abnormal, locate the abnormal atomic task node and related task node, and generate the HTN local replanning range. S65. Based on the local replanning range of HTN, perform HTN subtree rollback, alternative rule selection and subtree replacement to obtain the replanning HTN task hierarchy network; S66. Generate an updated task orchestration sequence based on the replanned HTN task hierarchy network, and write it into the historical task execution data to obtain the updated task orchestration execution result.

[0016] Optionally, S65 includes the following steps: S651. Determine the abnormal atomic task node, its sub-task node, and its composite task node according to the local replanning range of HTN to obtain the HTN subtree to be replaced. S652. Retrieve HTN method rules that have the same target effect conditions as the HTN subtree to be replaced, and obtain a set of candidate replacement rules; S653. Based on knowledge constraints, tool availability status, and historical subtree replacement records, candidate replacement rules are filtered to obtain the target replacement HTN method rules; S654. Call the target replacement HTN method rules to re-decompose the HTN subtree to be replaced and generate the replacement HTN subtree; S655. The replacement HTN subtree is connected to the original HTN task hierarchy network, and the HTN task dependency edges are updated to obtain the replanned HTN task hierarchy network.

[0017] The beneficial effects of this invention are as follows: By constructing an HTN task knowledge graph, this invention associates task types, business objects, data resources, constraint rules, target effect conditions, HTN method rules, and agent capabilities, enabling user task requests to be converted into HTN task instance descriptions adapted to and improved HTN planning model calls. Compared to directly splitting tasks through natural language prompts, this invention clearly defines task object slots, input / output slots, HTN preconditions, and target effect conditions, reducing semantic gaps and constraint omissions during task decomposition.

[0018] This invention employs an improved Knowledge-Enhanced Hierarchical Task Network (HTN) planning model to decompose complex task nodes layer by layer. It utilizes knowledge constraints, historical execution feedback, rule gating, and the availability of agent tools to filter HTN method rules, thus freeing task decomposition from solely relying on fixed manual rules. Compared to traditional HTN planning methods, this invention can dynamically select more suitable decomposition paths based on the actual execution environment and historical feedback, improving the executability and stability of complex task decomposition.

[0019] This invention constructs an agent capability profile, matching the agent's functional description, input / output parameters, field mapping templates, invocation permissions, running status, historical success rate, and target effect conditions with HTN atomic task nodes through records, thereby achieving binding execution between atomic task nodes and the agent. Compared to methods that only rely on tool names or descriptions for invocation, this invention can verify from multiple dimensions such as preconditions, field mapping, target effect conditions, and execution quality, improving the accuracy of agent selection.

[0020] This invention generates agent task orchestration sequences through HTN task hierarchy network constraints, and writes back to the HTN task hierarchy network during task sorting, parallel merging, and conflict resolution processes. This ensures that the task orchestration results are always constrained by parent-child decomposition relationships, prerequisite dependencies, data dependencies, resource dependencies, and target effect condition dependencies. Compared to ordinary task queue scheduling methods, this invention avoids data read / write conflicts, resource occupation conflicts, permission call conflicts, and target effect condition conflicts, thereby improving the reliability of multi-agent collaborative execution.

[0021] This invention, through HTN node status backfilling, target effect condition verification, and anomaly feedback analysis during execution, eliminates the need for a complete replanning when execution anomalies, field mismatches, HTN precondition failures, or target effect conditions are not met. Instead, it determines a local replanning scope within the HTN task-level network and completes local corrections by using the HTN subtree to be replaced, alternative HTN method rules, and alternative HTN subtree access. Compared to overall retries or regenerating task plans, this invention reduces the replanning scope, minimizes the re-execution of irrelevant tasks, and improves anomaly recovery efficiency.

[0022] This invention also incorporates exception types, alternative HTN method rules, HTN subtree replacement paths, rule feedback weights, and final verification results into historical task execution data. This allows subsequent task orchestration to leverage historical execution feedback to further optimize HTN method rule selection and agent binding results. Thus, this invention forms a closed-loop processing flow from task instantiation, HTN planning, agent binding, orchestration sequence generation, execution verification to historical feedback updates, achieving stable orchestration and continuous optimization of complex agent tasks. Attached Figure Description

[0023] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a knowledge-enhanced intelligent agent task orchestration method proposed in this invention; Figure 2This is a schematic diagram of the improved knowledge-enhanced HTN planning model proposed in this invention; Figure 3 This is a flowchart of the HTN subtree replacement local replanning process proposed in this invention. Detailed Implementation

[0024] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0025] refer to Figures 1-3 A knowledge-enhanced agent task orchestration method includes the following steps: S1. Obtain task request data, intelligent agent tool registration data, domain knowledge data, and historical task execution data, and parse them to obtain task objectives, task constraints, and task context; S2. Construct an HTN task knowledge graph based on domain knowledge data and historical task execution data, complete the task objectives, and obtain HTN task instance descriptions; S3. Input the HTN task instance description into the improved knowledge-enhanced HTN planning model, decompose the composite task nodes layer by layer, and obtain the HTN task hierarchical network. S4. Construct a capability profile of the agent based on the agent tool registration data and historical task execution data, bind atomic task nodes to the agent, and obtain a binding execution scheme. S5. Based on the HTN task hierarchy network and binding execution scheme, perform constraint compilation, conflict resolution and network writeback to obtain the agent task orchestration sequence; S6. Execute tasks according to the agent task orchestration sequence, and perform HTN subtree replacement replanning based on execution anomalies to obtain the updated task orchestration execution results.

[0026] In this embodiment, S1 specifically includes: the system acquiring user task request data, intelligent agent tool registration data, domain knowledge data, and historical task execution data. The user task request data includes natural language task text, structured task parameters, user session context records, task instructions submitted by external business systems, and current user identity information. The natural language task text expresses the user's task objective; the structured task parameters express the task object, time range, data range, output format, and priority; the user session context records supplement objects omitted or referred to in the current task; the task instructions submitted by external business systems indicate automated tasks triggered by other systems; and the current user identity information is used to determine whether subsequent intelligent agent tool calls and data access meet permission conditions.

[0027] The registration data for an agent tool includes the agent tool name, function description, input parameter format, output result format, field mapping template, calling permissions, running status, interface call address, alternative agent identifier, and tool version information. The tool name uniquely identifies the agent tool; the function description describes the tasks and actions the agent can perform; the input parameter format limits the required input fields and their types; the output result format limits the data structure returned by the agent; the field mapping template establishes the mapping relationship between HTN atomic task node fields and agent input / output fields; calling permissions limit the users, roles, or systems that can call the agent; the running status indicates whether the agent is online, rate-limited, under maintenance, or abnormal; the alternative agent identifier indicates an alternative tool that can be selected when the current agent is unavailable; and the tool version information distinguishes the differences in field support capabilities and output formats across different versions of the same agent tool.

[0028] Domain knowledge data includes task types, business objects, data resources, constraints, target effect conditions, and HTN method rules. Task types distinguish between tasks such as data querying, text generation, process handling, anomaly analysis, report summarization, field validation, and cross-system calls. Business objects represent the data entities, process objects, document objects, and permission objects involved in the task. Data resources represent the database tables, interface data, document data, and cached data that the task needs to read or write. Constraint rules represent permission constraints, data format constraints, execution order constraints, resource consumption constraints, and business state constraints. Target effect conditions represent the result fields, result semantics, result format, result source, and validation method to be achieved after task execution. HTN method rules represent how composite task nodes are decomposed into sub-task nodes or atomic task nodes, forming the core rule foundation for improving the hierarchical decomposition of the HTN planning model.

[0029] Historical task execution data includes historical task decomposition paths, historical HTN task hierarchical networks, agent call records, execution status, exception types, HTN subtree replacement paths, alternative HTN method rules, final verification results, and rule feedback weights. Historical task decomposition paths represent the paths from composite task nodes to atomic task nodes for similar tasks in the past; agent call records represent the agents bound to atomic task nodes and their call results; execution status indicates whether a task node has completed execution, encountered an exception, been retried, or been replaced; exception types indicate reasons for exceptions such as interface unavailability, missing fields, invalid permission conditions, and failure to meet target effect conditions; HTN subtree replacement paths record the task subtrees that were rolled back and replaced after an exception occurred; alternative HTN method rules record the rules used during the replacement process; final verification results represent the overall result after task execution; and rule feedback weights are used to participate in HTN method rule gating and filtering in subsequent tasks.

[0030] The system performs semantic parsing and task intent recognition on user task request data to obtain task objective descriptions, task constraint information, and task context information. The task objective description represents the overall task goal the user wishes to achieve and is stored in a semantic structure that can be further processed by the system. Task constraint information represents the permission conditions, data conditions, execution order conditions, resource consumption conditions, and result format conditions that must be met during task execution. Task context information represents the session background, existing data, business scenario, historical operation results, and user preference settings that the current task depends on. Through this step, unstructured or semi-structured user task requests are transformed into the basic input required for subsequent HTN task instance construction, providing a semantic foundation for the subsequent construction of HTN task instance descriptions.

[0031] In this embodiment, S2 specifically includes: the system constructing an HTN task knowledge graph based on domain knowledge data and historical task execution data. This HTN task knowledge graph includes task type nodes, business object nodes, data resource nodes, constraint rule nodes, target effect condition nodes, HTN method rule nodes, and agent capability nodes. Task type nodes represent the task categories that the system can recognize and the hierarchical relationships between task categories. Business object nodes represent the objects involved in the task and the relationships between them. Data resource nodes represent the data that needs to be read, written, or transmitted during task execution. Constraint rule nodes represent restrictions on permissions, formats, timing, resources, and business states. Target effect condition nodes represent the result fields, result semantics, result formats, and verification methods that must be satisfied after the task is completed. HTN method rule nodes represent the rules for decomposing composite tasks into subtasks or atomic tasks. Agent capability nodes represent the functions that the agent tool can execute, supported fields, callable states, and target effect condition coverage capabilities.

[0032] The system aligns task objects in the task objective description with business object nodes in the HTN task knowledge graph to obtain task entity mapping results. The entity alignment process includes object name normalization, synonym merging, contextual reference completion, business object type identification, and object relationship confirmation. Object name normalization converts abbreviations, aliases, or non-standard names in user expressions into standard business object names in the HTN task knowledge graph. Synonym merging merges task objects with different expressions but pointing to the same object. Contextual reference completion supplements objects omitted in the user request based on the session context. Business object type identification determines whether a task object is a data object, process object, document object, personnel object, or permission object. Object relationship confirmation determines whether there are subordinate, referential, temporal, or data flow relationships between multiple task objects. Through entity alignment, the system can identify the corresponding nodes of key objects in the user's task request in the HTN task knowledge graph, avoiding ambiguity in task objects during subsequent task decomposition.

[0033] After obtaining the task entity mapping results, the system retrieves task type nodes, data resource nodes, constraint rule nodes, target effect condition nodes, and HTN method rule nodes associated with the task entity mapping results from the HTN task knowledge graph, thus obtaining the HTN associated knowledge set. The HTN associated knowledge set supports the conversion of task target descriptions to HTN task instance descriptions. The system determines whether the current task is a composite task based on the task type node, determines the input and output data required for task execution based on the data resource node, determines the HTN preconditions for task execution based on the constraint rule node, determines the target effect conditions that need to be met after task completion based on the target effect condition node, and determines candidate HTN method rules that can be used for task decomposition based on the HTN method rule node.

[0034] The system further performs composite task identification, task slot completion, HTN precondition completion, target effect condition completion, and HTN method rule candidate tagging on the task objective description. Composite task identification is used to convert user task requests into at least one composite task node. Task slot completion is used to generate task object slots, input data slots, output result slots, and execution constraint slots for composite task nodes. HTN precondition completion is used to supplement permission conditions, data format conditions, resource consumption conditions, execution order conditions, and preceding data conditions for composite task nodes, sub-task nodes, and candidate atomic task nodes. Target effect condition completion is used to determine the result fields, result sources, result formats, result semantics, and validation methods that need to be satisfied after the task is completed. HTN method rule candidate tagging is used to establish candidate associations between HTN method rules that may be suitable for the current composite task node and the composite task node.

[0035] In this implementation, HTN preconditions refer to the conditions that must be met before a composite task node, sub-task node, or atomic task node is allowed to execute. These include permission fulfillment, complete input fields, valid data format, completion of preceding nodes, and resources not being mutually exclusive. Target effect conditions refer to the target state that must be achieved after the task is completed. These include complete output fields, semantically correct output results, reliable result sources, compliant result format, and the continued usability of dependent nodes. The final verification result is the verification output obtained by summarizing the target effect conditions of each atomic task node after execution. The final verification result includes three states: pass, partially pass, and fail. Pass indicates that all key target effect conditions and auxiliary target effect conditions have been achieved; partially pass indicates that key target effect conditions have been achieved but some non-key fields are missing or auxiliary targets are not completed; fail indicates that at least one key target effect condition has not been achieved.

[0036] The system writes the task object slot, input data slot, output result slot, execution constraint slot, HTN precondition set, and target effect condition set into the composite task node to obtain an HTN task instance description adapted to the improved HTN planning model call. This HTN task instance description is not ordinary task text, but a structured task input containing the composite task node, slot information, HTN preconditions, target effect conditions, and candidate HTN method rule tags. The task object slot in the HTN task instance description records the business objects involved in the task; the input data slot records the data fields and data sources that need to be prepared before task execution; the output result slot records the data fields and result format that should be output after task execution; the execution constraint slot records the permissions, timing, and resource limitations during task execution; the HTN precondition set determines whether the task node has the necessary execution conditions; and the target effect condition set determines whether the task node's execution result meets the expected goal.

[0037] In this embodiment, S3 specifically includes: the system inputting the HTN task instance description into the improved knowledge-enhanced hierarchical task network (HTN) planning model. The improved HTN planning model uses the composite task node in the HTN task instance description as the root node, and obtains a set of candidate HTN method rules associated with the root node from the HTN task knowledge graph and historical task execution data. Each HTN method rule includes at least a rule identifier, applicable composite task type, applicable business object scope, decomposition preconditions, sub-task node set, sub-task dependencies, target effect conditions, rule feedback weight, and abnormal substitution identifier. The rule identifier is used to uniquely identify the HTN method rule; the applicable composite task type is used to determine the task category to which the rule is applicable; the applicable business object scope is used to determine whether the rule is applicable to the current task object; the decomposition preconditions are used to limit the HTN preconditions that must be met before the rule is invoked; the subtask node set is used to describe the decomposed subtasks or atomic tasks; the subtask dependency relationship is used to describe the sequence, data, and resource relationships between the decomposed tasks; the target effect condition is used to limit the final task effect that the method rule decomposition path should achieve; the rule feedback weight is used to reflect the stability of the rule in historical tasks; and the anomaly substitution identifier is used to record whether the rule can be used as a substitute rule when replacing a subtree.

[0038] The system performs HTN method rule gating filtering on the candidate HTN method rule set based on knowledge constraints, historical execution feedback, and the availability status of agent tool registration, resulting in a set of usable HTN method rules. Knowledge constraints include permission conditions, data format conditions, resource consumption conditions, execution order conditions, and business object relationship constraints. Historical execution feedback includes successful decomposition records, abnormal rollback records, HTN subtree replacement records, and final verification pass records. The availability status of agent tool registration includes tool online status, permission fulfillment, input field support, output field support, target effect coverage, and the number of alternative tools. Through HTN method rule gating filtering, the system can eliminate HTN method rules that are unexecutable in the current task context, have a high historical failure rate, lack available agent support, or cannot meet the target effect conditions.

[0039] In this implementation, stage S3 uses an agent tool to register available states for coarse screening, aiming to exclude obviously unexecutable decomposition paths during HTN method rule gating. This coarse screening only determines whether candidate HTN method rules have callable tool support, basic field support, and whether they meet calling permissions; it does not perform detailed field mapping for each atomic task node. Stage S4 then performs fine binding based on the agent capability profile, aiming to perform field-level, permission-level, target effect condition-level, and historical execution quality-level verifications on each HTN atomic task node. Thus, the rule gating in S3 and the agent binding in S4 form a coarse-screen followed by fine-binding process, avoiding the use of fine-profile results before the agent capability profile is built, and also preventing a large number of unexecutable HTN method rules from entering the subsequent binding stage.

[0040] The rule feedback weight ranges from 0 to 1 and is used to represent the historical reliability of the HTN method rule in the same or similar tasks. A rule feedback weight higher than 0.80 indicates that the HTN method rule has been completed multiple times in historical tasks and the final verification result is passed; a rule feedback weight between 0.50 and 0.80 indicates that the rule can achieve the main objective effect conditions, but there have been instances of missing non-critical fields, incomplete auxiliary objectives, or partial replanning; a rule feedback weight lower than 0.50 indicates that the rule has had many abnormal rollbacks, HTN subtree replacements, or unmet objective effect conditions in historical tasks. After the historical task is completed, the system updates the rule feedback weight. When the final verification result is passed and no HTN subtree replacement occurs, the subsequent call priority of the rule is increased. When the final verification result is partially passed and only non-critical target effect conditions are not met, the call priority of the rule is maintained or slightly reduced. When the final verification result is failed, an abnormal rollback occurs, or an HTN subtree replacement occurs, the call priority of the rule is reduced. When the same rule passes the final verification multiple times in a row, it is marked as a priority candidate rule.

[0041] The system calls the available HTN method rule set to perform hierarchical decomposition of the root node, breaking it down into sub-task nodes or atomic task nodes. When a sub-task node still possesses complex semantics, the system continues to match available HTN method rules for that sub-task node and further decomposes it. When a sub-task node lacks available HTN method rules but meets the direct invocation conditions, the system identifies it as an atomic task node. Direct invocation conditions include clearly defined HTN preconditions, complete input fields, clearly defined output fields, verifiable target effect conditions, and the existence of a bindable agent tool. Through this process, the complex task proposed by the user is decomposed into atomic task nodes that can be directly executed by an agent. For nodes that cannot be further decomposed and do not meet the direct invocation conditions, the system marks them as task nodes to be completed and returns information on missing task slots, missing preconditions, or missing tool support for subsequent completion or manual confirmation.

[0042] The system generates HTN task dependency edges between composite task nodes, HTN method rule nodes, sub-task nodes, and atomic task nodes based on parent-child decomposition relationships, HTN preconditions, target effect conditions, data flow relationships, and resource occupation relationships, thus obtaining the HTN task hierarchy network. HTN task dependency edges include parent-child decomposition edges, precondition dependencies, data dependencies, resource dependencies, and target effect condition dependencies. Parent-child decomposition edges represent the hierarchical relationship between composite tasks and sub-tasks; precondition dependencies represent the task execution order; data dependencies represent the transmission relationship from upstream output fields to downstream input fields; resource dependencies represent the occupation relationship of the same resource; and target effect condition dependencies represent whether the target effect condition of a certain task affects the execution of subsequent tasks. After the HTN task hierarchy network is generated, the system records the node identifier, node type, associated composite task, input fields, output fields, HTN preconditions, target effect conditions, candidate agent set, and initial execution state value for each node.

[0043] In this embodiment, S4 specifically includes: the system constructing an agent capability profile based on agent tool registration data and historical task execution data. The agent capability profile consists of static agent capability data and dynamic agent execution quality data. Static agent capability data includes functional descriptions, input / output parameters, field mapping templates, calling permissions, running status, and alternative agent identifiers. Dynamic agent execution quality data includes historical success rate, response latency, result consistency verification pass rate, number of abnormal rollbacks, number of HTN subtree replacement calls, and target effect condition achievement records. Historical success rate represents the proportion of successful executions of the agent in historical atomic tasks; response latency represents the time required for the agent to return a result from receiving the task; result consistency verification pass rate represents the proportion of the agent's output results that pass format, semantic, and field transmission verifications; number of abnormal rollbacks represents the number of times the agent caused task rollbacks in historical executions; number of HTN subtree replacement calls represents the number of times the system triggered HTN subtree replacement due to the agent's execution failure; and target effect condition achievement records represent the historical situations where the agent's output results met the target effect conditions.

[0044] The system associates static capability data and dynamic execution quality data of the agent with agent capability nodes in the HTN task knowledge graph, constructing an agent capability profile that includes functional capabilities, parameter capabilities, field mapping capabilities, permission capabilities, operational availability, target effect condition coverage capabilities, and execution quality. Specifically, functional capabilities determine whether the agent can execute the task action corresponding to the atomic task node; parameter capabilities determine whether the agent supports the input parameters required by the atomic task node; field mapping capabilities determine whether the output fields of the upstream task can be converted into the input fields of the agent; permission capabilities determine whether the current user or system has the necessary calling permissions; operational availability determines whether the agent is currently in a callable state; target effect condition coverage capabilities determine whether the agent's output results meet the target effect conditions of the atomic task node; and execution quality measures the historical execution stability of the agent.

[0045] The system matches and verifies the HTN preconditions, input fields, output fields, target effect conditions, and permission conditions of atomic task nodes with the agent's capability profile to obtain a binding execution scheme between the HTN atomic task node and the agent. The binding execution scheme includes the atomic task node identifier, the bound agent identifier, input field mapping relationships, output field mapping relationships, calling parameters, target effect condition verification methods, and a list of alternative agents. The input field mapping relationships are used to convert the output fields of upstream nodes in the HTN task hierarchy network into the input fields required by the agent tool; the output field mapping relationships are used to convert the agent's return fields into the output fields of the HTN atomic task node; the calling parameters are used to record the interface parameters, permission credentials, and context information required for agent execution; the target effect condition verification methods are used to explain how to determine whether the target effect conditions have been met after the atomic task node executes; and the list of alternative agents is used to provide candidate alternative tools when the agent call fails.

[0046] Since the binding process targets HTN atomic task nodes, agents are not simply invoked by name, but rather bound to atomic task nodes with explicit HTN preconditions and target effect conditions. When multiple agents meet the execution requirements of the same atomic task node, the system prioritizes agents with normal availability, high target effect condition coverage, high historical success rate, high result consistency verification pass rate, and low HTN subtree replacement call count. When no agent fully meets the atomic task node requirements, the system determines whether there is a feasible path for field remapping or parameter remapping; if so, it generates a binding execution plan with field remapping processing; if not, it marks the atomic task node as an unbindable node and writes it back to the HTN task hierarchy network to trigger HTN method rule re-selection or subsequent local replanning.

[0047] In this embodiment, S5 specifically includes: the system generating an HTN task dependency constraint set based on the parent-child decomposition edges, prerequisite dependency edges, data dependency edges, resource dependency edges, and target effect condition dependency edges in the HTN task hierarchy network. This HTN task dependency constraint set is used to constrain the execution order, parallel relationships, data transmission paths, and resource usage relationships of atomic task nodes. The system performs constraint compilation on the atomic task nodes based on the HTN task dependency constraint set to obtain an initial task execution sequence constrained by the HTN task hierarchy network. During the constraint compilation process, the system uses parent-child decomposition edges to limit the affiliation of atomic task nodes under the same composite task node, prerequisite dependency edges to limit the node execution order, data dependency edges to limit the source of input fields, resource dependency edges to limit the order of occupying non-shareable resources, and target effect condition dependency edges to limit the dependency relationship of subsequent nodes on the preceding target effect conditions.

[0048] The system performs parallel merging of atomic task nodes within the initial task execution sequence that are under the same composite task node, have independent HTN preconditions, different data write objects, and non-exclusive resources, resulting in HTN parallel task groups. Parallel merging must satisfy constraints of being under the same composite task node, having independent HTN preconditions, avoiding data read / write conflicts, and ensuring non-exclusive resources. For atomic tasks under different composite task nodes, even without direct data dependencies, the system still checks for target effect dependencies between their upper-level composite tasks; if a target effect dependency exists, parallel merging is not performed. Through this process, the system can improve task execution efficiency without disrupting the HTN task hierarchy network structure.

[0049] The system further identifies resource occupation conflicts, data read / write conflicts, permission call conflicts, agent call conflicts, and target effect condition conflicts in the initial task execution sequence and HTN parallel task groups, resulting in an HTN task conflict set. Resource occupation conflicts refer to multiple atomic task nodes simultaneously occupying the same non-shareable resource; data read / write conflicts refer to data being read by one atomic task node being written by another atomic task node; permission call conflicts refer to the agent bound to an atomic task node not meeting the call permissions; agent call conflicts refer to the same agent being unable to handle multiple tasks during the same execution period; and target effect condition conflicts refer to the target effect conditions of two task nodes overlapping, contradicting each other, or creating inconsistent inputs to downstream nodes.

[0050] The system determines the conflict resolution order based on parent-child task relationships, task priorities, dependency depth, the scope of influence of target effect conditions, and the substitutability of agents. It then performs delayed execution, alternative agent selection, field remapping, parameter remapping, or task splitting according to this order to obtain the conflict correction result. Task priority is used to determine the importance of a task node to the overall task objective; dependency depth is used to determine the hierarchical position of the conflicting node in the HTN task hierarchy network; the scope of influence of target effect conditions is used to determine whether the node's output affects multiple downstream nodes; and the substitutability of agents is used to determine whether there are substitute agents. For conflicting nodes with a large scope of influence, the system prioritizes ensuring that their target effect conditions are not violated; for conflicting nodes with a high degree of substitutability, the system prioritizes selecting alternative agents; for conflicting nodes with mismatched field formats, the system prioritizes field remapping or parameter remapping; and for conflicting nodes caused by resource mutual exclusion, the system prioritizes delayed execution.

[0051] The conflict correction results are not only used to modify the execution queue, but are also written back to the HTN task hierarchy network. Based on the conflict correction results, the system updates the parent-child task relationships, HTN task dependency edges, target effect conditions, and binding execution schemes of the affected nodes, resulting in an agent task orchestration sequence generated by the HTN task hierarchy network constraints. Thus, task sorting, parallel merging, and conflict resolution are always completed within the HTN task hierarchy network, avoiding the generation of ordinary task queues that deviate from HTN constraints. In the agent task orchestration sequence, each execution unit retains its corresponding HTN atomic task node identifier, its associated composite task node, bound agent identifier, input field source, output field destination, target effect conditions, and execution order information.

[0052] In this embodiment, S6 specifically includes: the system calling the agent bound to the atomic task node to execute the task according to the agent task orchestration sequence. During the call, the system passes the input fields, task context information, previous task results, and target effect conditions of the atomic task node to the corresponding agent to obtain the atomic task execution result. The atomic task execution result includes execution status, output fields, output content, result source, field mapping status, and target effect condition satisfaction status. Execution status includes pending execution, executing, successful execution, failed execution, rolled back, and replaced. Field mapping status includes successful mapping, partial mapping, and failed mapping. Target effect condition satisfaction status includes satisfied, partially satisfied, and not satisfied.

[0053] The system backfills the execution results of atomic tasks into the corresponding atomic task nodes in the HTN task hierarchy network, and updates the execution status, output fields, result sources, field mapping status, and target effect condition satisfaction status of these atomic task nodes, obtaining node status update results that can be used for HTN execution verification. Node status backfilling enables the HTN task hierarchy network to not only be used for planning but also for carrying execution status and result feedback, thus forming an integrated data structure for planning and execution. For completed atomic task nodes, the system passes their output fields to downstream nodes that depend on those output fields; for atomic task nodes that fail, the system records the reason for failure, failure time, bound agent identifier, and alternative agent information; for atomic task nodes where target effect conditions are not met, the system records the unmet target effect conditions and their impact scope.

[0054] The system performs consistency checks, HTN precondition fulfillment checks, and target effect condition achievement checks on the HTN node state update results based on the target effect conditions and HTN task dependency edges described in the HTN task instance description, obtaining the HTN execution verification result. Consistency checks include output format consistency, result semantic consistency, and field transmission consistency. HTN precondition fulfillment checks determine whether the permissions, data, resources, and preceding results that the atomic task node depends on before execution are satisfied. Target effect condition achievement checks determine whether the atomic task execution result meets the expected result fields, result semantics, result format, and verification method. The final verification result is obtained by summing the HTN execution verification results of each atomic task node. When all key atomic task nodes pass the target effect condition achievement check and downstream dependent nodes can continue execution, the final verification result is "passed." When key atomic task nodes pass but auxiliary atomic task nodes have missing non-key fields, the final verification result is "partially passed." When any key atomic task node fails to achieve its target effect condition or causes downstream nodes to fail to execute, the final verification result is "failed."

[0055] When the HTN execution verification result indicates an execution anomaly, missing result, field mismatch, invalid HTN preconditions, or failure to meet the target effect condition, the system locates the anomalous atomic task node and its associated task nodes within the HTN task hierarchy network, generating an HTN local replanning scope. The HTN local replanning scope includes upstream input nodes, downstream dependent nodes, nodes with the same resources, nodes with the same agent, and nodes with the same target effect condition. Upstream input nodes are used to locate the source of the input fields of the anomalous node; downstream dependent nodes are used to locate tasks that depend on the output result of the anomalous node for continued execution; nodes with the same resources are used to locate tasks that have resource mutual exclusion with the anomalous node; nodes with the same agent are used to locate tasks that may be affected by anomalies in calls from the same agent; and nodes with the same target effect condition are used to locate tasks that jointly affect the same target effect condition as the anomalous node. Through this scope control, the system ensures that anomaly handling only affects local tasks that have HTN dependencies or target effect conditions associated with the anomalous node, avoiding duplicate execution of the entire task.

[0056] The system, based on the HTN local replanning scope, calls an improved HTN planning model to perform HTN subtree rollback, select alternative HTN method rules, replace subtrees, and update HTN task dependency edges, resulting in a replanned HTN task hierarchy network. The system determines the abnormal atomic task nodes, their associated subtask nodes, and their associated composite task nodes that need to be rolled back based on the HTN local replanning scope, thus obtaining the HTN subtrees to be replaced. The HTN subtrees to be replaced include abnormal atomic task nodes, direct parent-child task relationships, related HTN task dependency edges, input-output field mapping relationships, target effect conditions, and bound execution schemes. When rolling back the HTN subtrees to be replaced, the system retains task nodes that have passed final verification and do not depend on the output results of abnormal nodes, while rolling back abnormal nodes and their affected nodes, thereby reducing the repeated execution of irrelevant tasks.

[0057] Subsequently, the system retrieves alternative HTN method rules with the same target effect conditions as the HTN subtree to be replaced from the HTN task knowledge graph, obtaining a set of candidate alternative HTN method rules. Candidate alternative HTN method rules must meet three conditions: their applicable composite task type matches the composite task node to which the HTN subtree to be replaced belongs; the alternative HTN subtree formed after decomposition can cover the target effect conditions corresponding to the HTN subtree to be replaced; and their corresponding atomic task nodes can be bound to currently available agents. The system performs substitution feasibility screening based on knowledge constraints, agent tool registration availability status, and historical HTN subtree replacement records to obtain the target alternative HTN method rule. After the target alternative HTN method rule is determined, the system calls this rule to re-decompose the composite task nodes of the HTN subtree to be replaced, generating alternative HTN subtrees, and connects the alternative HTN subtrees to the original HTN task hierarchical network. It then updates the HTN task dependency edges between the alternative HTN subtree and upstream, downstream, and horizontally related task nodes, obtaining a re-planned HTN task hierarchical network.

[0058] In this implementation, the HTN subtree to be replaced and the replacement HTN subtree must satisfy the target effect condition equivalence constraint. The target effect condition equivalence constraint means that the final output fields, semantics, format, and validation methods of the replacement HTN subtree must be consistent with the target effect conditions corresponding to the composite task node to which the replacement HTN subtree belongs. Through this constraint, the system can replace abnormal decomposition paths without changing the user's overall task objective, avoiding task objective deviation due to local replanning. Abnormal handling does not directly generate a new task list; instead, it uses the replacement HTN subtree as the smallest adjustment object and requires that the replacement HTN subtree and the original composite task node have the same target effect conditions. Therefore, this replanning process relies on the HTN task hierarchy network to complete.

[0059] The system generates an updated agent task orchestration sequence based on the reconfigured HTN task hierarchy network. It then writes the anomaly type, failed HTN preconditions, unmet target effect conditions, alternative HTN method rules, HTN subtree replacement paths, rule feedback weights, and final verification results into the historical task execution data, resulting in the updated task orchestration execution results. After the historical task execution data is updated, it can continue to participate in HTN method rule gating, agent binding, and alternative HTN method rule selection in subsequent tasks, enabling the system to continuously optimize. For alternative HTN method rules that successfully meet the target effect conditions after being replaced, the system increases their rule feedback weight in similar tasks; for HTN method rules that cause anomaly rollback or fail to meet the target effect conditions, the system decreases their rule feedback weight; for agent tools that repeatedly cause HTN subtree replacements, the system lowers their execution quality evaluation and reduces their priority in subsequent bindings.

[0060] In this implementation, anomaly types include execution failure, interface unavailability, missing fields, field type mismatch, invalid permission conditions, missing preceding results, failure to meet target effect conditions, and failure to pass result consistency verification. The final verification result includes three states: pass, partial pass, and fail. Pass indicates that all atomic task nodes meet the corresponding target effect conditions; partial pass indicates that the main target effect conditions are met, but some non-critical fields are missing or some auxiliary targets are not completed; fail indicates that at least one key target effect condition is not met. The rule feedback weight is updated based on the final verification result, anomaly type, HTN subtree replacement count, and target effect condition achievement status. The updated rule feedback weight is used for subsequent HTN method rule gating and filtering. Through continuous updates of rule feedback weights and agent execution quality data, the system can prioritize the selection of more stable HTN method rules and agent binding schemes in similar or identical task scenarios.

[0061] In this implementation, to ensure consistency in the HTN task hierarchy network during execution, the system maintains a node status field for each node. The node status field includes: Not Generated, Generated, Pending Binding, Binded, Pending Execution, Executing, Execution Successful, Execution Failed, Rollbacked, Replaced, and Completed. "Not Generated" indicates the node has not yet been generated by the HTN method rule decomposition; "Generated" indicates the node has entered the HTN task hierarchy network; "Pending Binding" indicates the node has been identified as an atomic task node but has not yet been bound to an agent; "Bound" indicates the node has generated a binding execution plan; "Pending Execution" indicates the node is waiting for its HTN preconditions to be met; "Executing" indicates the node's corresponding agent is executing; "Execution Successful" indicates the node has returned the atomic task execution result; "Execution Failed" indicates the node's corresponding agent call failed or returned an exception; "Rollbacked" indicates the node is within the range of the HTN subtree to be replaced and has been rolled back; "Replaced" indicates the node has been replaced by a node in the alternative HTN subtree; and "Completed" indicates the node's target effect conditions have passed verification and the relevant downstream nodes have completed dependency propagation. By using the node status field, the system can accurately determine the stage of each HTN node during task execution and trigger binding, execution, verification, write-back, or replanning operations based on the node status.

[0062] In this implementation, to ensure that the target effect conditions can be verified by the machine, the system divides the target effect conditions into field integrity conditions, format consistency conditions, semantic consistency conditions, source credibility conditions, and dependency availability conditions. Field integrity conditions determine whether the output contains necessary fields; format consistency conditions determine whether the output conforms to a preset structure, file format, or interface format; semantic consistency conditions determine whether the meaning of the output is consistent with the task objective; source credibility conditions determine whether the output comes from authorized data resources or is bound to an intelligent agent; and dependency availability conditions determine whether the output can be used as input for downstream task nodes. After each atomic task node is executed, the system generates a target effect condition satisfaction state based on the above conditions and writes this state into the HTN task hierarchy network. In this way, the target effect conditions participate in both HTN planning and execution verification and abnormal replanning.

[0063] In this implementation, to ensure that replacing the HTN subtree does not disrupt the original task objective, the system performs access verification on the replacement HTN subtree after the replacement HTN method rule is selected. Access verification includes upstream input field adaptation verification, downstream output field adaptation verification, resource usage conflict verification, permission condition consistency verification, and target effect condition equivalence verification. Upstream input field adaptation verification determines whether the replacement HTN subtree can receive input fields provided by the original upstream node; downstream output field adaptation verification determines whether the output results of the replacement HTN subtree can continue to be used by downstream nodes; resource usage conflict verification determines whether the replacement HTN subtree introduces new resource mutual exclusion problems; permission condition consistency verification determines whether the agent calls in the replacement HTN subtree meet the permission conditions; and target effect condition equivalence verification determines whether the replacement HTN subtree can achieve the target effect conditions originally undertaken by the HTN subtree to be replaced. Only after the above access verifications pass can the replacement HTN subtree be connected to the original HTN task-level network.

[0064] Example 1: To verify the feasibility of this invention in practice, it was applied to a multi-agent task orchestration scenario of a comprehensive service platform. This platform simultaneously integrates text generation agents, data query agents, table processing agents, workflow approval agents, document retrieval agents, and message notification agents. Users frequently submit composite tasks involving document retrieval, data aggregation, report generation, approval processes, and result notifications. Traditional prompt-based agent orchestration methods primarily select execution tools based on tool names and natural language descriptions, lacking a stable hierarchical task structure. When tasks involve preconditions, field passing relationships, permission restrictions, and result verification requirements, issues such as incomplete task splitting, incorrect execution order, tool call conflicts, and overall retries after exceptions easily arise.

[0065] In this embodiment, the system first acquires user task request data, intelligent agent tool registration data, domain knowledge data, and historical task execution data. User task request data includes the user-input natural language task, uploaded material summary, required output result type, and session context; intelligent agent tool registration data includes tool name, function description, input / output parameters, field mapping template, calling permissions, running status, and alternative intelligent agent identifiers; domain knowledge data includes task type, business object, data resources, constraint rules, target effect conditions, and HTN method rules; historical task execution data includes successful decomposition records, abnormal rollback records, HTN subtree replacement records, target effect condition pass records, and final verification results.

[0066] After semantically parsing the user's task request, the system aligns the business objects in the task objective description with the business object nodes in the HTN task knowledge graph. It then completes the task slots based on task type nodes, constraint rule nodes, target effect condition nodes, and HTN method rule nodes. The completion process does not directly generate a regular task list; instead, it generates an HTN task instance description adapted to the improved HTN planning model. This HTN task instance description includes at least a composite task node, task object slots, input data slots, output result slots, execution constraint slots, a set of HTN preconditions, and a set of target effect conditions, ensuring that subsequent task decomposition must revolve around the HTN task hierarchy.

[0067] During the task planning phase, the system inputs HTN task instance descriptions into the improved knowledge-enhanced hierarchical task network (HTN) planning model. The improved HTN planning model uses composite task nodes as root nodes, retrieves a set of candidate HTN method rules based on the HTN task knowledge graph and historical task execution data, and performs rule gating based on knowledge constraints, historical execution feedback, and the availability status of agent tool registration. For data retrieval subtasks, the model prioritizes HTN method rules that satisfy input field integrity and permission conditions; for data aggregation subtasks, the model selects HTN method rules with field mapping relationships and target effect condition coverage; for report generation and notification subtasks, the model determines the output format, recipient, and verification method based on target effect conditions and downstream dependency edges. Through this processing, composite tasks are decomposed layer by layer into subtask nodes and atomic task nodes, forming an HTN task hierarchical network containing parent-child decomposition edges, preceding dependency edges, data dependency edges, resource dependency edges, and target effect condition dependency edges.

[0068] During the agent binding phase, the system constructs an agent capability profile based on static tool capability data and dynamic tool execution quality data. This profile includes not only tool functions, parameter formats, permission status, and field mapping templates, but also historical success rates, average response latency, result consistency pass rates, number of exception rollbacks, and target effect conditions. The system matches the HTN preconditions, input fields, output fields, and target effect conditions of atomic task nodes with the agent capability profile to obtain a binding execution scheme between the HTN atomic task nodes and the agents. This binding relationship ensures that each agent call has a clear HTN node source, input / output boundaries, and target effect conditions, avoiding the selection of agents solely based on tool names.

[0069] During the task orchestration phase, the system generates a set of HTN task dependency constraints based on the HTN task hierarchy network, compiles the constraints on atomic task nodes, and obtains the initial task execution sequence. For atomic task nodes under the same composite task node that have independent HTN preconditions and non-exclusive resources, the system performs parallel merging. For task nodes with resource occupation conflicts, data read / write conflicts, permission call conflicts, agent call conflicts, or target effect condition conflicts, the system resolves conflicts according to parent-child task relationships, task priorities, dependency depths, and the scope of influence of target effect conditions. The conflict correction results are then written back to the HTN task hierarchy network to update the HTN task dependency edges and binding execution schemes of the affected nodes, ultimately obtaining the agent task orchestration sequence generated by the constraints of the HTN task hierarchy network.

[0070] During the execution phase, the system invokes agents bound to atomic task nodes according to the agent task orchestration sequence, and passes the input fields, task context information, prerequisite task results, and target effect conditions of the atomic task nodes to the corresponding agents. After each atomic task is completed, the system backfills the execution results to the corresponding atomic task node, updates the execution status, output fields, field mapping status, and target effect condition satisfaction status, and performs consistency checks, HTN node status update checks, and checks on the satisfaction of HTN prerequisite conditions and the achievement of target effect conditions. When field mismatches, HTN prerequisite failures, or target effect conditions are not achieved, the system does not replan all tasks, but instead locates the abnormal atomic task node, its associated sub-task node, and its associated composite task node within the HTN task hierarchy network, forming the scope of HTN local replanning.

[0071] For tasks requiring replanning, the system determines the HTN subtree to be replaced based on the local replanning scope of the HTN. It then retrieves alternative HTN method rules with the same target effect as the subtree from the HTN task knowledge graph, and performs feasibility screening by combining knowledge constraints, tool availability, and historical HTN subtree replacement records. After screening, the system calls the target alternative HTN method rule to re-decompose the subtree to be replaced, generating an alternative HTN subtree. This alternative HTN subtree is then integrated into the original HTN task hierarchy network, updating its HTN task dependency edges with upstream, downstream, and horizontally related task nodes. After execution, the system writes the exception type, alternative HTN method rule, HTN subtree replacement path, rule feedback weight, and final verification result into the historical task execution data, providing feedback for rule gating and agent binding in subsequent tasks.

[0072] Table 1 Comparison of test results between the method of the present invention and the ordinary prompt-based task arrangement method

[0073] As shown in Table 1, with the same number of composite task samples, the task decomposition completeness rate of the method of this invention reaches 96.8%, which is higher than the 86.3% of the ordinary prompt-based arrangement method. The reason for this result is that this invention does not directly generate a linear task list, but first completes the task slots, HTN preconditions, and target effect conditions through the HTN task knowledge graph, and then uses the improved HTN planning model to call the available HTN method rules for layer-by-layer decomposition, so that composite tasks, sub-tasks, and atomic tasks have a clear parent-child structure and dependency edges.

[0074] From the perspective of tool matching and field transmission effectiveness, the tool matching accuracy of the method of this invention is 95.6%, and the input / output field matching pass rate is 94.9%, both significantly higher than the ordinary prompt-based orchestration method. This result indicates that binding the agent's capability profile with HTN atomic task nodes can simultaneously consider functional capabilities, field mapping capabilities, permission status, operational availability, and historical execution quality, avoiding the parameter missing, field mismatch, and permission insufficiency problems caused by traditional methods that rely solely on tool description matching.

[0075] In terms of conflict resolution effectiveness, the resource or permission conflict detection rate of the method of this invention reached 91.6%, and the average task completion time was reduced from 18.6 minutes to 14.2 minutes. This result indicates that the parent-child decomposition edges, prerequisite dependency edges, data dependency edges, resource dependency edges, and target effect condition dependency edges in the HTN task hierarchy network can provide structured constraints for task sorting, parallel merging, and conflict resolution, enabling parallelizable tasks to be merged and executed. Simultaneously, the correction results of conflict nodes are written back to the HTN task hierarchy network, reducing redundant scheduling and invalid waiting.

[0076] In terms of anomaly recovery, the conventional prompt-based orchestration method requires an average of 6.1 nodes to be re-executed after an anomaly, while the method of this invention only requires 2.3 nodes to be re-executed, achieving a local replanning success rate of 88.9%. This result demonstrates that this invention, by employing the replacement of the HTN subtree, the replacement of the HTN method rules, and the replacement of the HTN subtree access method for local replanning, eliminates the need to regenerate plans for all tasks. It can replace local anomaly paths while maintaining the same target effect, thereby reducing anomaly recovery costs.

[0077] In terms of final result quality, the consistency pass rate of the method of this invention reached 94.1%, and the human intervention rate decreased to 7.9%. This result shows that HTN node state backfilling, target effect condition verification, and historical task execution data feedback update can form a closed loop, enabling HTN method rule gating, agent binding, and subtree replacement selection in subsequent tasks to continuously obtain historical data support, thereby improving the stability and sustainable optimization capability of complex agent task orchestration.

[0078] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A knowledge-enhanced agent task orchestration method, characterized in that, Includes the following steps: S1. Obtain task request data, intelligent agent tool registration data, domain knowledge data, and historical task execution data, and parse them to obtain task objectives, task constraints, and task context; S2. Construct an HTN task knowledge graph based on domain knowledge data and historical task execution data, complete the task objectives, and obtain HTN task instance descriptions; S3. Input the HTN task instance description into the improved knowledge-enhanced HTN planning model, decompose the composite task nodes layer by layer, and obtain the HTN task hierarchical network. S4. Construct a capability profile of the agent based on the agent tool registration data and historical task execution data, bind atomic task nodes to the agent, and obtain a binding execution scheme. S5. Based on the HTN task hierarchy network and binding execution scheme, perform constraint compilation, conflict resolution and network writeback to obtain the agent task orchestration sequence; S6. Execute tasks according to the agent task orchestration sequence, and perform HTN subtree replacement replanning based on execution anomalies to obtain the updated task orchestration execution results.

2. The knowledge-enhanced agent task orchestration method according to claim 1, characterized in that, S2 includes the following steps: S21. Construct an HTN task knowledge graph that includes task type nodes, business object nodes, constraint rule nodes, target effect condition nodes, and HTN method rule nodes. S22. Align the task objects in the task objective with the business object nodes to obtain the task entity mapping result; S23. Retrieve associated nodes based on the task entity mapping results to obtain the HTN associated knowledge set used for task instantiation; S24. Based on the HTN associated knowledge set, complete the task slots, preconditions, and target effect conditions to obtain the HTN task instance description.

3. The knowledge-enhanced agent task orchestration method according to claim 2, characterized in that, S24 includes the following steps: S241. Based on the task entity mapping result and the task type node, convert the task target into a composite task node; S242. Generate task object slots, input data slots, output result slots, and execution constraint slots for composite task nodes; S243. Generate the HTN prerequisite condition set and the target effect condition set based on the constraint rule node and the target effect condition node; S244. Write each slot, the set of HTN prerequisite conditions, and the set of target effect conditions into the composite task node to obtain the HTN task instance description.

4. The knowledge-enhanced agent task orchestration method according to claim 1, characterized in that, S3 includes the following steps: S31. Take the composite task node in the HTN task instance description as the root node and obtain the candidate HTN method rule set. S32. Based on knowledge constraints, historical execution feedback and tool availability status, candidate HTN method rules are filtered to obtain a set of available HTN method rules; S33. Call the available HTN method rule set to decompose the root node and sub-task nodes layer by layer to obtain the atomic task node set; S34. Generate HTN task dependency edges based on parent-child relationships, preconditions, target effect conditions, and data flow relationships to obtain the HTN task hierarchy network.

5. The knowledge-enhanced agent task orchestration method according to claim 4, characterized in that, S32 includes the following steps: S321. Perform semantic gating based on task type, task object, and output result slot to obtain the first HTN method rule set; S322. Perform knowledge constraint gating based on the HTN precondition set to obtain the second HTN method rule set; S323. Based on the successful decomposition records, abnormal rollback records, and HTN subtree replacement records, feedback filtering is performed to obtain the third HTN method rule set. S324. Based on the tool's online status, field support, and the number of alternative tools, perform accessibility filtering to obtain a set of available HTN method rules.

6. The knowledge-enhanced agent task orchestration method according to claim 1, characterized in that, S4 includes the following steps: S41. Based on the tool function description, input and output parameters, field mapping template, calling permissions, and running status, obtain the static capability data of the intelligent agent; S42. Based on historical success rate, response latency, number of abnormal rollbacks, and records of achieving target effect conditions, obtain dynamic execution quality data of the agent; S43. Associate the static capability data and dynamic execution quality data of the intelligent agent to construct a capability profile of the intelligent agent; S44. Match the preconditions, input fields, output fields, and target effect conditions of the atomic task node with the agent's capability profile to obtain the binding execution plan.

7. The knowledge-enhanced agent task orchestration method according to claim 1, characterized in that, S5 includes the following steps: S51. Generate a set of task dependency constraints based on the parent-child decomposition edges, preceding dependency edges, data dependency edges, and resource dependency edges in the HTN task hierarchy network. S52. Perform constraint compilation on the atomic task nodes according to the task dependency constraint set to obtain the initial task execution sequence; S53. Perform parallel merging of atomic task nodes under the same composite task node that do not conflict with each other to obtain HTN parallel task group. S54. Conflict resolution and write-back are performed on the initial task execution sequence and HTN parallel task group to obtain the agent task orchestration sequence.

8. The knowledge-enhanced agent task orchestration method according to claim 7, characterized in that, S54 includes the following steps: S541. Identify resource usage conflicts, data read / write conflicts, permission call conflicts, agent call conflicts, and target effect condition conflicts to obtain a set of task conflicts; S542. Based on the parent-child task relationship, dependency depth, scope of influence of target effect conditions, and substitutability of agents, the conflict resolution order is obtained; S543. Perform delayed execution, alternative agent selection, field remapping, or task splitting according to the conflict resolution order to obtain the conflict correction result; S544. Write the conflict correction results back to the HTN task hierarchy network, update the task dependency edges and binding execution scheme, and obtain the agent task orchestration sequence.

9. The knowledge-enhanced agent task orchestration method according to claim 1, characterized in that, S6 includes the following steps: S61. Call the agents bound to the atomic task nodes according to the agent task orchestration sequence to obtain the atomic task execution results; S62. Backfill the execution results of the atomic tasks to the corresponding atomic task nodes, and update the node execution status and the status of meeting the target effect conditions. S63. Perform consistency verification based on the target effect conditions and HTN task dependencies to obtain the HTN execution verification result; S64. When the HTN execution verification result is abnormal, locate the abnormal atomic task node and related task node, and generate the HTN local replanning range. S65. Based on the local replanning range of HTN, perform HTN subtree rollback, alternative rule selection and subtree replacement to obtain the replanning HTN task hierarchy network; S66. Generate an updated task orchestration sequence based on the replanned HTN task hierarchy network, and write it into the historical task execution data to obtain the updated task orchestration execution result.

10. The knowledge-enhanced agent task orchestration method according to claim 9, characterized in that, S65 includes the following steps: S651. Determine the abnormal atomic task node, its sub-task node, and its composite task node according to the local replanning range of HTN to obtain the HTN subtree to be replaced. S652. Retrieve HTN method rules that have the same target effect conditions as the HTN subtree to be replaced, and obtain a set of candidate replacement rules; S653. Based on knowledge constraints, tool availability status, and historical subtree replacement records, candidate replacement rules are filtered to obtain the target replacement HTN method rules; S654. Call the target replacement HTN method rules to re-decompose the HTN subtree to be replaced and generate the replacement HTN subtree; S655. The replacement HTN subtree is connected to the original HTN task hierarchy network, and the HTN task dependency edges are updated to obtain the replanned HTN task hierarchy network.