Task template generation method and system combining knowledge retrieval enhancement and Agent workflow

By combining knowledge retrieval enhancement and Agent workflow, intelligent and autonomous arrangement of task templates is achieved, and the effectiveness of existing task planning systems in dynamic task environments is solved, and the agile adaptability and system interoperability capabilities of task planning are improved.

CN120218036APending Publication Date: 2025-06-2710TH RES INST OF CETC
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510295290.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The existing task planning system faces response hysteresis, insufficient generalization capabilities and low cross-domain synergy efficiency in dynamic task environments, and the inability to achieve effective compatibility between different systems.

Method used

Combining knowledge retrieval enhancement and Agent workflow, through optimizing search lexicon and Agent workflow methods, we realize intelligent and autonomous arrangement of task templates, and improve the agile adaptability, interpretability and system interoperability capabilities of task planning.

Benefits of technology

It improves the agile adaptability and system interoperability capabilities of task planning, enhances the accuracy and interpretability of task template generation, and reduces the data preparation and training overhead for fine-tuning of large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120218036A_ABST
    Figure CN120218036A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of task planning, and particularly discloses a task template generation method and system combining knowledge retrieval enhancement and Agent workflow, and the method specifically comprises the following steps: S1, constructing a task template and a priori knowledge text; s2, processing the prior knowledge text to obtain text blocks, vectorizing the text blocks, and storing the vectorized text blocks; s3, analyzing and processing the natural language text to generate a retrieval context with better matching correlation; s4, taking the natural language text and the retrieval context as input texts, decomposing the input texts, generating a result code of the task template arrangement text, and analyzing the result code to obtain a final result code of the task template arrangement text; and S5, analyzing a result code of the task template arrangement text, and performing legal judgment. According to the invention, the intelligent autonomous arrangement of the task template is realized, and the agility adaptive capability, the interpretable capability and the system interoperation capability of task planning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of task planning, and more specifically, to a method and system for generating task templates that combines knowledge retrieval enhancement and Agent workflows. Background Art

[0002] In modern military work environments, with the increasing complexity and diversity of work tasks and the continuous improvement of informatization and intelligence levels, how to efficiently, accurately, and flexibly arrange work tasks has become one of the key issues in improving work efficiency and the quality of command and decision-making.

[0003] Currently, there are still many problems in the field of task planning, specifically manifested as:

[0004] 1) Traditional work task arrangement methods often face limitations such as fixed processes, difficulty in adapting to dynamic changes, and low collaborative efficiency among various links;

[0005] 2) The current paradigms of task planning systems mainly rely on static template construction mechanisms driven by human experience and limited reuse strategies of pre-built knowledge bases, which face response delays, insufficient generalization capabilities, and low cross-domain collaborative efficiency in dynamic task environments;

[0006] 3) The degree of intelligence in task planning is limited, relying on the experience of planners, which increases the workload of planners in emergency situations;

[0007] 4) Effective compatibility cannot be achieved between different task planning systems.

[0008] In recent years, artificial intelligence technology has demonstrated strong potential and application value in many fields. With the rapid development of domestic open-source inference foundation large models such as DeepSeek-R1, it is possible to achieve the Chain of Thought (COT) mode at low cost and high performance, greatly reducing the low-cost deployment threshold of large models for privatization, and being able to possess efficient text generation capabilities, which can effectively promote the autonomous intelligence process of the operating mechanism in the field of task planning technology; for specific business fields, based on the basic large language model, through fine-tuning training, it can output text information required by the business field more accurately. However, the fine-tuning of large models often requires the construction of a large number of high-quality training samples and involves relatively large training computing power costs. Moreover, when the template structure or generation logic changes, it is difficult for the fine-tuned large model to quickly adapt to this change. Summary of the Invention

[0009] The technical problem to be solved by the present invention is to provide a task template generation method and system that combines knowledge retrieval enhancement and Agent workflow. The present invention constructs a task template orchestration application operation mechanism, and through optimizing retrieval term techniques and Agent workflow methods, realizes the intelligent and autonomous orchestration of task templates, improving the agile adaptability, interpretability, and system interoperability of task planning;

[0010] The solution adopted by the present invention to solve the technical problem is as follows:

[0011] A task template generation method that combines knowledge retrieval enhancement and Agent workflow specifically includes the following steps:

[0012] Step S1: Construct task templates and prior knowledge texts;

[0013] Step S2: Perform preprocessing and chunking operations on the prior knowledge text to obtain text chunks, vectorize the text chunks, obtain vectorized text segments, and store them;

[0014] Step S3: Construct a retrieval term optimization Agent based on a large language model, analyze and process the natural language text input by the user through the retrieval term optimization Agent to obtain effective retrieval terms, and generate a retrieval context with better matching relevance by querying the vectorized text segments;

[0015] Step S4: Apply the RAG Agent workflow framework, use the natural language text and retrieval context as input texts, decompose them into a task text decomposition list, template information decomposition, and subtask logical relationship, generate the result code of the task template orchestration text through retrieval processing, and perform parsing to screen and obtain the final result code of the task template orchestration text;

[0016] Step S5: Parse and perform legal determination on the result code of the task template orchestration text; if it is illegal, return to Step S3 until it is legal.

[0017] In some possible implementation manners, the task module includes a task template identifier for uniquely determining a task, a task type for clarifying the nature and objective of the task, a time window for specifying the execution time range of the task, and multiple task links;

[0018] Each group of the task links includes multiple subtasks and a task logic gate relationship expression block;

[0019] The subtasks include a subtask information block, a state transition condition block for defining the conditions required for subtask state transition, a constraint condition block for specifying the constraint conditions to be met during subtask execution, a termination condition block for defining the conditions for abnormal termination of the subtask, a rollback condition block for describing the conditions for subtask rollback in a specific situation, a success condition block for defining the satisfaction conditions for subtask success, a subsequent task list block for listing the subsequent tasks to be executed after the subtask is completed, and a preorder task list block for listing the prerequisite subtasks to be completed before the subtask is executed.

[0020] In some possible implementation manners, step S2 specifically includes the following steps:

[0021] Step S21: Preprocess and chunk the prior knowledge text, and divide it into text chunks;

[0022] Step S22: Convert the processed text chunks into vector representations through an Embedding model, obtain the vectorized text fragments, and store the text fragments in a vector database.

[0023] In some possible implementation manners, step S3 specifically includes the following steps:

[0024] Step S31: Construct a retrieval term optimization Agent based on a large language model;

[0025] Step S32: Apply the retrieval term optimization Agent to use the natural language text input by the user as a query, optimize and generate retrieval terms, analyze and process the natural language text, and obtain effective retrieval terms;

[0026] Step S33: Perform context relevance matching retrieval in the vector database through the effective retrieval terms, search for context information highly relevant to the input natural language text, and find the retrieval context that matches the TopN of the retrieval terms by calculating the similarity between vectors.

[0027] In some possible implementation manners, step S4 specifically includes the following steps:

[0028] Step S41: Apply the RAG Agent workflow framework to decompose and classify the retrieval context and the natural language text, and obtain a task text decomposition list, a template information decomposition list, and a subtask logical relationship decomposition list;

[0029] Step S42: Traverse the task text decomposition list, use the task text decomposition list as input to replace the natural language text input by the user, repeat steps S32 - S33, match the context associated with the subtask description, process it together with the subtask description text, and generate a subtask template;

[0030] Step S43: Integrate the output subtask templates to obtain the subtask generation text;

[0031] Step S44: Combine the subtask generation text, the template information decomposition list, the subtask logical relationship list, and the retrieval context to output the task template arrangement text result;

[0032] Step S45: Screen the code part in the task template arrangement text result through regular matching to obtain the result code of the final task template arrangement text.

[0033] In some possible implementation manners, the specific content of the said Step S5 is as follows:

[0034] Parse the result code of the task template arrangement text through a task module parser;

[0035] Perform a legality determination on the parsing result through a task module legality discriminator;

[0036] If it is illegal, return to Step S3 until it is legal;

[0037] If it is legal, perform task status-driven execution monitoring by a task status inference engine;

[0038] Respond to the task drive instruction through an execution mechanism.

[0039] A system for a task template generation method combining knowledge retrieval enhancement and Agent workflow as described above, including a task module arrangement prior knowledge vectorization unit for preprocessing, chunking, vectorizing, and storing prior knowledge text, a task template arrangement knowledge retrieval unit for finding the retrieval context that matches the retrieval term TopN, a task template arrangement working unit for screening to obtain the result code of the final task template arrangement text and based on the RAG Agent workflow framework, and a task module loading and inference monitoring unit for parsing and performing legality determination on the result code of the task template arrangement text. The task template arrangement knowledge retrieval unit is a retrieval term optimization Agent based on a large language model.

[0040] In some possible implementation manners, the task module arrangement prior knowledge vectorization unit includes a preprocessing module, a text chunking module, a chunk vectorization unit, and a vector database connected in sequence;

[0041] The preprocessing module is used to perform preprocessing on the prior knowledge text;

[0042] The text chunking module is used to perform chunking processing on the preprocessed prior knowledge text to obtain text chunks;

[0043] The chunk vectorization unit is used to vectorize the text chunks, and the vectorized text fragments;

[0044] The vector database is used to store the vectorized text fragments.

[0045] In some possible implementation manners, the task template orchestration work unit includes a task text decomposition Agent component, a sub-task template iterative generation component, a sub-task template integration component, a task template orchestration Agent component, and a post-processing component;

[0046] The task text decomposition Agent component is used to decompose and classify the retrieval context and natural language text, and obtain a task text decomposition list, a template information decomposition list, and a sub-task logical relationship decomposition list;

[0047] The sub-task template iterative generation component is used to perform task template orchestration knowledge retrieval on the obtained multiple task text decomposition lists, and generate multiple sub-task templates;

[0048] The sub-task template integration component is used to integrate multiple sub-task templates;

[0049] The task template orchestration Agent component is used to generate a task template orchestration text result;

[0050] The post-processing component is used to screen the code part in the task template orchestration text result through regular matching to obtain the result code of the final task template orchestration text.

[0051] In some possible implementation manners, the sub-task template iterative generation component includes a task template orchestration knowledge retrieval module and a sub-task template generation Agent component; the task template orchestration knowledge retrieval module is the same as the task template orchestration knowledge retrieval unit.

[0052] Compared with the prior art, the beneficial effects of the present invention are:

[0053] The present invention constructs a task template orchestration application operation mechanism, and through optimizing the retrieval enhancement generation technology of retrieval terms and the Agent workflow method, realizes the intelligent and autonomous orchestration of task templates, and improves the agile adaptability, interpretability, and system interoperability of task planning;

[0054] The present invention forms task template generation rules and specifications, and can autonomously and automatically complete task driving through a task template parser and an inference engine;

[0055] The present invention is based on the RAG method optimized by retrieval terms, and effectively improves the relevance and accuracy of retrieval results;

[0056] The present invention is based on the RAG Agent workflow framework method, which divides and conquers complex problems, iteratively generates task templates, and improves the accuracy of task template generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 is a flowchart of the present invention;

[0058] Figure 2 is a structural diagram of the task template of the present invention;

[0059] Figure 3 is a flowchart of the operation of step S2 of the present invention;

[0060] Figure 4 is a flowchart of the operation of step S3 of the present invention;

[0061] Figure 5 is a flowchart of the operation of step S4 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0062] In the present invention, unless otherwise clearly defined and limited, terms such as "installation", "connection", "connection", "fixation" and other terms should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can be directly connected, or indirectly connected through an intermediate medium, and can be the communication inside two components or the interaction relationship between two components. The "one" or "a" and other similar words mentioned in this application do not represent a quantity limitation, but represent that there is at least one. In the implementation of this application, "and / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In the description of the embodiments of this application, unless otherwise stated, the meaning of "a plurality" refers to two or more. For example, a plurality of positioning posts refers to two or more positioning posts. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.

[0063] The present invention will be described in detail below.

[0064] On the one hand:

[0065] As Figures 1-5 shown:

[0066] A system for a task template generation method combining knowledge retrieval enhancement and Agent workflow as described above includes a task module arrangement a priori knowledge vectorization unit, a task template arrangement knowledge retrieval unit, a task template arrangement work unit, and a task module loading and inference monitoring unit.

[0067] The prior knowledge vectorization unit of the task module arrangement preprocesses and chunks the prior knowledge text to obtain text chunks, vectorizes the text chunks, obtains the vectorized text fragments and stores them;

[0068] The knowledge retrieval unit of the task template arrangement applies a large language model and the RAG Agent workflow framework to analyze and process the input information to obtain effective retrieval terms, and generates a retrieval context with better matching relevance by querying the vectorized text fragments;

[0069] The task template arrangement work unit takes the natural language text and the retrieval context as input texts, decomposes them into a task text decomposition list, template information decomposition, and subtask logical relationships, generates the result code of the task template arrangement text through retrieval processing and parses it, and filters to obtain the final result code of the task template arrangement text;

[0070] The task module loading and inference monitoring unit parses and legally determines the result code of the task template arrangement text.

[0071] The RAG (Retrieval Augmented Generation) Agent workflow framework, as a new emerging intelligent agent architecture that combines knowledge retrieval enhancement and the Agent workflow for task template generation methods and systems, provides new ideas and methods for solving the problem of work task template arrangement. This framework can make full use of existing work knowledge and data resources, and through intelligent retrieval and generation mechanisms, achieve dynamic combination and optimal matching of various elements of work tasks. It can reduce the overhead brought by the dataset preparation and training process for large model fine-tuning, bring more flexible and adaptable vertical application efficiency of the basic large model, break the shackles of traditional arrangement modes, improve the adaptability, flexibility, and scientific nature of work task templates, and thus better assist military commanders in work planning and decision-making.

[0072] In some possible implementation manners, the prior knowledge vectorization unit of the task module arrangement includes a preprocessing module, a text chunking module, a chunk vectorization unit, and a vector database connected in sequence;

[0073] The preprocessing module is used to perform preprocessing on the prior knowledge text;

[0074] The text chunking module is used to chunk the preprocessed prior knowledge text to obtain text chunks;

[0075] The chunk vectorization unit is used to vectorize the text chunks into vectorized text fragments;

[0076] The vector database is used to store the vectorized text fragments.

[0077] In some possible embodiments, the task template orchestration work unit includes a task text decomposition Agent component, a sub-task template iterative generation component, a sub-task template integration component, a task template orchestration Agent component, and a post-processing component;

[0078] The task text decomposition Agent component is used to decompose and classify the retrieval context and natural language text, obtaining a task text decomposition list, a template information decomposition list, and a sub-task logical relationship decomposition list;

[0079] The sub-task template iterative generation component is used to perform task template orchestration knowledge retrieval on the obtained multiple task text decomposition lists, generating multiple sub-task templates;

[0080] The sub-task template integration component is used to integrate multiple sub-task templates;

[0081] The task template orchestration Agent component is used to generate a task template orchestration text result;

[0082] The post-processing component is used to screen the code part in the task template orchestration text result through regular matching to obtain the result code of the final task template orchestration text.

[0083] In some possible embodiments, the sub-task template iterative generation component includes a task template orchestration knowledge retrieval module and a sub-task template generation Agent component; the task template orchestration knowledge retrieval module is the same as the task template orchestration knowledge retrieval unit, both being a retrieval term optimization Agent based on a large language model;

[0084] The task template orchestration knowledge retrieval module is used to perform task template orchestration knowledge retrieval on the obtained multiple task text decomposition lists;

[0085] The sub-task template generation Agent component generates multiple sub-task templates according to the retrieval results of the task template orchestration knowledge retrieval module.

[0086] Specifically, the retrieval term optimization Agent in the present invention is a large language model based on Qwen2.5:7B (Q4), with a temperature value of 0.65 and a maximum token number of 20000;

[0087] The task text decomposition Agent component is based on the Qwen2.5:14B (Q4) model, with a temperature value of 0.7 and a maximum token number of 30000;

[0088] The sub-task template generation Agent component is based on the Deepseek-R1:14B (Q4) model, with a temperature value of 0.7 and a maximum token number of 20000;

[0089] The task template orchestration Agent component is based on the Deepseek - R1:14B model, with a temperature value of 0.7 and a maximum number of tokens of 60000;

[0090] The Embedding model selects the nomic - embed - text model.

[0091] Furthermore, the task module loading and inference monitoring unit includes a task module parser for parsing the task template, a task module legality discriminator for making a legal determination of the parsing result, and a task status inference engine for driving and monitoring the execution based on the task status;

[0092] Specifically, the task template parser parses the generated task template into a sub - task sequence memory structure;

[0093] The task status inference engine autonomously drives and interacts with the execution mechanism for monitoring according to the condition satisfaction of the sub - tasks.

[0094] The task template legality discriminator makes a legality judgment on the task template memory structure to ensure the correctness of the task template.

[0095] If the generated task template is illegal, it is returned to the task template orchestration algorithm for optimization through the illegal task template feedback mechanism.

[0096] On the other hand:

[0097] A task template generation method combining knowledge retrieval enhancement and Agent workflow matches the natural language text input by the user with relevant knowledge in the vector database formed by the prior knowledge text to generate a task orchestration large - model workflow, and finally outputs a task template; the generated task template is parsed into a sub - task sequence memory structure by the task template parser; specifically includes the following steps:

[0098] Step S1: Construct the task template and prior knowledge text;

[0099] First, define the basic structure of the task template and the application process of the task template. During the work process, a top - level work task needs to be decomposed into a series of work sub - tasks. The task template is the carrier of the sub - task decomposition result. The design of the task template should be able to meet the basic elements such as timing, constraints, state transition conditions, and task logical relationships required for various task orchestrations, and ensure that the task orchestration result can be parsed by the task parser and driven for execution by the task status inference engine.

[0100] Specifically, the task module includes a task template identifier for uniquely determining a task, a task type for clarifying the nature and objectives of the task, a time window for specifying the execution time range of the task, and multiple task links; among them, the task template identifier, task type, and task type are the top-level structures of the task module;

[0101] Each group of the task links includes multiple subtasks and a task logic gate relationship expression block;

[0102] The subtask includes a subtask information block containing the name, specific identifier, and time block information of the subtask, a state transition condition block for defining the conditions required for the state transition of the subtask, a constraint condition block for clarifying the constraint conditions that need to be satisfied during the execution of the subtask, a termination condition block for specifying the conditions for abnormal termination of the subtask, a rollback condition block for describing the conditions for the subtask to roll back under specific circumstances, a success condition block for defining the satisfaction conditions for the success of the subtask, a subsequent task list block for listing the subsequent tasks that need to be executed after the subtask is completed, and a precedence task list block for listing the preceding subtasks that need to be completed before the subtask is executed;

[0103] The task logic gate relationship expression block is expressed through a logic gate abstract syntax tree (AST), which is used to describe the AND-OR logic relationships such as simultaneous completion and any completion between task links to meet the diversity of task orchestration; through this structured design, the task template can clearly express complex combat tasks and provide strong support for the planning and execution of tasks.

[0104] Step S2: Preprocess and block the prior knowledge text to obtain text blocks for easy management and retrieval; perform vectorization processing on the text blocks, obtain the vectorized text fragments and store them, providing a data basis for subsequent retrieval operations.

[0105] The specific steps of step S2 are as follows:

[0106] Step S21: Preprocess the prior knowledge text through a preprocessing module, and perform block processing on the preprocessed prior knowledge text through a text block module to divide it into text blocks;

[0107] When preprocessing the prior knowledge text, specifically, preprocess the text format, remove the placeholders in the text, adjust the paragraphs, etc.;

[0108] When performing block processing on the prior knowledge text, specifically, cut the input prior knowledge text into blocks to better extract the context information;

[0109] Step S22: Convert the processed text blocks into vector representations through the Embedding model in the block vectorization unit, obtain the vectorized text fragments, and store the text fragments in the vector database.

[0110] Step S3: The task template orchestration knowledge retrieval unit applies the retrieval term optimization Agent to analyze and process the natural language text input by the user, obtains effective retrieval terms, and thus effectively improves the accuracy and relevance of the retrieval; by querying the vectorized text fragments, generates a retrieval context with better matching relevance; provides reference and basis for the generation of task templates. The specific steps of the said Step S3 include the following steps:

[0111] Step S31: Construct a retrieval term optimization Agent based on a large language model;

[0112] Step S32: Apply the retrieval term optimization Agent, use the natural language text input by the user as a query, optimize and generate retrieval terms, analyze and process the natural language text, and obtain effective retrieval terms;

[0113] Step S33: Perform context relevance matching retrieval in the vector database through the effective retrieval terms, find the context information highly relevant to the natural language text input by the user, and find the retrieval context that matches the TopN of the retrieval terms by calculating the similarity between vectors; feedback the retrieved relevant context to the subsequent task template orchestration workflow unit, and provide reference and basis for the generation of task templates.

[0114] Through Step S2 and Step S3 in the present invention, it is possible to effectively address the problem of retrieval result deviation caused by fuzzy, complex or information - missing user queries in traditional retrieval methods. By using a large model to generate more accurate and semantically expressive retrieval terms before retrieval, the relevance and accuracy of retrieval results can be effectively improved.

[0115] Step S4: Divide the complex task description into parts such as subtask description, template description, and subtask logical relationship description, and generate the template Json code step by step and block by block, and finally perform integration processing; specifically:

[0116] Apply the RAG Agent workflow framework, use the natural language text and the retrieval context as input texts, decompose them into a task text decomposition list, template information decomposition, and subtask logical relationship, generate the result code of the task template orchestration text through retrieval processing and parse it, and obtain the final result code of the task template orchestration text by screening through regular matching;

[0117] The specific steps of the said Step S4 include the following steps:

[0118] Step S41: Apply the RAG Agent workflow framework, input the retrieval context and natural language text into the task text decomposition Agent component. Through the large language model in the task text decomposition Agent component, decompose and classify the retrieval context and natural language text to obtain a task text decomposition list, a template information decomposition list, and a subtask logical relationship decomposition list. Each list item in the task text decomposition list is the description text of a certain subtask.

[0119] Step S42: Traverse the task text decomposition list, use the task text decomposition list as the input to replace the natural language text input by the user, apply the task template arrangement knowledge retrieval module to match the context associated with the subtask description, and input it together with the subtask description text into the subtask template generation Agent component. This component generates a subtask template through a large language model.

[0120] That is, use the task text decomposition list as a query, optimize and generate retrieval terms, analyze and process the task text decomposition list to obtain effective retrieval terms.

[0121] Perform context relevance matching retrieval in the vector database through the effective retrieval terms, find the context information highly relevant to the task text decomposition list, calculate the similarity between vectors, match the context associated with the subtask description, and input it together with the subtask description text into the subtask template generation Agent component. This component generates a subtask template through a large language model.

[0122] Step S43: The subtask template integration component integrates the output subtask templates to obtain the subtask generation text.

[0123] Step S44: Combine the subtask generation text, the template information decomposition list, the subtask logical relationship list, and the retrieval context, and output the task template arrangement text result through a large language model.

[0124] Step S45: The task template arrangement Agent component filters the code part in the task template arrangement text result through regular matching to obtain the final result code of the task template arrangement text.

[0125] Step S5: Parse and perform legal judgment on the result code of the task template arrangement text. If it is illegal, return to Step S3 until it is legal.

[0126] The specific content of Step S5 is as follows:

[0127] Parse the result code of the task template arrangement text through the task module parser.

[0128] Perform legal judgment on the parsing result through the task module legality discriminator.

[0129] If it is illegal, return to step S3 until it is legal;

[0130] If it is legal, the task status inference engine performs task status-driven execution monitoring;

[0131] The actuator responds to the task-driven instruction.

[0132] The present invention is not limited to the foregoing specific embodiments. The present invention extends to any new feature or any new combination disclosed in this specification, as well as any new combination of steps of any new method or process disclosed.

Claims

1. A task template generation method combining knowledge retrieval enhancement and agent workflow, characterized in that: The specific steps include: Step S1: construct task template and prior knowledge text; Step S2: preprocessing and dividing the prior knowledge text into blocks to obtain text blocks, vectorizing the text blocks, obtaining vectorized text segments and storing them; Step S3: construct a search term optimization agent based on a large language model, and use the search term optimization agent to analyze and process the natural language text input by the user to obtain effective search terms, and generate a search context with better matching relevance by querying the vectorized text fragments; Step S4: Apply the RAG Agent workflow framework, take the natural language text and the search context as input text, decompose it into a task text decomposition list, template information decomposition and subtask logical relationship, generate the result code of the task template arrangement text through search processing and parse it, and screen to obtain the final result code of the task template arrangement text; Step S5: parsing and legitimacy determination of the result code of the task template arrangement text; If it is illegal, return to step S3 until it is legal.

2. According to claim 1, a task template generation method combining knowledge retrieval enhancement and agent workflow is characterized in that: The task module includes a task template identifier for uniquely identifying the task, a task type that specifies the nature and target of the task, a time window that specifies the execution time range of the task, and multiple task links; Each group of task links includes multiple subtasks and a task logic gate relationship expression block; The subtask includes a subtask information block, a state transfer condition block for defining the conditions required for the state transfer of the subtask, a constraint condition block that clarifies the constraint conditions that need to be met during the execution of the subtask, a termination condition block that stipulates the conditions for abnormal termination of the subtask, a rollback condition block that describes the conditions for rolling back the subtask under certain circumstances, a success condition block that defines the conditions that must be met for the success of the subtask, a subsequent task list block that lists the subsequent tasks that need to be executed after the subtask is completed, and a predecessor task list block that lists the list of predecessor subtasks that need to be completed before the subtask is executed.

3. The method for generating a task template combining knowledge retrieval enhancement and agent workflow according to claim 1, characterized in that: The step S2 specifically includes the following steps: Step S21: pre-processing and block processing the prior knowledge text into text blocks; Step S22: Convert the processed text blocks into vector representations through the Embedding model, obtain vectorized text fragments, and store the text fragments in the vector database.

4. The method for generating a task template combining knowledge retrieval enhancement and agent workflow according to claim 1, characterized in that: The step S3 specifically comprises the following steps: Step S31: constructing a search term optimization Agent; Step S32: taking the natural language text input by the user as a query, optimizing and generating search terms, analyzing and processing the natural language text, and obtaining effective search terms; Step S33: Perform context relevance matching search in the vector database through effective search terms to find context information with high relevance to the input natural language text, and find the search context matching the search term TopN by calculating the similarity between vectors.

5. The method for generating a task template combining knowledge retrieval enhancement and agent workflow according to claim 4, characterized in that: The step S4 specifically comprises the following steps: Step S41: Apply the RAG Agent workflow framework to decompose and classify the search context and natural language text, and obtain a task text decomposition list, a template information decomposition list, and a subtask logical relationship decomposition list; Step S42: traverse the task text decomposition list, use the task text decomposition list as input instead of the natural language text input by the user, repeat steps S32-S33, match the context associated with the subtask description, process it together with the subtask description text, and generate a subtask template; Step S43: Integrate the output subtask templates to obtain subtask generation text; Step S44: combining the subtask generation text, the template information decomposition list, the subtask logical relationship list, and the search context, and outputting the task template arrangement text result; Step S45: Screen the code part in the task template arrangement text result by regular matching to obtain the final result code of the task template arrangement text.

6. The method for generating task templates combining knowledge retrieval enhancement and agent workflow according to claim 1, characterized in that: The step S5 specifically refers to: The result code of the task template arrangement text is parsed by the task module parser; The legitimacy of the parsing results is determined by the legitimacy discriminator of the task module; If it is illegal, return to step S3 until it is legal; If it is legal, the task state inference engine will perform task state driven execution monitoring; Respond to task-driven instructions through actuators.

7. A system for generating task templates combining knowledge retrieval enhancement and agent workflow according to any one of claims 1 to 6, characterized in that: It includes a task module arrangement prior knowledge vectorization unit for preprocessing, segmenting, vectorizing and storing prior knowledge text, a task template arrangement knowledge retrieval unit for finding the search context that matches the TopN search terms, a task template arrangement working unit for screening the result code of the final task template arrangement text, and a task module loading and reasoning monitoring unit for parsing and legality judgment of the result code of the task template arrangement text.

8. The system for generating task templates combining knowledge retrieval enhancement and agent workflow according to claim 7, characterized in that: The task module arranges the prior knowledge vectorization unit including a preprocessing module, a text segmentation module, a segmentation vectorization unit, and a vector database connected in sequence; The preprocessing module is used to perform preprocessing on the prior knowledge text; The text segmentation module is used to segment the preprocessed prior knowledge text into blocks to obtain text segments; The block vectorization unit is used to vectorize the text blocks to obtain vectorized text segments; The vector database is used to store vectorized text segments.

9. A system for generating task templates combining knowledge retrieval enhancement and agent workflow according to claim 8, characterized in that: The task template arrangement work unit includes a task text decomposition Agent component, a subtask template iteration generation component, a subtask template integration component, a task template arrangement Agent component, and a post-processing component; The task text decomposition Agent component is used to decompose and classify the search context and natural language text, and obtain a task text decomposition list, a template information decomposition list and a subtask logical relationship decomposition list; The subtask template iteration generation component is used to perform task template arrangement knowledge retrieval on the obtained multiple task text decomposition lists to generate multiple subtask templates; The subtask template integration component is used to integrate multiple subtask templates; The task template arrangement Agent component is used to generate a task template arrangement text result; The post-processing component is used to filter the code part in the task template arrangement text result by regular matching to obtain the final result code of the task template arrangement text.

10. A system for generating task templates combining knowledge retrieval enhancement and agent workflow according to claim 9, characterized in that: The sub-task template iterative generation component includes a task template arrangement knowledge retrieval module and a sub-task template generation Agent component; the task template arrangement knowledge retrieval module is the same as the task template arrangement knowledge retrieval unit.

Citation Information

Cited By

  • Visual form generation method based on FastGPT knowledge base, medium and equipment

    CN120994788A

  • Intelligent workflow arrangement method and system based on natural language generation

    CN122152390A