Multi-agent based large model workflow automatic generation method

By employing a multi-agent collaboration approach, the divergence and randomness issues in the generation of large-scale model workflows in multi-agent systems are resolved, achieving efficient and stable workflow generation, shortening the development cycle, and improving generation quality.

CN122331879APending Publication Date: 2026-07-03曾星航
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
曾星航
Filing Date
2026-04-07
Publication Date
2026-07-03

Smart Images

  • Figure CN122331879A_ABST
    Figure CN122331879A_ABST
Patent Text Reader

Abstract

This invention discloses an automatic generation method for large-scale model workflows based on multi-agent technology, relating to the fields of artificial intelligence software and multi-agent technology. This method employs a multi-agent collaborative architecture to achieve fully automated generation from a user's initial idea for an automated workflow to a deployable workflow package. The generation method includes: the agent analyzing the user's natural language requirement description to generate a workflow architecture design; the agent generating parameters for each node of the workflow based on the architecture design; the agent calling a pre-written configuration code generation function and generating workflow configuration code in conjunction with the node parameters; the agent performing security review and format verification on the configuration code; and packaging it into a deployable workflow package. This invention achieves a high degree of engineering and structuring in the development of large-scale model workflows, significantly shortening the traditional manual development cycle and significantly improving the efficiency and quality of workflow development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence software and multi-agent systems, and specifically to a method for automatically generating large model workflows based on multi-agent systems. Background Technology

[0002] With the development of artificial intelligence technology, agent systems are rapidly evolving, becoming the cornerstone of fields such as intelligent question answering, autonomous driving, intelligent manufacturing, autonomous logistics, water conservancy, and high-precision instruments. These systems aim to improve efficiency, safety, and convenience, but as AI systems are expected to independently undertake more challenging tasks, their increasing complexity poses significant challenges to engineering design.

[0003] In practice, single large models perform poorly in complex tasks due to limitations in context length. With the development of AI, task processing models are gradually evolving from "single-model dialogue" to "multi-agent systems". If we consider large models as "all-rounders", then individual sub-agents in a multi-agent system are "specialty leaders" assigned tasks. This "teamwork and divide-and-conquer" architecture is currently the core for solving complex tasks.

[0004] For multi-agent systems, significant divergence and randomness remain. To ensure they strictly adhere to pre-defined rules for completing assigned tasks, a large-scale model workflow can be used to implement the subagent pattern. Large-scale model workflows are highly engineered and structured, and can be developed and used on various low-code platforms (COZE, DIFY, N8N, etc.), but they have the following technical characteristics:

[0005] The business structure is complex: the large model workflow consists of many nodes such as start, end, output, large model, intent recognition, knowledge base, and database. Data flow and branch activation conditions need to be manually defined.

[0006] Strict technical specifications are enforced: Some low-code platforms have workflow configuration file export functionality. However, attempting to modify and upload these files to other devices often results in import errors. Technical specifications for large-model workflow configuration files include, but are not limited to: ① Parameter specifications: Workflow naming conventions (letters + underscores + numbers), and the use of quotation marks for some parameters (quotation marks within the content must be escaped). ② File naming conventions: File names within the workflow folder must be consistent. ③ Configuration code indentation: Strict adherence to YAML, JSON, XML, and other formatting standards is required.

[0007] Long development cycle: Under the traditional manual development model, developing a simple after-sales customer service workflow for an e-commerce platform requires a single developer to invest 2-3 working days, including: requirements analysis: 1 day; initial framework construction: 0.5 hours; writing large model node system and user prompt words: 1 day; knowledge base and database construction: 1-2 days; testing and fixing: 1 day.

[0008] While methods exist for generating workflows based on high-performance single models (such as Gork 4.2 and Gemini 3.1 Pro) and referencing existing workflow configuration code examples, these methods can only change the prompt parameters of the larger model. They suffer from issues such as inability to expand the workflow structure, frequent errors in data connections between nodes, and a high error rate in data flow parameters within the workflow. Using a single model requires it to simultaneously perform tasks such as requirements analysis, architecture design, code writing, and security review, placing an excessive burden on it and making it impossible to achieve a professional level at each stage, thus compromising quality.

[0009] While some low-code platforms (such as COZE) have launched automatic generation functions, they are limited to the automatic generation of single agents involving a single large model. Their core is to generate simple prompts, and the generated agents are still highly random. They can only use the same model to deal with various situations and do not have the ability to generate large model workflows involving multiple models. Summary of the Invention

[0010] In view of this, the present invention provides an automatic generation method for large model workflows based on multi-agent systems, in order to eliminate or improve one or more defects existing in the prior art and improve the development efficiency and quality of large model workflows.

[0011] One aspect of the present invention provides a method for automatically generating large model workflows based on multi-agent systems. The method includes the following steps: S1: Receiving a natural language description of a large model workflow from a user. The user description may contain unprofessional terminology, unclear intent, or ambiguous requirements. The agent analyzes the request according to pre-defined system prompts (hereinafter referred to as the work manual) to obtain a professional corresponding workflow architecture design, including the number of branches, relative positions of branches, functions of each branch, and branch points; S2: Receiving the architecture design obtained in the previous step, the agent obtains the parameters of each node in the workflow based on the professional architecture design according to the pre-defined work manual. These workflow node parameters are pre-defined to guide the next step of the agent's execution; S3: The agent, according to the pre-defined work manual, calls a pre-designed workflow configuration code generation function based on the workflow node parameters to generate configuration code; S4: The agent performs a security review of the workflow configuration code according to the pre-defined work manual to ensure that the configuration code structure conforms to relevant standards and specifications; S5: Generating a configuration file, determining the file name and file structure, and encapsulating it into a deployable workflow package according to a pre-written file operation procedure.

[0012] In some embodiments of the present invention, the custom parameters of the intelligent agent include: large model model, work manual, user prompt words, skills, plugins, runtime limit, input data, knowledge base / database, output information format, and large model fine-tuning parameters such as Top-P and generation randomness.

[0013] In some embodiments of the present invention, the intelligent agents used for automatic generation of large model workflows are at least four, including: architect intelligent agent, planner intelligent agent, configuration engineer intelligent agent, and security reviewer intelligent agent.

[0014] In some embodiments of the present invention, the configuration engineer agent used in step S3 may employ multiple large models in parallel to meet more complex generation tasks.

[0015] Compared to existing technologies, the multi-agent-based large-model workflow automatic generation method proposed in this invention can highly engineer and structure multiple agents to divide the development process, forming a generation pipeline from architecture → planning parameters → configuration code → security review → encapsulation. This achieves fully automated generation from a user's initial automated workflow idea to a deployable workflow package. Furthermore, it utilizes a directed graph-based workflow orchestration method to manage agent execution paths, ensuring a highly structured and engineered process. This enables efficient collaboration among multiple agents, ensuring stable workflow generation quality and excellent performance. In terms of time, this invention also significantly reduces the traditional two-day manual development cycle to approximately six minutes of automated workflow, allowing developers to focus more on subsequent fine-tuning. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings: Figure 1 This is a flowchart illustrating the multi-agent collaboration process of an automatic large model workflow generation method according to an embodiment of the present invention. Each box represents an agent node, and the direction of the lines indicates the data flow and the direction of the large model workflow generation process. The attached diagram within the boxes shows partial output segments from each node in an embodiment of the present invention. Detailed Implementation

[0017] To overcome the problems existing in the prior art, this application proposes an automatic generation method for large model workflows based on multi-agent systems. Figure 1 This is a flowchart of a multi-agent collaboration method for automatically generating large model workflows in one embodiment of the present invention. The method includes the following steps: The agent is the core of the node, and the large model is its driving unit, responsible for executing specific tasks. The custom parameters of the agent include multiple categories, such as the large model model, manual, user prompts, skills, plugins, runtime limit, input data, knowledge base / database, output information format, and fine-tuning parameters of the large model such as Top-P and generation randomness.

[0018] The present invention specifies a format template for the workbook in the custom parameters of the intelligent agent. The structured nature of the workbook ensures the stability of the large model workflow generation method and avoids failure due to minor errors. The workbook format template is as follows: # Role The agent's role text ##Skill ###Skill 1 Specific task execution process of intelligent agents ...... ###Skill 2 Specific task execution process of intelligent agents ...... ###Skill 3 Specific task execution process of intelligent agents ...... ##limit There are red lines that intelligent agents need to pay special attention to, such as not needing to provide textual explanations for their results, only outputting code, and strictly adhering to the skill settings and performing actions in sequence.

[0019] Step S1: Receive user requests for large model workflow generation. The architect agent generates a professional large model workflow architecture design as required, based on a customizable and expandable / modifiable work manual. Optionally, the above-mentioned work manual text can include multiple types, such as agent role settings, workflow / responsibility settings, agent constraints, agent instructions, and output large model workflow architecture design format, or other types, to meet the needs of automatic generation of large model workflows in different scenarios. In one embodiment of the present invention, the workflow architecture design format is designed as follows: Workflow Name: Bifurcation point: Number of branches: Branch structure and function: Branch 1 name: Relative position: Function: Object-oriented: Branch 2 name: ...... ......

[0020] Step S2: Receive the large model workflow architecture design described in S1. The planner agent generates the parameters of each node of the large model workflow according to the agent's custom parameters. Optionally, the structure of the above node parameters is preset by the developer and can be customized / modified as needed to meet the automatic generation of large model workflows in different formats. In one embodiment of the present invention, the instructions for generating node connection parameters in the planner agent's manual are as follows: Generate a node_link: This contains the connection relationships of all nodes (including large models and message groups), with branching relationships (branch points are intent recognition nodes). It describes the connection relationships between each node and its predecessor nodes, and also needs to specifically annotate intent recognition nodes and unrelated task paths. Note: Generally, a single route follows this pattern: Start --- Intent --- Overall Model --- Message --- End template: 100001---100002 (Intent Recognition)---100003---800001---90001 100001---100002 (Intent Recognition)---100004---800002---90001 100001---100002 (Intent Recognition, Irrelevant Tasks)---100005---800003---90001 In one embodiment of the present invention, an example of the start and intent identification node parameters is as follows: start_node = {"x":0,"y":0} intent_node = {"x":600, "y":0, "id":100002, "system_prompt": '''If the user's inquiry involves vehicle recommendations, parameter comparisons, inventory checks, price discounts, or test ride appointments, the intent is 'pre-sales consultation'; if it involves order status, logistics progress, payment methods, invoice issuance, or delivery time, the intent is 'order and logistics consultation'; if it involves return / exchange applications, warranty policies, fault reporting, parts purchase, or complaints / suggestions, the intent is 'after-sales and repair consultation'; otherwise, it is 'irrelevant topic''', "intent_list":["Pre-sales consultation","Order and logistics consultation","After-sales and repair consultation"], "input_nodes":[{"path":"input","id":100001}] }

[0021] Step S3: Receive the large model workflow node parameters mentioned in S2, configure the engineer agent to call the pre-written workflow configuration code generation function, and generate the large model workflow configuration code according to the requirements of the work manual based on the node parameters. Optionally, the workflow configuration code generation function mentioned above is defined by the developer. In one embodiment of the present invention, it is YAML. It can be customized and extended / modified according to actual requirements. The format of the generated large model workflow configuration code can be modified to meet the automatic generation of large model workflows of different formats. The configuration engineer agent invokes a pre-written function through Function Calling, passing the required parameters to the function. These parameters come from the parameters of the large model workflow nodes, and the returned workflow configuration code is obtained. In one embodiment of the present invention, the fragment of the workflow configuration code generation function called by the configuration engineer agent is as follows: def create_start_node(self, x="-97", y="0", id="100001"): start_node = f''' - id: "{id}" type: start title: Start icon: image address Description: "The workflow's starting node, used to set the information required to initiate the workflow." position: x: {x} y: {y} parameters: node_outputs: input: type: string value: null return start_node In one embodiment of the present invention, the example of the large model workflow configuration file generated by the configuration engineer agent (here, the code for the connection relationship between nodes is selected) is as follows: edges: - source_node: "100001" target_node: "100002" - source_node: "100002" target_node: "100003" source_port: branch_0 - source_node: "100002" target_node: "100004" source_port: branch_1 - source_node: "100002" target_node: "100005" source_port: branch_2 - source_node: "100003" target_node: "100006"

[0022] Step S4: Receive the large model workflow configuration code described in S3. The security reviewer agent performs security review and verification on the large model workflow configuration code according to the set security review work manual, and outputs the verified and repaired large model workflow configuration code. Optionally, the above security review manual can be customized by the developer and can be extended / modified according to actual requirements to meet different security review requirements. One embodiment of the present invention designs the following working manual for the security reviewer intelligent agent: # Role You are a meticulous workflow configuration expert who must strictly adhere to the given workflow YAML code structure rules, validate the received YAML code, correct any errors, and then return the results in YAML format. ## Rules between nodes ### No blank line is needed between nodes Example: ...... There is no need for a blank line between the nodes module and the edges module (the nodes module and the edges module are at the same level). Example: ...... ## Hierarchical Indentation Rules ### Indentation uses 2 spaces. ### - indicates that the following are list elements, not text. Elements at the same level should maintain left alignment for text. ## limit ### Verification shall be conducted strictly in accordance with regulations ### Only output the YAML code; no other output is required. Only the formatting needs to be corrected; the content itself does not need to be changed.

[0023] Step S5: According to the preset file operation procedure, this invention can be written in any programming language to encapsulate the workflow, receive the large model workflow configuration code described in S4, and use file operation functions to complete code writing, file generation, file name and file structure determination, and compression into a compressed package. Optionally, the programming language of the above-mentioned preset file operation program can be customized by the developer to meet different development environments. The folder structure described above is as follows, where the `name` parameter must match the value of the `name` parameter in `MANIFEST.yml`. |------workflow | | | |---{name}-draft.yaml | |------MANIFEST.yml

[0024] The proposed method for automatically generating large-scale workflows based on multiple agents enables highly engineered and structured collaboration among multiple agents to divide the development process, forming a generation pipeline from architecture → planning parameters → configuration code → security review → encapsulation. This achieves fully automated generation from a user's initial idea for an automated workflow to a deployable workflow package. Furthermore, a directed graph-based workflow orchestration method is used to manage the execution paths of agents, thereby enabling efficient collaboration among multiple agents and ensuring stable workflow generation quality and excellent performance.

[0025] In some embodiments of the present invention, the custom parameters of the intelligent agent include: large model model, work manual, user prompt words, skills, plugins, runtime limit, input data, knowledge base / database, output information format, and large model fine-tuning parameters such as Top-P and generation randomness.

[0026] In some embodiments of the present invention, the method further includes dynamically selecting a suitable large model type based on the task type of the agent. Agents handling complex tasks (architecture design, planning node parameters, configuration code generation) select a first type of large model, while agents handling simple tasks (security review) select a second type of large model. The first type of large model is a high-inference-capability large model, including but not limited to: GLM-4.7, Doubao 2.0 Pro, Deepseek V3.2, and Qwen 3. The second type of large model is a high-inference-speed large model, including but not limited to: Doubao 1.6 lite and Doubao 1.5.

[0027] Figure 1 This is a flowchart of the process of the present invention, which will be combined with Figure 1 A more detailed description of one embodiment of the present invention will be provided below. Example 1: The agent component is deployed on a low-code platform and encapsulated as a service accessible via API, but this does not constitute a limitation.

[0028] Step S100: Receive a natural language request from a user regarding their ideas for a large model workflow – such as a customer service representative from a bicycle online store – and send it to the API.

[0029] Step S101: The architect agent derives the large-scale model workflow architecture design according to the work manual and passes it to the next agent. Workflow Name: Intelligent Customer Service System for Bicycle Online Stores Branching point: User intent recognition node (based on semantic analysis and keyword extraction of user inquiry content) Number of branches: 3 Branch structure and function: Top Branch: Pre-sales Consulting Assistant Relative position: Top (core business entry point, high priority) Features: Provides intelligent vehicle recommendations, detailed parameter comparisons, inventory checks, price and discount consultations, and offline test ride appointment services. Target audience: Potential car buyers Middle Branch: Order and Logistics Assistant Relative position: Middle (for transaction process support) Functions: Handling order status inquiries, logistics progress tracking, payment method inquiries, invoice issuance, and delivery time confirmation. Target audience: Customers who have already placed an order Below branch: After-sales and Repair Assistant Relative position: Below (Customer Relationship Maintenance) Functions: Processing return and exchange applications, interpreting warranty policies, scheduling fault repairs, purchasing spare parts, and collecting complaints and suggestions. Target audience: Existing car owners or those seeking after-sales support.

[0030] Step S102: The planner agent converts the architecture design into parametric planning according to the work manual. Some of the parametric planning is as follows: start_node = {"x":0,"y":0} LLM_node1 = { "x":1200, "y":200, "id":100003, "model_name":"Doubao·1.6·lite·251015", "model_id":"1.761532732e+09", "input_nodes":[{"path":"input","id":100001}], "max_token":"4096", "user_prompt":"User asked a question: {input_100001}", "system_prompt": "You are the pre-sales consultation assistant for the online bicycle store. Your responsibilities include providing potential customers with intelligent model recommendations, detailed parameter comparisons, real-time inventory checks, price discount inquiries, and offline test ride appointments. Your answers must be professional, accurate, and friendly."

[0031] Step S103: Configure the engineer agent to call pre-written functions according to the work manual to generate workflow configuration code: - id: "100006" type: output title: Output icon: Tag image link description: "Node description" position: x: 1800 y: 300 parameters: callTransferVoice: true chatHistoryWriting: historyWrite content: type: string value: content: '{{output_100003}}' type: literal node_inputs: - name: output_100003 input: value: path: output ref_node: "100003" streamingOutput: true terminatePlan: useAnswerContent

[0032] Step S104: The security auditor verifies and repairs the configuration code in accordance with the work manual, focusing on aspects such as indentation, line breaks, parameter naming, parameter validity, and format verification.

[0033] Step S105: Perform packaging according to the pre-written packaging program.

[0034] Using the above embodiments of the invention, various intelligent agent operation manuals and large model-related parameters that can be used to implement this solution are listed. The above content is only an example, and the invention is not limited thereto. Any alternative intelligent agent operation manuals and large model-related parameter arrangements that are easily conceived by those skilled in the art are within the technical scope of protection claimed by the present invention.

[0035] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention, such as changing model parameters or adding agents.

[0036] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0037] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for automatically generating large-scale model workflows based on multi-agent systems, characterized in that, The method employs a multi-agent collaborative architecture, comprising multiple agents that perform tasks according to a step-by-step division of labor, including the following steps: Step S1: The first intelligent agent processes and analyzes the natural language requirement description related to the large model workflow input by the user according to the system prompts (hereinafter referred to as the manual). The first intelligent agent outputs the workflow architecture description according to the preset standard template, including the workflow structure, number of branches, branch points, functional description of each branch, and relative position of each branch, thus completing the workflow architecture design task. Step S2: The second intelligent agent receives the workflow architecture description output by the first intelligent agent, generates workflow node parameters according to the work manual, including business logic such as start, end, large model, message, intent recognition, and selection, database, knowledge base, custom plugins, and custom workflow, and completes the workflow parameter planning and design. Step S3: The third agent receives the parameters output by the second agent, calls the pre-written workflow configuration code generation function according to the work manual, and outputs the workflow configuration code in the format set by the function to complete the workflow configuration code generation task; Step S4: The fourth agent reviews the code output by the third agent according to the work manual to ensure that it conforms to the preset format and completes the security review task. Step S5: Encapsulate the approved configuration code output by the fourth intelligent agent, complete file generation, determine file name and file structure, and encapsulate it into a deployable workflow package.

2. The method according to claim 1, characterized in that, The multi-agent collaborative architecture is driven by a large model, and the process is strictly limited by a directed graph-based workflow orchestration method. The process is fixed for each run, and the large model can be selected and replaced as needed. The large model is mainly divided into a large model with high inference capability and a large model with high inference speed.

3. The method according to claim 1, characterized in that, The number of intelligent agents (from the first intelligent agent to the fourth intelligent agent) used to perform the task is at least four, including: architect intelligent agent, planner intelligent agent, configuration engineer intelligent agent, and security auditor intelligent agent; The architect agent is used to parse user requests according to the work manual to obtain the large-scale workflow architecture design; the planner agent is used to convert the architecture into large-scale workflow parameter planning according to the work manual; the configuration engineer agent is used to call the configuration code generation function according to the work manual to obtain the large-scale workflow configuration code; and the security auditor agent is used to verify and repair the configuration code according to the requirements of the work manual.

4. The method according to claim 1, characterized in that, The agent includes various agent parameters, such as: large model model, work manual, user prompt words, skills, plugins, runtime limit, input data, knowledge base / database, output information format, and large model fine-tuning parameters such as Top-P and generation randomness.

5. The method according to claim 1, characterized in that, The preset node parameter types generated by the second intelligent agent include multiple categories, such as: start, end, output, plugin, knowledge base / database, large model, intent recognition, etc., which can be customized and extended / modified according to actual needs.

6. The method according to claim 1, characterized in that, The third intelligent agent is driven by a large model. The large model calls a pre-designed code generation function to complete the workflow configuration code generation task. The code generation function can be modified and can generate code in different formats. The third intelligent agent can adopt a parallel mode of multiple large models to meet the needs of more complex workflow generation tasks.

7. The method according to claim 1, characterized in that, The security reviewer in step S4 reviews the following: code indentation, naming rules, parameter validity, and format verification. The work manual can be modified according to actual needs to adapt to different workflow generation requirements.

8. The method according to claim 1, characterized in that, The packaging program in step S5 is used to generate a compressed package, and can be changed to other packaging formats and programming methods as needed.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 8.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 8.