An ai agent task processing method and system
Patent Information
- Application Number
- CN202611082401.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明针对现有AI代理任务处理方法将大语言模型作为任务直接执行者使用,令AI代理任务处理方法受到大语言模型自身的知识和能力限制,导致最终处理结果质量不稳定的问题,提供了一种AI代理任务处理方法及系统,通过对复合任务进行拆分并根据各子任务的数据流依赖构建有向无环依赖图,从而优化了任务执行顺序,实现了将杂乱的工具调用转变为标准化流水线执行,同时通过对子任务提取关键词,根据关键词匹配技能,摒弃了静态预装技能规则,从全局技能池择优选型,规避了多任务混搜带来的关键词干扰,提升了技能匹配精度,还通过透明门控审核打破了传统AI代理黑盒运行弊端,令任务方案可控可调,从而让复合任务完成质量在一定程度上稳定维持在一个较高的水准
所述执行模块基于有向无环依赖图中子任务的排列顺序依次执行各子任务的目标技能得到原始交付物;
Smart Images

Figure CN122594029A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and software engineering technology, specifically to an AI agent task processing method and system. Background Technology
[0002] With the rapid iteration of large language models, LLM-based AI agents have become an important technological direction for automating complex and composite tasks. Currently, mainstream AI agent tools mainly use LLM as the direct executor of tasks. This approach limits the AI agent tools to the knowledge and capabilities of the LLM itself, resulting in unstable quality of the final processing results. Existing AI invocation solutions are mainly divided into three categories: First, static tool library solutions, represented by Function Calling and LangChain tool frameworks, where tools are pre-registered and fixed, and adding new tools requires manual configuration, making it difficult to cover diverse long-tail needs; second, plug-in market models, such as the ChatGPT plug-in ecosystem, which have a larger tool resource volume, but rely on users to manually select and install them, and cannot automatically match and combine tools according to task requirements; third, multi-agent collaborative frameworks, typically including AutoGen and CrewAI, rely on multi-role agents to divide tasks, but the available tools for each agent are still in a pre-configured state.
[0003] Existing technologies generally suffer from the following shortcomings: First, tool selection is limited to a locally pre-installed skill list, making it impossible to dynamically search for the best skills from the global ecosystem; second, it is impossible to separate sub-tasks for independent retrieval tools, and the overall retrieval is prone to keyword interference and insufficient matching accuracy; third, the entire process of tool selection and execution is a black box, lacking a user pre-approval mechanism, and the dependencies between sub-tasks and the intermediate data transmission lack standardized control, resulting in significant fluctuations in the quality of complex task implementation. Therefore, there is an urgent need for an efficient AI proxy task processing solution.
[0004] Chinese Patent Publication No. CN119654629A discloses an AI task processing method and apparatus. The method includes: a first AI network element receiving an AI service request message sent by an AMF network element, wherein the AI service request message is used to indicate the AI service to be provided; determining at least one AI task based on the AI service request message; determining a first processing parameter of the first AI network element and a second processing parameter of the second AI network element; and determining a first task executed by the first AI network element and / or a second task executed by the second AI network element in the AI task based on the AI task, the first processing parameter, and the second processing parameter. However, it still only uses locally pre-installed tools or skills to perform the task, and the quality of the final processing result fluctuates greatly. Summary of the Invention
[0005] This invention addresses the problem in existing AI agent task processing methods that use large language models as direct task executors, leading to limitations imposed by the knowledge and capabilities of the large language models and resulting in unstable final processing quality. It provides an AI agent task processing method and system that optimizes task execution order by breaking down complex tasks and constructing a directed acyclic dependency graph based on the data flow dependencies of each sub-task. This transforms chaotic tool calls into standardized pipeline execution. Furthermore, by extracting keywords from sub-tasks and matching skills based on these keywords, it abandons static pre-installed skill rules and selects the best skills from a global skill pool, avoiding keyword interference from multi-task mixed searches and improving skill matching accuracy. Finally, it breaks through the drawbacks of traditional AI agent black-box operation through transparent gating review, making the task scheme controllable and adjustable, thus ensuring that the quality of complex task completion remains consistently at a high level.
[0006] In a first aspect, one technical solution provided in this embodiment of the invention is: an AI agent task processing method, comprising the following steps: S1. Obtain the composite task requirements and decompose them into a set of subtasks based on the requirement decomposition mechanism; construct the data flow dependency relationship between each subtask based on the data flow direction between each subtask in the subtask set. S2. Arrange the subtasks based on the data flow dependencies and transform the set of subtasks into a directed acyclic dependency graph; S3. Extract multi-dimensional keywords from all subtasks in the directed acyclic dependency graph, and match the corresponding candidate skills based on the extracted keywords; S4. Conduct transparent gating review of candidate skills, and filter the candidate skills based on the review results to obtain the target skills corresponding to each sub-task; S5. Based on the order of subtasks in the directed acyclic dependency graph, execute the target skills of each subtask in sequence to obtain the original deliverable, verify the original deliverable, and output the target deliverable based on the verification result.
[0007] In this solution, while ensuring that subtasks fully cover the original requirements, refined task decomposition is achieved by splitting composite tasks and sorting out the data flow dependencies of subtasks. By constructing a directed acyclic dependency graph and arranging the execution order based on topological sorting, the output of the preceding task is automatically used as the input of the subsequent task, thus transforming messy tool calls into standardized pipeline execution. By extracting keywords independently for each task and dynamically retrieving candidate skills from external interfaces, static pre-installed skill rules are abandoned, and the best skills are selected from the global skill pool, thereby avoiding keyword interference caused by multi-task mixed searches and improving skill matching accuracy. By adding a transparent gating review process, users review and select skills before execution, breaking the drawbacks of the black-box operation of traditional AI agents, thus making the task solution controllable and adjustable, and ensuring that the quality of the final task processing results is maintained at a relatively high level.
[0008] Preferably, in S1, the composite task requirements are obtained, and the composite task requirements are decomposed into a set of subtasks based on the requirement decomposition mechanism, including the following steps: Natural language text is extracted from composite task requests, and key elements and task types are extracted from the natural language text using a pre-defined large language model. The key elements include task domain, deliverable format, use case, and quality requirements. The task types include academic writing, software development, data analysis, and multimedia production. Determine the output type and required expertise for a composite task request based on key elements and task type; With the goal of ensuring that each professional capability is unique and its corresponding output is unique, the composite task request is decomposed into several sub-tasks, and the sub-tasks are then organized to obtain a set of sub-tasks.
[0009] In this solution, by extracting key elements and task types from the requirements text, the product specifications and required professional skills can be accurately identified, avoiding misunderstandings of the task. By limiting the splitting rules to match a single subtask with a unique professional skill and a single output product, the complex task is broken down into standardized atomic subtasks. At the same time, the principle of optimal task coverage ensures that the splitting is complete and without omissions. Furthermore, by sorting out the dependencies and relationships based on the subtask data flow, reliable data support is provided for the subsequent construction of a directed acyclic graph and chained execution. This can avoid the problem of mixed keywords in the overall search from the source, and also facilitate each subtask to independently conduct external skill searches, significantly improving the accuracy of subsequent skill matching.
[0010] Preferably, in S1, the data flow dependencies between subtasks are constructed based on the data flow direction between each subtask in the subtask set, including the following steps: Obtain the data flow direction between each subtask in the subtask set, determine which subtask's output is the input of another subtask in the data flow direction, and pair up the subtasks that meet the conditions to obtain task groups. The data flow direction between subtasks in the task group is used as the data flow dependency between each subtask.
[0011] In this solution, pairing subtasks based on their actual data flow direction accurately identifies the dependency logic between inputs and outputs, thus forming a standardized data flow dependency relationship. This provides a data foundation for building a directed acyclic dependency graph. Furthermore, this dependency enables subsequent topological sorting and chained execution, automatically using preceding outputs as inputs for subsequent tasks, thereby achieving automated data flow and significantly improving task processing efficiency. The clear dependency division also ensures that each subtask can independently perform skill retrieval, facilitating itemized quality verification. Combined with a local degradation mechanism, this effectively enhances the stability of task collaboration.
[0012] Preferably, in S2, the set of subtasks is transformed into a directed acyclic dependency graph by arranging the subtasks based on data flow dependencies, including the following steps: The subtasks are sequentially connected based on the data flow dependencies to obtain the original dependency chain. The composite task requirement coverage of the subtasks in the original dependency chain is calculated. If the coverage is greater than or equal to the coverage threshold, the set of subtasks is used as the graph node set, the subtasks are used as graph nodes, and the data flow dependencies are used as the edge set to construct a directed acyclic dependency graph. If the coverage is less than the coverage threshold, repeat step S1.
[0013] In this solution, an original dependency chain is built based on data flow dependencies, and a task coverage verification mechanism is introduced. If the coverage does not meet the standard, the task can be returned and re-decomposed, which can ensure that the sub-tasks can fully cover the original composite requirements from the source. After the standard is met, a directed acyclic dependency graph is constructed with sub-tasks as nodes and dependencies as edges, which provides a basis for subsequent orderly execution based on topology sorting. This realizes the automated flow of intermediate products, and can also support independent search skills for sub-tasks, itemized quality inspection and local degradation, thus optimizing the overall task scheduling logic.
[0014] As a preferred embodiment, in S3, multi-dimensional keyword extraction is performed on all subtasks in the directed acyclic dependency graph, and corresponding candidate skills are matched based on the extracted keywords, including the following steps: Multi-dimensional keyword extraction is performed on all subtasks, and the extracted keywords are associated with the corresponding subtasks; the multi-dimensional keywords include task output, task domain, file type, professional ability, and execution action; For each subtask, a relevance score is calculated from a preset external skill library based on the corresponding keywords. External skills with a relevance score greater than or equal to the threshold are selected as candidate skills.
[0015] This solution refines the search dimensions by extracting keywords from multiple dimensions such as task output and domain and binding them to corresponding subtasks, thereby effectively improving keyword accuracy. By independently accessing external skill libraries for each subtask, it breaks free from the constraints of pre-installed local tool libraries, effectively avoiding cross-subtask keyword interference. Quantitatively calculating skill relevance and filtering candidate skills based on thresholds, and relying on objective scores to select the best matching tool, eliminates subjective interference and breaks the dependence of existing AI agent systems on local tool libraries. This ensures that the system always searches for the optimal solution for the current task from the global skill ecosystem, rather than being limited to the "suboptimal matching" of existing local tools. Furthermore, the itemized search mode can be combined with a subsequent review mechanism, ensuring that only the failed subtask is held accountable when a single task fails to match, thus balancing skill optimization and overall task stability.
[0016] As a preferred option, if the relevance scores of keywords corresponding to subtasks obtained from skill relevance calculations using a preset external skill library are all less than the relevance score threshold, then the top n external skills with the highest relevance scores are selected as candidate skills.
[0017] In this solution, the downgraded selection mechanism allows for handling of various situations encountered by subtasks during skill matching, thereby preventing errors in the matching process. Not only can secondary skills be filtered through the aforementioned score downgrade, but the general capabilities of the large language model itself can also be used to execute the subtask, thus ensuring a high quality of task completion even in scenarios where some skills are missing.
[0018] As a preferred option, in S4, a transparent gating review is performed on the candidate skills, and the target skills corresponding to each sub-task are obtained based on the review results. This includes the following steps: The candidate list is obtained by summarizing the relationships between candidate skills and their corresponding subtasks in the form of a list. The contents of the candidate list include the name and task description of each subtask, the name and usage description of the candidate skill, the source link and installation command description of the candidate skill, the planned usage order of the candidate skills in the subtask, and the way the product of the subtask is passed to the subsequent subtasks. The candidate list is pushed to the initiator of the complex task requirement in a visual form. If the initiator agrees, the candidate skill is used as the target skill. If there are any modifications, the candidate skill selected by the initiator is used as the target skill. If the initiator refuses, the current process is terminated.
[0019] This solution comprehensively displays subtask information, skill parameters, installation methods, calling order, and product delivery rules by summarizing a structured candidate list, achieving full transparency of all skill solution elements. Furthermore, it provides users with pre-approval through visual push notifications, overcoming the drawbacks of traditional AI agent black-box selection. Users can confirm, adjust skills, or terminate tasks, gaining control over the process and achieving controllable human-machine collaboration. Ideally, target skills should be selected based on user confirmation results, eliminating unsuitable skills in advance and reducing anomalies during subsequent installation and execution. Overall, this mechanism not only builds upon the results of pre-selection of independent skills but also lays a solid foundation for subsequent chain-like orderly execution. Combined with later quality verification, it effectively improves the controllability of task execution and the quality of final delivery.
[0020] Preferably, in S5, the target skills of each subtask are executed sequentially based on the order of subtasks in the directed acyclic dependency graph to obtain the original deliverable, including the following steps: The initial subtask is selected based on the search of the directed acyclic dependency graph and the subtasks that have no preceding data flow dependencies. Subtasks that depend on the output data of the initial subtask are selected as secondary subtasks. An execution queue is constructed based on the data flow dependencies between the initial subtask and the secondary subtask. Use the secondary subtask as the initial subtask, and repeat the above process until there are no more secondary subtasks. Connect all execution queues in the search order to obtain a chained execution queue. The original deliverable is obtained by executing the target skills of each subtask in the order of the subtasks in the chained execution queue.
[0021] This solution utilizes a directed acyclic dependency graph to filter initial subtasks, iteratively generating a complete chained execution queue. It strictly adheres to the data flow dependency arrangement and execution order, automatically using the output of preceding subtasks as input for subsequent tasks, thus eliminating the chaos of random calls. Simultaneously, it leverages the target skills identified through prior decomposition, independent retrieval and filtering, and user review to ensure each stage uses the most suitable tools. A pipeline execution model facilitates the phased production of original deliverables. Subsequent quality verification steps, coupled with a single-task progressive degradation scheme, ensure that when individual subtasks exhibit mismatches, only the corresponding mismatched subtask is re-matched with the skill, while the remaining tasks continue to operate normally and professionally. This significantly improves the efficiency of multi-skill collaboration and the stability of task implementation.
[0022] Preferably, in S5, the original deliverable is verified, and the target deliverable is output based on the verification result, including the following steps: Local quality assessment is performed on the output of each subtask in the original deliverable to obtain the compliance rate of each subtask. Based on the compliance rate of the subtasks, the global completion rate of the composite task requirement is determined. If the global completion rate is greater than or equal to the completion threshold, the original deliverable is output as the target deliverable. If the overall completion rate is less than the completion threshold, then search for abnormal subtasks whose completion rates are less than the completion threshold, adjust the execution parameters of the abnormal subtasks, and repeat step S5.
[0023] In this solution, by conducting local quality assessments on each subtask and calculating the overall completion rate, the overall task completion status is accurately quantified. When the overall indicators fail to meet the standards, only the abnormal subtasks are located, and their parameters are adjusted and retried accordingly, without having to repeat the execution of all tasks, thus saving computing resources. This quality inspection logic follows the chain execution and independent skill selection mechanism mentioned earlier, and combined with the subtask-specific degradation scheme, it allows most links to still rely on professional skills to operate, effectively optimizing the quality of deliverables while controlling retry costs.
[0024] Secondly, one technical solution provided in this embodiment of the invention is: an AI agent task processing system, including an interaction module, a task decomposition module, a task conversion module, a skill matching module, an audit module, an execution module, and a verification module; The interaction module is used to obtain the requirements of the complex task. The task decomposition module decomposes the composite task requirements into a set of subtasks based on the requirement decomposition mechanism, and constructs the data flow dependency relationship between each subtask based on the data flow direction between each subtask in the subtask set. The task transformation module arranges each subtask based on data flow dependencies and transforms the set of subtasks into a directed acyclic dependency graph. The skill matching module performs multi-dimensional keyword extraction on all subtasks in the directed acyclic dependency graph and matches corresponding candidate skills based on the extracted keywords. The review module performs transparent gating review of candidate skills, and filters the candidate skills based on the review results to obtain the target skills corresponding to each sub-task; The execution module executes the target skills of each subtask sequentially based on the arrangement order of the subtasks in the directed acyclic dependency graph to obtain the original deliverable; The verification module verifies the original deliverables and outputs the target deliverables based on the verification results.
[0025] In this solution, a corresponding system is built to integrate the AI agent task processing method, thereby enabling human-computer interaction and improving the user experience.
[0026] The beneficial effects of the present invention are as follows: (1) The present invention optimizes the task execution order by splitting the composite task and constructing a directed acyclic dependency graph based on the data flow dependency of each sub-task, thereby realizing the transformation of messy tool calls into standardized pipeline execution. At the same time, by extracting keywords from sub-tasks and matching skills based on keywords, the static pre-installed skill rules are abandoned, and the best option is selected from the global skill pool, avoiding keyword interference caused by multi-task mixed search and improving the skill matching accuracy. Furthermore, the transparent gate control audit breaks the drawbacks of the traditional AI agent black box operation, making the task scheme controllable and adjustable, thereby allowing the quality of composite task completion to be maintained at a relatively high level to a certain extent. (2) This invention repositions the large language model from a traditional task executor to a skill scheduler, with the specific execution being handled by specialized skills discovered through dynamic search. This paradigm shift makes the system's capabilities not only unrestricted by the knowledge and capabilities of the large language model itself, but also continuously optimized through the continuous expansion of the skill ecosystem.
[0027] The above description of the invention is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0028] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings.
[0029] Figure 1 This is a flowchart of an AI agent task processing method according to the present invention; Figure 2 This is a schematic diagram of the execution flow of the chained execution queue of the present invention; Figure 3 This is a flowchart of the progressive degradation strategy in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of an AI agent task processing system according to the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only one preferred embodiment of this invention and are only used to explain this invention. They do not limit the scope of protection of this invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0031] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations (or steps) can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the figures; the process may correspond to a method, function, procedure, subroutine, subroutine, etc.
[0032] Example 1: To address the problem that existing AI agent task processing methods use large language models as direct task executors, which limits the quality of the final processing results due to the knowledge and capabilities of the large language models themselves, this example provides an AI agent task processing method, such as... Figure 1 As shown, it includes the following steps: S1: Obtain the composite task requirements and decompose them into a set of subtasks based on the requirement decomposition mechanism; construct the data flow dependency relationship between each subtask based on the data flow direction between each subtask in the subtask set.
[0033] In this embodiment, the composite task requirements are obtained, and the composite task requirements are decomposed into a set of subtasks based on the requirement decomposition mechanism, including the following steps: Natural language text is extracted from composite task requests, and key elements and task types are extracted from the natural language text using a pre-defined large language model. The key elements include task domain, deliverable format, use case, and quality requirements. The task types include academic writing, software development, data analysis, and multimedia production. Determine the output type and required expertise for a composite task request based on key elements and task type; With the goal of ensuring that each professional capability is unique and its corresponding output is unique, the composite task request is decomposed into several sub-tasks, and the sub-tasks are then organized to obtain a set of sub-tasks.
[0034] Specifically, a demand decomposition engine driven by a large language model serves as the execution entity, decomposing the complex task request T from the user's natural language input into n atomic subtasks. And organize these subtasks to obtain a subtask set. .
[0035] For example, if the composite task requirement is "Help me write an academic paper on AI and generate a PPT presentation," a large language model can be used to extract its key elements and task type. Among the extracted key elements, the deliverable format is an academic paper and a PPT presentation, and the task type is academic writing and multimedia production. Based on the extracted content, the composite task requirement can be broken down into subtasks. Literature review, Thesis writing and When creating a PowerPoint presentation, the resulting set of subtasks is... .
[0036] This embodiment extracts key elements and task types from the requirement text to accurately pinpoint product specifications and required professional skills, avoiding misunderstandings of the task. By limiting the splitting rules to match a single subtask with a unique professional skill and a single output product, the composite task is broken down into standardized atomic subtasks. At the same time, the principle of optimal task coverage ensures complete and omission-free splitting. Furthermore, the dependency relationships are sorted out based on the subtask data flow, providing reliable data support for the subsequent construction of a directed acyclic graph and chained execution. This avoids the problem of mixed keywords in the overall search from the source and facilitates independent external skill searches for each subtask, significantly improving the accuracy of subsequent skill matching.
[0037] In this embodiment, the data flow dependency relationship between each subtask is constructed based on the data flow direction between each subtask in the subtask set, including the following steps: Obtain the data flow direction between each subtask in the subtask set, determine which subtask's output is the input of another subtask in the data flow direction, and pair up the subtasks that meet the conditions to obtain task groups. The data flow direction between subtasks in the task group is used as the data flow dependency between each subtask.
[0038] Specifically, determine which subtask's output is the input of another subtask, designate the subtask used for output as the preceding subtask, and the subtask receiving the output of that subtask as the following subtask. Simultaneously, prevent circular dependencies and ensure that dependencies are directed acyclic. For example... Thesis writing depends on The results of the literature review, PPT creation depends on The results of the paper writing were then obtained by the task group. , The arrows in the task group indicate the data flow dependencies between the subtasks.
[0039] This embodiment accurately sorts out the dependency logic of input and output by pairing subtasks according to the actual data flow between them, thus forming a standardized data flow dependency relationship. This provides a data foundation for building a directed acyclic dependency graph. At the same time, based on this dependency, subsequent topological sorting chain execution can be realized, so that the previous product is automatically used as the input of the subsequent task, thereby realizing automated data flow and significantly improving task processing efficiency. Meanwhile, the clear dependency division ensures that each subtask can independently carry out skill retrieval, which is convenient for item-by-item quality verification. Combined with the local degradation mechanism, it can effectively improve the stability of task collaboration.
[0040] S2: Arrange the subtasks based on data flow dependencies and transform the set of subtasks into a directed acyclic dependency graph.
[0041] In this embodiment, the set of subtasks is transformed into a directed acyclic dependency graph by arranging the subtasks based on data flow dependencies, including the following steps: The subtasks are sequentially connected based on the data flow dependencies to obtain the original dependency chain. The composite task requirement coverage of the subtasks in the original dependency chain is calculated. If the coverage is greater than or equal to the coverage threshold, the set of subtasks is used as the graph node set, the subtasks are used as graph nodes, and the data flow dependencies are used as the edge set to construct a directed acyclic dependency graph. If the coverage is less than the coverage threshold, repeat step S1.
[0042] Specifically, when generating a set of subtasks, it is necessary to ensure that the generated subtasks can completely cover all task requirements in the composite task request. Therefore, it is necessary to calculate the coverage of the subtask set, and the formula is expressed as follows:
[0043] in It is a subtask Requirements coverage for the original composite task T It selects the set of subtasks that maximizes the total coverage. It is the optimal set of atomic subtasks after decomposing the composite task T. Based on the optimal set of subtasks, the original dependency chain is generated, and a directed acyclic dependency graph G(V, E) is constructed, where V is the set of graph nodes and E is the set of edges. Using the composite task request given above as an example, the resulting directed acyclic dependency graph G(V, E) is... , .
[0044] This embodiment builds the original dependency chain based on data flow dependencies and introduces a task coverage verification mechanism. If the coverage does not meet the standard, the task can be returned and re-decomposed, which can ensure that the sub-tasks can fully cover the original composite requirements from the source. After the standard is met, a directed acyclic dependency graph is constructed with sub-tasks as nodes and dependencies as edges, which provides a basis for subsequent orderly execution based on topology sorting. This realizes the automated flow of intermediate products and can also support independent search skills for sub-tasks, itemized quality inspection and local degradation, thus optimizing the overall task scheduling logic.
[0045] S3: Extract multi-dimensional keywords from all subtasks in the directed acyclic dependency graph, and match corresponding candidate skills based on the extracted keywords.
[0046] In this embodiment, multi-dimensional keyword extraction is performed on all subtasks in the directed acyclic dependency graph, and corresponding candidate skills are matched based on the extracted keywords, including the following steps: Multi-dimensional keyword extraction is performed on all subtasks, and the extracted keywords are associated with the corresponding subtasks; the multi-dimensional keywords include task output, task domain, file type, professional ability, and execution action; For each subtask, a relevance score is calculated from a preset external skill library based on the corresponding keywords. External skills with a relevance score greater than or equal to the threshold are selected as candidate skills.
[0047] Specifically, when generating keywords, in order to save computing power, different numbers of keywords can be generated based on the difficulty and importance of the sub-tasks. For example, one keyword is sufficient to describe a simple and clear sub-task, while 1-3 sets of differentiated keywords should be generated for some important or cross-domain sub-tasks. The formula for calculating the relevance score for simple and clear sub-tasks is as follows:
[0048] in The skills and sub-tasks corresponding to the keyword 'k' Relevance score, It is a semantic embedding function used to convert text into vectors. It is the cosine similarity function, used to calculate the degree of vector matching. It represents all candidate skills returned by the search.
[0049] For important or cross-domain subtasks, which have multiple sets of keywords, a relevance score is calculated by integrating the queries of multiple sets of keywords. The highest score of 1-3 sets of keywords is taken as the final skill relevance score. The formula is as follows: , in, Skills and sub-tasks corresponding to keyword k Relevance score, It is a subtask The generated keyword set, It is a single query term in the keyword set. This refers to taking the maximum score from multiple sets of keyword search results.
[0050] This embodiment refines the retrieval dimensions by extracting keywords from multiple dimensions such as task output and domain and binding them to corresponding sub-tasks, thereby effectively improving the accuracy of keywords. By independently accessing external skill libraries for each sub-task, it breaks free from the constraints of pre-installed local tool libraries and effectively avoids mutual interference between keywords across sub-tasks. By quantitatively calculating skill relevance and filtering candidate skills based on thresholds, it relies on objective scores to select the best matching tool, eliminating subjective interference and breaking the dependence of existing AI agent systems on local tool libraries. This ensures that the system always searches for the optimal solution for the current task from the global skill ecosystem, rather than being limited to the "suboptimal matching" of existing local tools. Furthermore, the itemized retrieval mode can be combined with a subsequent review mechanism, so that only the failed sub-task is held responsible when a single task fails to match, thus balancing skill optimization and overall task stability.
[0051] In this embodiment, if the relevance scores of keywords corresponding to a subtask obtained from skill relevance calculations using a preset external skill library are all lower than the relevance score threshold, then the top n external skills with the highest relevance scores are selected as candidate skills. Alternatively, the general capabilities of a large language model can be used. This strategy can be called a progressive degradation strategy or a degradation-based selection mechanism. The specific execution process is as follows: Figure 3 As shown. The degradation decision function of this progressive degradation strategy is expressed as follows:
[0052] This indicates that when a certain subtask s i If no candidate skill that meets the relevance threshold τ is found after multiple rounds of searching, the aforementioned gradual degradation strategy is triggered.
[0053] In this embodiment, an external discovery priority constraint is set during the process of obtaining candidate skills. This means that candidate skills only come from, and must come from, the results returned by an external skill search interface; skills pre-installed in the current system are not considered as candidate skill sources. Even if a skill already installed in the system functionally matches a subtask, that skill must appear in the candidate list of the corresponding subtask through the external skill search interface before it can be used. Furthermore, the candidate skill lists for different subtasks are independent of each other.
[0054] This embodiment uses a downgraded selection mechanism to handle various situations encountered by subtasks during skill matching, thereby preventing errors in the matching process. Not only can secondary skills be filtered through the aforementioned score downgrade, but the general capabilities of the large language model itself can also be used to execute the subtask, thus ensuring a high quality of task completion even in scenarios where some skills are missing.
[0055] S4: Conduct transparent gating review of candidate skills, and filter the candidate skills based on the review results to obtain the target skills corresponding to each sub-task.
[0056] In this embodiment, transparent gating review is performed on candidate skills, and the target skills corresponding to each sub-task are obtained by filtering the candidate skills based on the review results. This includes the following steps: The candidate list is obtained by summarizing the relationships between candidate skills and their corresponding subtasks in the form of a list. The contents of the candidate list include the name and task description of each subtask, the name and usage description of the candidate skill, the source link and installation command description of the candidate skill, the planned usage order of the candidate skills in the subtask, and the way the product of the subtask is passed to the subsequent subtasks. The candidate list is pushed to the initiator of the complex task requirement in a visual form. If the initiator agrees, the candidate skill is used as the target skill. If there are any modifications, the candidate skill selected by the initiator is used as the target skill. If the initiator refuses, the current process is terminated.
[0057] Specifically, before executing any candidate skills, each subtask is... i The corresponding candidate skill list C(s) i The complete output is provided to the user, including the skill name, usage description, installation command, and planned usage sequence. The gating and approval function is expressed as follows:
[0058] If the user agrees, output 1; if the user disagrees, output 0. Only when G(C) = 1 (user confirms) can the execution phase begin.
[0059] This embodiment comprehensively displays subtask information, skill parameters, installation methods, calling order, and product delivery rules by summarizing a structured candidate list, achieving full transparency of all elements of the skill solution. Furthermore, it provides users with pre-approval through visual push notifications, breaking away from the drawbacks of traditional AI agent black-box selection. Users can confirm, adjust skills, or terminate tasks, gaining control over the process and achieving controllable human-machine collaboration. Ideally, the selection of target skills based on user confirmation results can eliminate unsuitable skills in advance, thereby reducing anomalies in subsequent installation and execution phases. Overall, this mechanism not only builds upon the results of pre-emptive independent skill search but also lays a solid foundation for subsequent chain-like orderly execution. Combined with later quality verification, it effectively improves the controllability of task execution and the quality of final delivery.
[0060] S5: Based on the order of subtasks in the directed acyclic dependency graph, execute the target skills of each subtask in sequence to obtain the original deliverable, verify the original deliverable, and output the target deliverable based on the verification result.
[0061] In this embodiment, the target skills of each subtask are executed sequentially based on the arrangement order of subtasks in the directed acyclic dependency graph to obtain the original deliverable, including the following steps: The initial subtask is selected based on the search of the directed acyclic dependency graph and the subtasks that have no preceding data flow dependencies. Subtasks that depend on the output data of the initial subtask are selected as secondary subtasks. An execution queue is constructed based on the data flow dependencies between the initial subtask and the secondary subtask. Use the secondary subtask as the initial subtask, and repeat the above process until there are no more secondary subtasks. Connect all execution queues in the search order to obtain a chained execution queue. The original deliverable is obtained by executing the target skills of each subtask in the chained execution queue according to their order. The specific chained execution is as follows: Figure 2 As shown, each subtask executed along the way generates an intermediate product, which is the output of that subtask. The outputs of these subtasks are collected and organized to obtain the transfer intermediate product, which is used for subsequent subtask achievement evaluation and global completion evaluation.
[0062] Specifically, the constructor of the chained execution queue is represented by the following formula:
[0063] in This represents a chained execution queue. It is a topological sorting algorithm for directed acyclic graphs. It is a directed acyclic dependency graph of subtasks. To indicate a dependency relationship, i.e. rely The output.
[0064] This embodiment uses a directed acyclic dependency graph to filter initial subtasks, iteratively generates a complete chain execution queue, and strictly follows the data flow dependency arrangement to ensure execution order. This allows the output of preceding subtasks to automatically serve as input for subsequent tasks, thus eliminating the chaos of random calls. Simultaneously, execution is based on target skills identified through prior decomposition, independent retrieval and filtering, and user review, ensuring that each stage uses the most suitable tools. A pipeline execution model facilitates the phased production of original deliverables. Subsequent quality verification steps, combined with a single-task progressive degradation scheme, ensure that when individual subtasks mismatch, only the corresponding mismatched subtask is re-matched with skills, while the remaining tasks continue to operate normally and professionally. This significantly improves the efficiency of multi-skill collaboration and the stability of task implementation.
[0065] In this embodiment, the original deliverable is verified, and the target deliverable is output based on the verification result, including the following steps: Local quality assessment is performed on the output of each subtask in the original deliverable to obtain the compliance rate of each subtask. Based on the compliance rate of the subtasks, the global completion rate of the composite task requirement is determined. If the global completion rate is greater than or equal to the completion threshold, the original deliverable is output as the target deliverable. If the overall completion rate is less than the completion threshold, then search for abnormal subtasks whose completion rates are less than the completion threshold, adjust the execution parameters of the abnormal subtasks, and repeat step S5.
[0066] Specifically, the output of each subtask is expressed by the following formula:
[0067] in, Subtasks The output, It is a subtask The execution function of the corresponding skill. It is a subtask Custom input parameters, It is a subtask The complete set of all preceding dependent subtasks, It is a pre-dependent subtask The output.
[0068] The formula for calculating global completion is as follows:
[0069] in, This represents the global completion degree of the composite task T. It is a subtask The weighting coefficients are determined based on the subtasks. Importance settings It's an indicator function that outputs 1 when the condition is true and 0 when the condition is false. It is the output of the subtask. The degree of compliance It is the threshold for subtask output quality to meet the standard.
[0070] This embodiment accurately quantifies the overall task completion status by conducting local quality assessments on each subtask and calculating the global completion rate. When the global indicators fail to meet the standards, only the abnormal subtasks are identified, and their parameters are adjusted and retried accordingly, without having to repeat the execution of all tasks, thus saving computing resources. This quality inspection logic inherits the chain execution and independent skill selection mechanism mentioned above, combined with a separate degradation scheme for subtasks, allowing most links to still rely on professional skills to operate, effectively optimizing the quality of deliverables while controlling retry costs.
[0071] To further illustrate the technical solution in this embodiment, this embodiment takes the typical composite task of "helping me write an academic paper on AI and generate a PPT presentation" as an example to explain the complete workflow of the present invention in detail: Step 1, Requirement Decomposition: The user inputs a composite task request T = "helping me write an academic paper on AI and generate a PPT presentation". The requirement decomposition engine 100 analyzes the request and identifies the following three atomic sub-tasks: s1: Academic Literature Research – Searching for and organizing relevant academic literature in the field of AI; S2: Paper Writing – Writing a complete academic paper based on literature review results; s3: PPT creation - Creating presentations based on the content of academic papers.
[0072] The dependencies are as follows: s2 depends on the output of s1 (list of references and abstracts), and s3 depends on the output of s2 (full text of the paper). In the generated directed acyclic dependency graph G(V, E), V = {s1, s2, s3}, and E = {(s1, s2), (s2, s3)}.
[0073] Step 2, Sub-task Skill Discovery: For subtask s1, generate search keywords Q(s1) = {"academic paper search", "literaturereview tool"}, call the external skill search interface, and obtain the candidate skill list C(s1) = {literature-search, academic-researcher}.
[0074] For subtask s2, generate search keywords Q(s2) = {"academic paper writing", "researchpaper generator"}, call the external skill search interface, and obtain the candidate skill list C(s2) = {academic-paper-assistant, research-paper-writer}.
[0075] For subtask s3, generate search keywords Q(s3) = {"pptx generation", "presentationmaker"}, call the external skill search interface, and obtain the candidate skill list C(s3) = {pptx-generator,slides}.
[0076] Note that even if some skills may be pre-installed in the system, it is still necessary to obtain a candidate list through an external skill search interface to ensure that the globally optimal tool is found.
[0077] Step 3, Transparent Gated Approval: Summarize the candidate skill lists for the above three sub-tasks and output them to the user, in the following format: Subtask 1: Academic Literature Survey 1) Literature search — Purpose: To search academic literature and compile citation lists. 2) Academic Researcher — Purpose: To assist in academic research, including literature reviews. Subtask 2: Paper Writing 1) Academic paper assistant — Uses: writing, revising, and polishing academic papers. Subtask 3: PPT Creation 1) pptx-generator — Purpose: Generate presentations After user approval, G(C) = 1, and the execution phase begins.
[0078] Step 4, Skill Installation: Execute the installation command one by one according to the candidate list or confirm that it has been installed.
[0079] Step 5, Dependency-driven chain execution: The topological sorting result is s1 -> s2 -> s3.
[0080] First, execute s1 (literature research), outputting O(s1) = {literature list, key abstracts, citation information}; then execute s2 (paper writing), inputting p2 and O(s1), outputting O(s2) = {complete paper.docx}; finally, execute s3 (PPT creation), inputting p3 and O(s2), outputting O(s3) = {presentation.pptx}.
[0081] Step 6, Quality Check: Evaluate the quality of the output of each subtask and calculate the global completion rate Φ(T). If all subtasks meet the quality standards, summarize and deliver the final result.
[0082] Example 2: This example also provides an AI agent task processing system, such as... Figure 4 As shown, it includes an interaction module, a task decomposition module, a task conversion module, a skill matching module, an approval module, an execution module, and a verification module; The interaction module is used to obtain the requirements of the complex task. The task decomposition module decomposes the composite task requirements into a set of subtasks based on the requirement decomposition mechanism, and constructs the data flow dependency relationship between each subtask based on the data flow direction between each subtask in the subtask set. The task transformation module arranges each subtask based on data flow dependencies and transforms the set of subtasks into a directed acyclic dependency graph. The skill matching module performs multi-dimensional keyword extraction on all subtasks in the directed acyclic dependency graph and matches corresponding candidate skills based on the extracted keywords. The review module performs transparent gating review of candidate skills, and filters the candidate skills based on the review results to obtain the target skills corresponding to each sub-task; The execution module executes the target skills of each subtask sequentially based on the arrangement order of the subtasks in the directed acyclic dependency graph to obtain the original deliverable; The verification module verifies the original deliverables and outputs the target deliverables based on the verification results.
[0083] This embodiment implements the AI agent task processing method in this solution by constructing a corresponding system, thereby realizing human-computer interaction and improving the user experience.
[0084] As can be seen from the above embodiments, it has at least the following substantial effects: (1) This invention repositions the large language model from a traditional task executor to a skill scheduler, with the specific execution being handled by specialized skills discovered through dynamic search. This paradigm shift makes the system's capabilities not only unrestricted by the knowledge and capabilities of the large language model itself, but also continuously optimized through the continuous expansion of the skill ecosystem. (2) Under the premise of ensuring that the sub-tasks fully cover the original requirements, this invention achieves refined task decomposition by splitting the composite task and sorting out the data flow dependencies of the sub-tasks; (3) By constructing a directed acyclic dependency graph and relying on topological sorting to arrange the execution order, this invention realizes that the output of the preceding order is automatically used as the input of the subsequent task, thereby transforming the messy tool calls into standardized pipeline execution; (4) This invention extracts keywords independently in a single task and dynamically retrieves candidate skills from an external interface, abandoning the static pre-installed skill rules and selecting the best from the global skill pool, thereby avoiding keyword interference caused by multi-task mixed search and improving skill matching accuracy. (5) By adding a transparent gate control review process, the present invention allows users to review and screen skills before execution, breaking the drawbacks of the traditional black box operation of AI agents, thereby realizing that the task plan is controllable and adjustable, and the quality of the final task processing result is maintained at a relatively high level to a certain extent.
[0085] The specific embodiments described above are preferred embodiments of the present invention and are not intended to limit the specific scope of the present invention. The scope of the present invention includes, but is not limited to, these specific embodiments. All equivalent changes made in accordance with the shape and structure of the present invention are within the protection scope of the present invention.
Claims
1. A method for processing AI agent tasks, characterized in that: Includes the following steps: S1. Obtain the composite task requirements and decompose the composite task requirements into a set of subtasks based on the requirement decomposition mechanism. The data flow dependencies between subtasks are constructed based on the data flow direction between subtasks in the subtask set. S2. Arrange the subtasks based on the data flow dependencies and transform the set of subtasks into a directed acyclic dependency graph; S3. Extract multi-dimensional keywords from all subtasks in the directed acyclic dependency graph, and match the corresponding candidate skills based on the extracted keywords; S4. Conduct transparent gating review of candidate skills, and filter the candidate skills based on the review results to obtain the target skills corresponding to each sub-task; S5. Based on the order of subtasks in the directed acyclic dependency graph, execute the target skills of each subtask in sequence to obtain the original deliverable, verify the original deliverable, and output the target deliverable based on the verification result.
2. The AI agent task processing method according to claim 1, characterized in that: In S1, the composite task requirements are obtained, and the composite task requirements are decomposed into a set of subtasks based on the requirement decomposition mechanism, including the following steps: Natural language text is extracted from composite task requests, and key elements and task types are extracted from the natural language text using a pre-defined large language model. The key elements include task domain, deliverable format, use case, and quality requirements. The task types include academic writing, software development, data analysis, and multimedia production. Determine the output type and required expertise for a composite task request based on key elements and task type; With the goal of ensuring that each professional capability is unique and its corresponding output is unique, the composite task request is decomposed into several sub-tasks, and the sub-tasks are then organized to obtain a set of sub-tasks.
3. The AI agent task processing method according to claim 1, characterized in that: In S1, the data flow dependencies between subtasks are constructed based on the data flow direction between each subtask in the subtask set, including the following steps: Obtain the data flow direction between each subtask in the subtask set, determine which subtask's output is the input of another subtask in the data flow direction, and pair up the subtasks that meet the conditions to obtain task groups. The data flow direction between subtasks in the task group is used as the data flow dependency between each subtask.
4. The AI agent task processing method according to claim 3, characterized in that: In S2, the subtasks are arranged based on data flow dependencies, transforming the set of subtasks into a directed acyclic dependency graph, including the following steps: The subtasks are sequentially connected based on the data flow dependencies to obtain the original dependency chain. The composite task requirement coverage of the subtasks in the original dependency chain is calculated. If the coverage is greater than or equal to the coverage threshold, the set of subtasks is used as the graph node set, the subtasks are used as graph nodes, and the data flow dependencies are used as the edge set to construct a directed acyclic dependency graph. If the coverage is less than the coverage threshold, repeat step S1.
5. The AI agent task processing method according to claim 1, characterized in that: In S3, multi-dimensional keyword extraction is performed on all subtasks in the directed acyclic dependency graph, and corresponding candidate skills are matched based on the extracted keywords, including the following steps: Multi-dimensional keyword extraction is performed on all subtasks, and the extracted keywords are associated with the corresponding subtasks; the multi-dimensional keywords include task output, task domain, file type, professional ability, and execution action; For each subtask, a relevance score is calculated from a preset external skill library based on the corresponding keywords. External skills with a relevance score greater than or equal to the threshold are selected as candidate skills.
6. The AI agent task processing method according to claim 5, characterized in that: If the relevance scores of keywords corresponding to a subtask obtained from the preset external skill library are all less than the relevance score threshold, then the top n external skills with the highest relevance scores are selected as candidate skills.
7. The AI agent task processing method according to claim 1, characterized in that: In S4, candidate skills undergo transparent gating review. Based on the review results, the candidate skills are filtered to obtain the target skills corresponding to each subtask. This includes the following steps: The candidate list is obtained by summarizing the relationships between candidate skills and their corresponding subtasks in the form of a list. The contents of the candidate list include the name and task description of each subtask, the name and usage description of the candidate skill, the source link and installation command description of the candidate skill, the planned usage order of the candidate skills in the subtask, and the way the product of the subtask is passed to the subsequent subtasks. The candidate list is pushed to the initiator of the complex task requirement in a visual form. If the initiator agrees, the candidate skill is used as the target skill. If there are any modifications, the candidate skill selected by the initiator is used as the target skill. If the initiator refuses, the current process is terminated.
8. The AI agent task processing method according to claim 1, characterized in that: In S5, the target skills of each subtask are executed sequentially based on the order of subtasks in the directed acyclic dependency graph to obtain the original deliverable, including the following steps: The initial subtask is selected based on the search of the directed acyclic dependency graph and the subtasks that have no preceding data flow dependencies. Subtasks that depend on the output data of the initial subtask are selected as secondary subtasks. An execution queue is constructed based on the data flow dependencies between the initial subtask and the secondary subtask. Use the secondary subtask as the initial subtask, and repeat the above process until there are no more secondary subtasks. Connect all execution queues in the search order to obtain a chained execution queue. The original deliverable is obtained by executing the target skills of each subtask in the order of the subtasks in the chained execution queue.
9. The AI agent task processing method according to claim 8, characterized in that: In S5, the original deliverables are validated, and the target deliverables are output based on the validation results, including the following steps: Local quality assessment is performed on the output of each subtask in the original deliverable to obtain the compliance rate of each subtask. Based on the compliance rate of the subtasks, the global completion rate of the composite task requirement is determined. If the global completion rate is greater than or equal to the completion threshold, the original deliverable is output as the target deliverable. If the overall completion rate is less than the completion threshold, then search for abnormal subtasks whose completion rates are less than the completion threshold, adjust the execution parameters of the abnormal subtasks, and repeat step S5.
10. An AI agent task processing system, applicable to the AI agent task processing method according to any one of claims 1-9, characterized in that: It includes an interaction module, a task decomposition module, a task conversion module, a skill matching module, an approval module, an execution module, and a verification module; The interaction module is used to obtain the requirements of the complex task. The task decomposition module decomposes the composite task requirements into a set of subtasks based on the requirement decomposition mechanism, and constructs the data flow dependency relationship between each subtask based on the data flow direction between each subtask in the subtask set. The task transformation module arranges each subtask based on data flow dependencies and transforms the set of subtasks into a directed acyclic dependency graph. The skill matching module performs multi-dimensional keyword extraction on all subtasks in the directed acyclic dependency graph and matches corresponding candidate skills based on the extracted keywords. The review module performs transparent gating review of candidate skills, and filters the candidate skills based on the review results to obtain the target skills corresponding to each sub-task; The execution module executes the target skills of each subtask sequentially based on the arrangement order of the subtasks in the directed acyclic dependency graph to obtain the original deliverable; The verification module verifies the original deliverables and outputs the target deliverables based on the verification results.
Citation Information
Patent Citations
Artificial intelligence (AI) task processing method and device
CN119654629A