Workflow generation method and device fusing large language model and knowledge base
By integrating deep learning models with enterprise private knowledge bases, multi-dimensional contextual information of workflow requirements is identified, domain knowledge fragments are generated, and large language models are guided to create workflow definition models. This solves the problem of low accuracy in automatic workflow generation in traditional methods, and achieves a high degree of fit with enterprise business needs and improved efficiency.
Patent Information
- Application Number
- CN202511398523.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2026-01-13
AI Technical Summary
Traditional methods suffer from low accuracy in generating natural language processing workflows due to limitations in prompt word settings and inherent uncertainties in large language models. Furthermore, these methods are often disconnected from actual business needs.
By integrating deep learning models with enterprise private knowledge bases, multi-dimensional contextual information of workflow requirements is identified, retrieval requests are generated and domain knowledge fragments are obtained, which are then populated into structured prompt word templates to guide the large language model to generate a workflow definition model and deploy it to the workflow engine to create the target workflow.
It improves the accuracy of natural language processing in the automatic generation of workflows, making the generated workflows highly compatible with the actual business needs of enterprises, significantly improving generation efficiency and reducing the cost of manual adjustments later.
Smart Images

Figure CN121328677A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and intelligent business process management technology, and in particular to a workflow generation method and apparatus that integrates large language models and knowledge bases. Background Technology
[0002] Workflow, or workflow, refers to a series of sequential or logically connected steps, activities, and rules established to complete a specific task or achieve a goal. In enterprise management, pre-set workflows can break down the overall work into different tasks, which are then executed and monitored according to specific steps. It is widely used in administrative approvals, human resources and finance, manufacturing, customer service, and other scenarios.
[0003] With the development of artificial intelligence technology, especially the breakthroughs of large language models in natural language understanding and generation, technologies have emerged that automatically generate workflows using large language models. In traditional implementations, users typically input natural language prompts describing the workflow objectives, and the large language model directly generates complete workflow steps based on these prompts, thereby improving the efficiency of automatic workflow generation.
[0004] However, the inventors discovered that the aforementioned traditional methods have significant drawbacks. Because they heavily rely on the accuracy of the initial prompts (requiring personnel with high expertise and precision in setting these prompts), and because large language models inherently possess probabilistic characteristics in their generated results, exhibit knowledge illusions, and lack domain specificity, the directly generated workflows often become severely disconnected from the specific business processes, data specifications, and organizational structures of an enterprise. The generated workflows cannot fully meet the enterprise's actual situation and needs. To obtain a usable workflow, users must repeatedly try and adjust the prompts, a process that is not only inefficient but also makes it difficult to guarantee the quality of the generated results, severely restricting the practical application of artificial intelligence technology in intelligent business process management.
[0005] Therefore, how to design a new technical solution to effectively overcome the limitations of prompt words and LLM models, and improve the fit, accuracy and efficiency of automatically generated workflows with actual enterprise needs, has become an urgent problem to be solved in the field of artificial intelligence and intelligent business process management technology. Summary of the Invention
[0006] The technical problem solved by this invention is to address the issue that the accuracy of natural language processing in the automatic generation of workflows is low and that it is out of touch with the actual business needs of enterprises due to the limitations of prompt word settings and the inherent uncertainties of large language models in traditional technologies.
[0007] To address the aforementioned technical problems, this invention provides the following technical solution: Determining a workflow requirement description in natural language form; inputting the workflow requirement description into a context recognition model, which outputs corresponding multi-dimensional context information, wherein the context recognition model is pre-trained based on a deep learning model; generating a retrieval request based on the multi-dimensional context information, and using the retrieval request to query an enterprise's private knowledge base to obtain domain knowledge fragments related to workflow generation; obtaining a structured prompt word template, and filling the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments into the corresponding fields of the structured prompt word template to generate target prompt words; inputting the target prompt words into a large language model to obtain a workflow definition model generated by the large language model; deploying the workflow definition model to a workflow engine, which then creates a target workflow based on the workflow definition model.
[0008] This invention also provides a workflow generation device integrating a large language model and a knowledge base, comprising: a first determining module for determining a workflow requirement description in natural language form; a first recognizing module for inputting the workflow requirement description into a context recognition model, wherein the context recognition model outputs corresponding multi-dimensional context information, wherein the context recognition model is obtained based on a deep learning model pre-trained; a first querying module for generating a retrieval request based on the multi-dimensional context information, and using the retrieval request to query an enterprise private knowledge base to obtain domain knowledge fragments related to workflow generation; a first filling module for obtaining a structured prompt word template, and filling the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments into the corresponding fields of the structured prompt word template to generate target prompt words; a first obtaining module for inputting the target prompt words into a large language model to obtain a workflow definition model generated by the large language model; and a first creating module for deploying the workflow definition model to a workflow engine, wherein the workflow engine creates a target workflow based on the workflow definition model.
[0009] The beneficial effects of this invention are as follows: The method obtains a workflow requirement description provided by the user and identifies its multi-dimensional contextual information based on deep learning; it retrieves enterprise private knowledge bases based on the multi-dimensional contextual information to obtain domain knowledge fragments related to workflow generation; and it uses the workflow requirement description, multi-dimensional contextual information, and domain knowledge fragments as prompt words to guide and constrain the large language model to generate a workflow definition model; finally, it uses a workflow engine to create a target workflow based on the workflow definition model, thereby creatively integrating deep learning models, LLM, and knowledge bases (RAG). Through the accurate identification and extraction of multi-dimensional contextual information based on deep learning, it constrains and guides the knowledge base (RAG)-based workflow. G) enhances retrieval accuracy by improving the accuracy of domain knowledge fragment retrieval. It integrates workflow requirement descriptions, multi-dimensional contextual information, and domain knowledge fragments to constrain and guide the natural language processing of the large language model. By leveraging deep learning and the company's private knowledge base, it provides the most relevant multi-dimensional contextual information for the LLM, enhancing and constraining the automatic generation of the LLM, thereby improving the accuracy of the natural language processing of the large language model. This effectively overcomes the limitations of prompt words and the LLM model, improves the accuracy of natural language processing in the automatic generation of workflows based on the large language model, and ensures that the generated workflows are highly aligned with the company's actual business needs, thus improving the efficiency of automatic workflow generation. Attached Figure Description
[0010] Figure 1 A flowchart illustrating the workflow generation method for integrating a large language model and a knowledge base provided in an embodiment of the present invention;
[0011] Figure 2 A schematic diagram illustrating the overall concept of the workflow generation method integrating a large language model and a knowledge base provided in an embodiment of the present invention;
[0012] Figure 3 This is a schematic diagram of the first sub-process of the workflow generation method that integrates a large language model and a knowledge base provided in an embodiment of the present invention.
[0013] Figure 4 This is a schematic diagram of the second sub-process of the workflow generation method that integrates a large language model and a knowledge base provided in an embodiment of the present invention;
[0014] Figure 5 A schematic block diagram of a workflow generation device that integrates a large language model and a knowledge base, provided in an embodiment of the present invention. Detailed Implementation
[0015] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0016] This invention provides a workflow generation method and apparatus that integrates a large language model and a knowledge base. The method and apparatus can be applied to devices including but not limited to smartphones, tablets, desktops, servers, cloud platforms, etc., and can be used in scenarios including but not limited to office scenarios such as administrative approval and human resources and finance, production and manufacturing, customer service, IT operation and maintenance, etc., to generate workflows that integrate a large language model and a knowledge base.
[0017] To address the limitations of traditional technologies, such as the constraints of prompt word settings and the inherent uncertainties of large language models (RAGs), which result in low accuracy and disconnect between the generated workflows and actual business needs, the inventors propose a workflow generation method that integrates large language models and knowledge bases. The core idea of this invention is to creatively integrate deep learning models, LLMs, and knowledge bases (RAGs). By accurately identifying and extracting multi-dimensional contextual information based on deep learning, it constrains and guides RAG-based retrieval enhancement, thereby improving the accuracy of domain knowledge fragment retrieval enhancement. Furthermore, it integrates workflow requirement descriptions, multi-dimensional contextual information, and domain knowledge fragments to constrain and guide the natural language processing of large language models. Through deep learning and the enterprise's proprietary knowledge base, it provides multi-dimensional, highly relevant contextual information for LLMs, enhancing and constraining their automatic generation, thus improving the accuracy of natural language processing for large language models. This effectively overcomes the limitations of prompt words and LLM models, improves the accuracy of natural language processing in automatically generated workflows based on large language models, and ensures that the generated workflows highly align with actual business needs, thereby increasing the efficiency of automatic workflow generation.
[0018] The following detailed description of some embodiments of the present invention is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0019] Example 1, please refer to Figure 1 and Figure 2 , Figure 1 A flowchart illustrating the workflow generation method for integrating a large language model and a knowledge base provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the overall concept of a workflow generation method integrating a large language model and a knowledge base, provided in an embodiment of the present invention. Figure 1 As shown, in this embodiment, the method includes, but is not limited to, the following steps S11-S16:
[0020] S11. Determine the workflow requirements description in natural language form.
[0021] Explained, when automatically generating workflows based on a large language model, the workflow requirement description in natural language form is first determined. This natural language workflow requirement description can be directly generated and provided by the user. For example, the workflow requirement description can be, but is not limited to, meeting minutes from meetings of departments, groups, teams, etc. within an enterprise. The workflow requirement description is expressed in natural language form and indicates what kind of workflow the user needs to generate. The workflow requirement description includes, but is not limited to, named entities related to the enterprise structure and process requirement information. The natural language workflow requirement description can be converted from information in other modalities such as images, voice, and video. The detailed explanation and description of the following further embodiments are as follows.
[0022] The enterprise structure named entities include, but are not limited to, which department within the enterprise is involved, the starting department, intermediate departments, and ending departments of cross-departmental processes. Process requirement information indicates the user's subjective requirements or needs regarding the generated workflow, such as preferences, intentions, and emotional inclinations. Preferences indicate the user's value ranking and trade-offs regarding the generated workflow across different dimensions, including but not limited to efficiency, quality / compliance ("safety first," "better to be slower than not accurate," "must be legally reviewed"), flexibility, standardization, transparency, traceability, and fairness / responsibility sharing. Intentions indicate the user's ultimate business goals or core issues to be addressed regarding the generated workflow, including but not limited to creating new processes, optimizing existing processes, simplifying / accelerating processes, ensuring compliance / reducing risks, and integration / automation. Emotional inclinations indicate the user's emotional attitudes and subjective feelings towards existing or new processes, including but not limited to being too slow, inefficient, cumbersome, confusing, "waiting time is too long," "always stuck at some point," simple and clear, "this can be adjusted," and "maybe we can try another way."
[0023] Furthermore, define the workflow requirements description in natural language form, including:
[0024] The system receives multimodal input information related to the workflow provided by the user through a human-computer interaction interface. The multimodal input information includes at least two of the following: text information, voice information, image information, and video information.
[0025] Identify non-textual information contained in the multimodal input information;
[0026] Based on the corresponding pre-trained information conversion model, the non-text information is converted into corresponding auxiliary text description information;
[0027] The text information and all the auxiliary text description information are concatenated in a preset information order to generate a structured workflow requirement description in natural language form.
[0028] Specifically, the system receives multimodal input information related to the workflow provided by the user through a human-computer interaction interface. The multimodal input information includes at least two of the following: text information, voice information, image information, and video information. Among them, image information includes, but is not limited to, screenshots of the software interface, document images containing tables or charts, and hand-drawn sketches. The system also identifies non-text information contained in the multimodal input information, which includes at least one of the following: voice information, image information, and video information.
[0029] Based on the corresponding pre-trained information conversion model, non-textual information is converted into corresponding auxiliary text description information. For example, for speech information, pre-trained automatic speech recognition models based on deep learning, such as recurrent neural networks (RNN), convolutional neural networks (CNN), or Transformer models, are used to convert speech into corresponding text description information. For image information and video information (each frame of the video is extracted first), a pre-trained visual language model is used to analyze the image information and generate corresponding text description information containing interface elements, text content, data structures, and logical relationships in the image.
[0030] By concatenating text information and all auxiliary text descriptions in a preset order, a structured workflow requirement description in natural language is generated. Thus, using multimodal information as a starting point, users can express rich workflow requirements in the most natural way (such as speaking, taking screenshots, uploading files, etc.), which conforms to users' natural interaction habits of voice, text, images, gestures, etc., and can provide richer and more accurate contextual information. This further improves the accuracy of natural language processing in the automatic generation of workflows based on large language models, and makes the generated workflow highly consistent with the actual business needs of enterprises.
[0031] S12. Input the workflow requirement description into the context recognition model, and output the corresponding multi-dimensional context information from the context recognition model, wherein the context recognition model is obtained based on the pre-training of a deep learning model.
[0032] Explained, a context recognition model based on a deep learning model is pre-set and pre-trained. This model analyzes, understands, and identifies the contextual information of workflow requirement descriptions to extract relevant information such as named entities of the enterprise structure and process requirement information. The context recognition model can be a named entity recognition model specifically designed to identify company structure information, or a text sentiment / intent recognition model specifically designed to identify subjective tendencies in workflow preferences, intentions, and emotional tendencies. This text sentiment / intent recognition model can also be called a text sentiment / intent classification model. Named Entity Recognition (NER) is a very mature task in natural language processing. Using a pre-trained NER model on a general corpus, fine-tuned on company structure data such as internal documents, address books, and system names, it can achieve a recognition accuracy close to 100%, far exceeding that of general LLM. Therefore, by leveraging named entity recognition, the accuracy of named entity recognition can be improved, thereby effectively guiding and constraining LLM, and ultimately improving the accuracy of large language model natural language processing. Text sentiment / intent recognition models can employ models based on, but are not limited to, FastText, TextCNN (text convolutional neural network), extRNN / LSTM / GRU (recurrent neural network and its variants), BERT and its variants (such as RoBERTa, DistilBERT, ALBERT), and BERT-based fusion models (such as BERT+CNN, BERT+RNN). It should be noted that, based on their technical knowledge and R&D capabilities, those skilled in the art can choose appropriate models, including but not limited to those mentioned above, for named entity recognition and text sentiment / intent recognition models as needed; this does not require creative effort.
[0033] Based on the above concept and setup, the workflow requirement description is input into the context recognition model, which outputs corresponding multi-dimensional context information such as enterprise structure named entities and process requirement information. The multi-dimensional context information includes user-side emotional intent information and enterprise-side company organizational structure information. Furthermore, the multi-dimensional context information includes at least one of the following: enterprise structure named entities identified based on the workflow requirement description, and process requirement information identified based on the workflow requirement description. The enterprise structure named entities are obtained by inputting the workflow requirement description into the named entity recognition model, and the process requirement information is obtained by inputting the workflow requirement description into the emotional intent recognition model. If the workflow requirement description does not contain enterprise structure named entities or process requirement information, the corresponding content can be assigned an empty value.
[0034] As mentioned above, the context recognition model is based on deep learning model pre-training. Leveraging deep learning's expertise and accuracy in "performing specific tasks," it accurately guides and constrains the general-purpose large language model, combining the "specialized division of labor" of deep learning with the generality of the large language model to improve the accuracy of natural language processing. Furthermore, enterprise structure named entities represent the departmental structure of an enterprise's organization and structure. Since different enterprises have different structures and organizations, identifying enterprise structure named entities and using this to guide and constrain the large language model ensures that the generated workflow highly matches the actual situation of the enterprise. Simultaneously, as mentioned above, since process requirement information represents the user's subjective requirements or needs regarding the generated workflow, such as preferences, intentions, and emotional tendencies, this information can also guide and constrain the large language model, ensuring that the generated workflow highly matches the actual needs of the enterprise.
[0035] S13. Generate a retrieval request based on the multi-dimensional context information, and use the retrieval request to query the enterprise's private knowledge base to obtain domain knowledge fragments related to workflow generation.
[0036] Interpretationally, a private enterprise knowledge base is pre-set, integrating unstructured data such as internal process documents, API manuals, organizational charts, and company rules and regulations, as well as related structured data, into a unified model using knowledge graphs and vector databases to provide the most relevant context for LLM.
[0037] Based on the above concept and setup, retrieval requests are generated based on multi-dimensional contextual information. The method for generating retrieval requests can draw on existing related technologies, which will not be elaborated here. The emphasis here is not on the method of generating retrieval requests, but on the basis for generating them (i.e., the retrieval elements corresponding to the multi-dimensional contextual information, whose source and specific content differ from those in traditional technologies). For example, in the RAG architecture, a Large Language Model (LLM) can be used to generate corresponding retrieval requests, which are then used to query the company's private knowledge base to obtain domain knowledge fragments related to workflow generation. Domain knowledge fragments are the result of atomically processing the corresponding domain knowledge. In RAG, this directly determines the accuracy and reliability of the system's answers. Domain knowledge represents a proprietary knowledge base (such as internal company documents). The LLM mainly leverages its powerful language understanding and generation capabilities, while the domain knowledge is provided by an external knowledge base, ensuring the accuracy and professionalism of the answers. Therefore, using domain knowledge highly aligned with the company to guide and constrain the Large Language Model can improve the accuracy of the Large Language Model's natural language processing, thereby improving the accuracy of workflow generation.
[0038] S14. Obtain a structured prompt word template, and fill the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragment into the corresponding fields of the structured prompt word template to generate target prompt words.
[0039] Explained, a pre-set structured prompt template is provided. The structured prompt template represents a prompt based on a structured prompt template. The structured prompt template includes, but is not limited to, the corresponding fields for workflow requirement description, multi-dimensional contextual information, and domain knowledge fragment filling. The prompt technology for the large language model refers to existing related technical means, which will not be elaborated here.
[0040] Based on the above concept and settings, a structured prompt word template is obtained, and the workflow requirement description, multi-dimensional context information, and domain knowledge fragments are filled into the corresponding fields of the structured prompt word template to generate the target prompt word.
[0041] S15. Input the target prompt word into the large language model to obtain the workflow definition model generated by the large language model.
[0042] Interpretatively, target prompts are input into selected large language models, including but not limited to GPT, LLaMA, and ChatGLM, to obtain a workflow definition model generated by the large language model. The workflow definition model (or simply "workflow model") is a blueprint or template that refers to the output of the large language model. It is an abstract description of the business process, specifying "who does what, when, and what the next step should be." It describes in a structured way what a complete workflow should look like. It does not focus on a specific execution but defines the rules, logic, and participants of all stages in the process.
[0043] S16. Deploy the workflow definition model to the workflow engine, and then the workflow engine creates the target workflow based on the workflow definition model.
[0044] Explained, a workflow engine is pre-configured. A workflow engine is a software system or core component that is responsible for executing the model-defined business process (i.e., workflow definition model). It can parse predefined process rules and deliver tasks, data, or information to the right people or applications at the right time according to these rules. Workflow engines can be developed or existing workflow engines can be used, such as, but not limited to, Camunda, Flowable, Activiti, etc. Based on this, the designed workflow definition model file is deployed (uploaded) to the workflow engine. The workflow engine will parse this workflow definition model file and create an executable "template" in memory.
[0045] Based on the above concept and setup, the workflow definition model is deployed to the workflow engine. The workflow engine then creates target workflows based on the workflow definition model, thereby achieving standardization, automation, traceability, and continuous optimization of business workflows. This enables the automatic generation of workflows that integrate deep learning models, large language models, and knowledge bases (RAGs). By accurately identifying and extracting multi-dimensional contextual information based on deep learning, the retrieval enhancement based on the knowledge base (RAG) is constrained and guided, improving the accuracy of domain knowledge fragment retrieval enhancement. Furthermore, by comprehensively considering workflow requirement descriptions, multi-dimensional contextual information, and domain knowledge fragments, the natural language processing of the large language model is constrained and guided, improving the accuracy of the large language model's natural language processing. This effectively overcomes the limitations of prompt words and LLM models, improves the accuracy of natural language processing in the automatic generation of workflows based on large language models, and ensures that the generated workflows highly align with the actual business needs of enterprises, thus enhancing the efficiency of automatic workflow generation.
[0046] In this embodiment of the invention, the method obtains a workflow requirement description provided by the user and identifies its multi-dimensional contextual information based on deep learning. It then retrieves a private enterprise knowledge base based on this multi-dimensional contextual information to obtain domain knowledge fragments related to workflow generation. The workflow requirement description, multi-dimensional contextual information, and domain knowledge fragments are used as prompts to guide and constrain a large language model, generating a workflow definition model. Finally, a workflow engine is used to create a target workflow based on the workflow definition model. This creatively integrates deep learning models, a large language model (LLM), and a knowledge base (RAG). By integrating deep learning-based context recognition, enhanced enterprise knowledge base retrieval generation, and structured prompting technologies, it combines the general capabilities of deep learning and the large language model with enterprise-specific domain knowledge. Through the accurate identification and extraction of multi-dimensional contextual information based on deep learning, it constrains and... This approach guides retrieval enhancement based on a knowledge base (RAG) to improve the accuracy of domain knowledge fragment retrieval enhancement. It integrates workflow requirement descriptions, multi-dimensional contextual information, and domain knowledge fragments to constrain and guide the natural language processing of the large language model. By leveraging deep learning and the company's proprietary knowledge base, it provides multi-dimensional, highly relevant contextual information for the LLM (Local Language Model), enhancing and constraining the automatic generation of LLMs and improving the accuracy of the large language model's natural language processing. This combination effectively overcomes the problems of inaccurate workflow generation results and disconnect from actual business needs caused by limitations in prompt words and uncertainties in large language models in traditional methods. It improves the accuracy of natural language processing in automatically generated workflows based on large language models and ensures that the generated workflows are highly aligned with the company's actual business needs, thereby increasing the efficiency of automatic workflow generation. The beneficial effects also include:
[0047] 1) Knowledge Enhancement and Precise Guidance: Through context recognition based on deep learning models and retrieval enhancement from enterprise private knowledge bases, multi-dimensional, accurate and highly relevant contextual information is provided for LLM, thereby effectively guiding and constraining its generation process.
[0048] 2) End-to-end automation: Enables end-to-end automatic conversion from unstructured natural language requirement descriptions to structured, executable workflow definition models.
[0049] 3) Significantly improved generation quality: The final generated workflow is highly accurate and closely matches the company's actual business processes and standards, significantly reducing the cost of manual adjustments later.
[0050] 4) Optimized generation efficiency: By automating information integration and prompt word construction, the process of repeatedly debugging prompt words in the traditional method is reduced, thereby improving the overall efficiency of automatic workflow generation.
[0051] In one embodiment, please refer to Figure 3 , Figure 3 This is a schematic diagram of the first sub-process of the workflow generation method integrating a large language model and a knowledge base provided in an embodiment of the present invention. Figure 3 As shown, in this embodiment, before obtaining the structured prompt word template and filling the corresponding fields of the structured prompt word template with the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments to generate the target prompt word, the method further includes:
[0052] S31. Obtain the interactive prompt template for generating the workflow framework outline;
[0053] S32. Fill the workflow requirement description, the multi-dimensional context information and the domain knowledge fragment into the interaction prompt word template to generate interaction prompt words;
[0054] S33. Input the interactive prompt words into the large language model to obtain an initial workflow framework outline generated by the large language model. The initial workflow framework outline includes at least one of the following: workflow transition nodes, transition order, transition logic, and node tasks.
[0055] S34. Provide the initial workflow framework outline to the user and receive the user's confirmation of the initial workflow framework outline, or receive the user's feedback on modifying the initial workflow framework outline and the corresponding confirmation.
[0056] S35. When the user's confirmation is received, execute the step of "obtaining the structured prompt word template".
[0057] Explained, before generating target prompts and using them to generate the corresponding workflow, the following processing is also performed:
[0058] Obtain the interactive prompt template used to generate the workflow framework outline. The workflow framework outline is a high-level blueprint for the design and implementation of a workflow system. It defines the backbone structure, key components, main interaction rules, and main data flow of the workflow. The term "workflow framework outline" provides a concise description of the composition, structure, core concepts, and design points of the workflow framework. "Framework outline" is a compound word that emphasizes and clarifies the scope. The emphasis of "framework" is on its structural, constraining, and supportive nature, while the emphasis of "outline" is on its conciseness, outline, and descriptive nature. The workflow framework outline expresses and embodies the overall framework and main structure of the workflow, but it does not contain specific business logic implementation details. The workflow framework outline includes at least one of the following: workflow transition nodes, transition sequence, transition logic, and node tasks. Furthermore, the "interaction" in the interactive prompt template is only used to distinguish different prompt templates, not to limit the corresponding prompt template. The interactive prompt template only indicates that it is a prompt template used for the large language model in the human-computer interaction stage, and it is a prompt template used to generate the workflow framework outline. The interactive prompt template includes, but is not limited to, fields corresponding to workflow requirement descriptions, multi-dimensional contextual information, and domain knowledge fragments. At the same time, the interactive prompt template is used to instruct the large language model to generate the workflow framework outline.
[0059] Based on the above concept and description, the workflow requirement description, multi-dimensional context information and domain knowledge fragments are filled into the interaction prompt word template to generate interaction prompt words. As mentioned above, similar to the "interaction prompt word template", "interaction prompt word" only indicates that it is a prompt word used in the large language model of the human-computer interaction stage. "Interaction" is only used to distinguish different prompt words and is not used to limit the corresponding prompt words.
[0060] Furthermore, the interactive prompts are input into a large language model to obtain an initial workflow framework outline generated by the model. This outline includes at least one of the following: workflow transition nodes, transition sequence and logic, and the total task of each node. This initial workflow framework outline is then provided to the user for confirmation or modification. If the user deems the outline correct and highly aligned with the company's actual business needs and circumstances, they only need to confirm. If the user believes the outline deviates from its intended purpose or does not align well with the company's actual business needs and circumstances, they can point out its shortcomings, generate corresponding modification feedback, and confirm the feedback. The system receives user confirmation or modification feedback, and the confirmation process can take various forms, including but not limited to clicking to confirm, checking boxes, and clicking to confirm after text modification. When user confirmation is received, the step of "obtaining the structured prompt template" is executed. This achieves a human-integrated workflow. The two-stage automatic generation of machine-interactive workflows involves generating an initial workflow framework outline before automatically generating a complete, specific, and formal custom workflow model. This outline is then confirmed or modified by the user. Therefore, the user-confirmed or modified workflow framework outline is highly aligned with the enterprise's actual business needs and circumstances. Based on this, and including subsequent use of the user-confirmed or modified workflow framework outline, the natural language processing (NLP) of the automatically generated workflow from the large language model guides and constrains the workflow. This instructs the large language model to generate a complete and executable workflow definition model. The workflow definition model contains all the necessary specific content of the workflow, including but not limited to at least one of the following: participants, data / forms, results and status, operators, and business rules. This further improves the accuracy of the NLP-based automatic workflow generation and ensures that the generated workflow highly aligns with the enterprise's actual business needs.
[0061] Further, a structured prompt word template is obtained, and the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments are filled into the corresponding fields of the structured prompt word template to generate target prompt words, including:
[0062] The initial workflow framework outline confirmed by the user and / or the modification feedback made to the initial workflow framework outline are used as new domain knowledge fragments, and are filled into the structured prompt word template together with the original workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments to generate target prompt words.
[0063] Specifically, if the user provides no feedback on the initial workflow framework outline, the initial workflow framework outline is treated as a new domain knowledge fragment. If the user provides feedback on the initial workflow framework outline, the user-confirmed initial workflow framework outline and their feedback on modifications to the initial workflow framework outline are treated as new domain knowledge fragments, or the user-confirmed feedback on modifications to the initial workflow framework outline is treated as a new domain knowledge fragment. Based on this, these fragments, along with the original workflow requirement description, multi-dimensional contextual information, and domain knowledge fragments, are populated into the structured prompt word template to generate target prompt words. In this case, the structured prompt word template is pre-set with... The initial workflow framework outline and the corresponding fields corresponding to the modifications and feedback made to the initial workflow framework outline provide the LLM with the richest possible multi-dimensional and most relevant contextual information, enhancing the guidance and constraints for the automatic generation of the LLM. Since the workflow framework outline after user confirmation or modification feedback is highly consistent with the actual business needs and actual situation of the enterprise, and the intermediate results (i.e., the workflow framework outline) confirmed by the user are fed back as enhancing information to the final generation stage, an optimization closed loop is formed. Therefore, it can further improve the natural language processing accuracy of the automatic generation of workflows based on the large language model and make the generated workflow highly consistent with the actual business needs of the enterprise.
[0064] This invention, in its embodiments, first generates an initial workflow framework outline, which is then confirmed by the user for any inappropriate aspects. If the user confirms the initial workflow framework outline is correct, corresponding target prompts are generated, and the corresponding workflow is generated based on these prompts. This achieves automatic generation of a two-stage workflow definition model. By leveraging the interaction between the initial workflow framework outline and the user, a two-stage generation and user confirmation mechanism is introduced, implementing a "step-by-step generation," "human-computer interaction iterative optimization," "user feedback iteration," and "framework confirmation" mechanism. This improves the accuracy and quality of automatic workflow generation, effectively overcoming the limitations of prompts and LLM models, enhancing the natural language processing accuracy of automatic workflow generation based on a large language model, and ensuring that the generated workflow highly aligns with the actual business needs of the enterprise, thereby improving the efficiency of automatic workflow generation.
[0065] In one embodiment, please refer to Figure 4 , Figure 4 This is a schematic diagram of the second sub-process of the workflow generation method integrating a large language model and a knowledge base provided in an embodiment of the present invention. For example... Figure 4 As shown, in this embodiment, obtaining the structured prompt word template includes:
[0066] S41. Determine the workflow type identification prompt template, and embed the workflow requirement description into the corresponding field of the workflow type identification prompt template to obtain the workflow type identification prompt;
[0067] S42. Input the workflow type identification prompt into the large language model, and the large language model outputs the target workflow type corresponding to the workflow requirement description.
[0068] S43. Determine the preset prompt word template corresponding to each preset workflow type. The preset workflow types include at least one of the following: administrative management, human resources and finance, production and manufacturing, customer service, IT operation and maintenance, and sales and marketing.
[0069] S44. Based on the correspondence between the preset workflow type and the preset prompt word template, select the target template that best matches the target workflow type from multiple preset prompt word templates to obtain a structured prompt word template.
[0070] Explain, a workflow type identification prompt template is pre-set. This template represents a prompt template for identifying workflow types. Therefore, the workflow type identification prompt template is determined, and the workflow requirement description is embedded into the corresponding field of the template to obtain the workflow type identification prompt. For example, embedding the workflow requirement description into the "User Input" field in the following example yields the workflow type identification prompt. A workflow type identification prompt template can be shown in the following example:
[0071] {# Prompt Template
[0072] You are a seasoned enterprise process analysis expert. Your task is to categorize user-described workflow requirements into the single most relevant category.
[0073] Optional types and their definitions:
[0074] 1. **Administrative Management**: This involves supporting internal daily operations, such as meeting room booking, office supply requisition, document processing, fixed asset management, and travel arrangements.
[0075] 2. **Human Resources and Finance:** Related to employee and company finances, such as onboarding and offboarding, attendance and expense reimbursement, payroll, corporate payments, and budget applications.
[0076] 3. **Manufacturing Category**: This category involves product production, quality control, and supply chain management, such as work order management, material requirements planning, quality inspection, and equipment maintenance.
[0077] 4. **Customer Service**: Customer-centric activities, such as inquiries, complaints, after-sales requests, and service dispatch.
[0078] 5. **IT Operations and Maintenance**: Supports internal IT systems and services, such as fault reporting, account permission application, software deployment, system changes, etc.
[0079] 6. **Sales and Marketing Category:** This category focuses on generating revenue and promoting business, such as sales lead follow-up, opportunity management, contract approval, and marketing activities.
[0080] Please only output the name of the best matching category, without the number or any other explanation.
[0081] Example:
[0082] Input: "Employees submit leave applications, managers approve them and then notify HR for filing."
[0083] Output: "Human Resources and Finance"
[0084] Type: "The server is down; we need to send someone to fix it immediately."
[0085] Output: "IT Operations and Maintenance"
[0086] Please now categorize the following requirements:
[0087] Input: "{User input (e.g., "Workflow requirement description")}"
[0088] Output: ""}
[0089] Then, the workflow type identification prompts are input into the large language model, and the large language model outputs the target workflow type corresponding to the workflow requirement description. The preset prompt templates corresponding to each preset workflow type are determined, and corresponding preset prompt templates are set for each preset workflow type so that the preset prompt templates meet the actual situation and needs of the enterprise's workflow. The multiple preset workflow types include at least one of the following: administration, human resources and finance, production and manufacturing, customer service, IT operations and maintenance, and sales and marketing.
[0090] Then, based on the correspondence between preset workflow types and preset prompt word templates, the target template that best matches the target workflow type is selected from multiple preset prompt word templates to obtain a structured prompt word template. This enables dynamic selection of structured prompt word templates, allowing the adoption of the most professional generation strategy for different types of workflows to guide and constrain the natural language processing of the large language model, significantly improving the accuracy, quality, and professionalism of automatic workflow generation.
[0091] This invention identifies key workflow type information in the workflow requirement description and dynamically and automatically determines the corresponding structured prompt word template based on this information. It can adopt the most professional prompt word template-based generation strategy for different types of workflows (such as approval and maintenance) to guide and constrain the large language model. This significantly improves the accuracy of natural language processing in automatic workflow generation, ensuring that the generated workflows closely match the actual business needs of enterprises, thereby enhancing the efficiency of automatic workflow generation.
[0092] In one embodiment, the method further includes:
[0093] If the workflow engine encounters an error while parsing the workflow definition model, the parsing error information returned by the workflow engine is filled into the corresponding fields of the structured prompt word template to obtain the correction prompt word;
[0094] The correction prompts are input into the large language model to generate a correction workflow definition model.
[0095] The modified workflow definition model is deployed to the workflow engine, and then the workflow engine creates a target workflow based on the modified workflow definition model, and iterates the above process until the preset termination iteration condition of "creating the target workflow" is met.
[0096] Explained, if an error occurs in the workflow engine parsing the workflow definition model, the parsing error information returned by the workflow engine is filled into the corresponding field of the structured prompt word template to obtain the correction prompt word. It should be noted that the field corresponding to the parsing error information returned by the workflow engine is pre-set in the structured prompt word template, and can be "empty" by default. Furthermore, the understanding of "correction prompt word" is similar to that of "interactive prompt word" mentioned above, and will not be repeated here.
[0097] The correction prompts are input into the large language model to generate a corrected workflow definition model. This corrected workflow definition model represents the workflow definition model automatically generated after correcting parsing errors. The corrected workflow definition model is then deployed to the workflow engine, which can then create the target workflow based on the corrected workflow definition model. The above process is described in step S16 above and will not be repeated here. The above process is iterated until the preset termination iteration condition for "creating the target workflow" is met. The preset termination iteration condition represents the pre-set iteration condition for terminating the automatic generation of the workflow. The preset termination iteration condition can be that the workflow is successfully created, the number of workflow creation failures exceeds a preset threshold, or other conditions that require termination occur. Thus, by using the parsing error information returned by the workflow engine as prompts to guide and constrain the natural language processing of the large language model, the powerful language understanding and generation capabilities of the large language model can endow the system with self-repair and adaptive capabilities. It can handle the compatibility issues between the LLM output and the downstream workflow engine, realizing full-link automated robust control from generation to deployment.
[0098] In this embodiment of the invention, by introducing the parsing error information corresponding to errors in the workflow definition model returned by the workflow engine into prompt words, targeted guidance and constraints on the large language model are further realized. The powerful language understanding and generation capabilities of the large language model are fully utilized to regenerate and correct the workflow definition model, thereby endowing the system with automatic self-repair and adaptation capabilities. This enables the automatic handling of compatibility issues between LLM output and downstream workflow engines, achieving full-link automated robust control of the workflow from generation to deployment. Furthermore, it can improve the accuracy, efficiency, intelligence, and automation of natural language processing for automatically generated workflows based on the large language model, thereby enhancing the generation efficiency of automatically generated workflows.
[0099] In one embodiment, the workflow definition model includes executable workflow code and a corresponding natural language version of the workflow specification document, which is generated synchronously by the large language model.
[0100] Explainedly, when the instruction big language model generates the corresponding workflow definition model, it not only automatically generates the executable workflow code included in the workflow definition model, but also simultaneously generates a natural language version of the workflow description document corresponding to the workflow code. That is, the workflow description document is generated synchronously by the big language model. The workflow description document is an auxiliary material prepared for humans (not machines) to explain, describe and supplement the executable workflow code using natural language (such as Chinese and English) or visual charts. The workflow description document includes, but is not limited to, business objectives and scope, participating roles and responsibilities, detailed explanations of process steps, descriptions of data fields and business rules, and content corresponding to exception handling.
[0101] For example, for a leave application process automatically generated by a large language model, the document generated by LLM can be as follows:
[0102] Employee Leave Application Process Instructions:
[0103] 1. Business objectives.
[0104] This process aims to standardize the electronic operation of employee leave applications and approvals, ensuring that the process is efficient, transparent, and traceable.
[0105] 2. Participating roles.
[0106] Applicant: The employee who initiated the leave request.
[0107] Department Manager: Responsible for approving leave applications from employees in their department.
[0108] HR Department: Responsible for filing and recording long holidays.
[0109] 3. Detailed explanation of the process steps. ...
[0111] Step 3: HR filing.
[0112] Executor: Automatically notified by the system.
[0113] Description: When the approved leave days exceed 3 days, the system will automatically send a notification to the HR department for attendance record filing. This step is completed automatically and does not require manual triggering.
[0114] Next step: Process ends.
[0115] Therefore, the output of the large language model is not only machine-executable code, but also human-readable documents. With the help of the large language model, "code + document" can be generated with one click, which greatly improves the efficiency of automatic workflow generation, avoids secondary document writing, and further improves the natural language processing efficiency of the large language model.
[0116] In this embodiment of the invention, by generating a corresponding natural language version of the workflow specification document while generating executable workflow code, the secondary documentation writing work of the workflow specification document can be avoided, thereby further improving the generation efficiency and quality of automatically generated workflows.
[0117] It should be noted that the workflow generation method for integrating large language models and knowledge bases described in the above embodiments can be recombined with the technical features included in different embodiments as needed to obtain a combined implementation scheme, but all of them are within the protection scope claimed by this invention.
[0118] In one embodiment, a workflow generation apparatus integrating a large language model and a knowledge base is provided. This apparatus corresponds one-to-one with the workflow generation method integrating a large language model and a knowledge base described in the above embodiments. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic block diagram of a workflow generation device that integrates a large language model and a knowledge base, provided as an embodiment of the present invention. Figure 5 As shown, the workflow generation device 50 integrating a large language model and knowledge base includes a first determining module 51, a first recognizing module 52, a first querying module 53, a first filling module 54, a first acquiring module 55, and a first creating module 56. The detailed descriptions of each of these functional modules are as follows:
[0119] The first determining module 51 is used to determine the workflow requirement description in natural language form;
[0120] The first identification module 52 is used to input the workflow requirement description into the context identification model, and the context identification model outputs the corresponding multi-dimensional context information. The context identification model is obtained based on the pre-training of a deep learning model.
[0121] The first query module 53 is used to generate a retrieval request based on the multi-dimensional context information, and use the retrieval request to query the enterprise's private knowledge base to obtain domain knowledge fragments related to workflow generation.
[0122] The first filling module 54 is used to obtain a structured prompt word template and fill the workflow requirement description, the multi-dimensional context information and the domain knowledge fragment into the corresponding fields of the structured prompt word template to generate target prompt words;
[0123] The first acquisition module 55 is used to input the target prompt word into the large language model to obtain the workflow definition model generated by the large language model;
[0124] The first creation module 56 is used to deploy the workflow definition model to the workflow engine, and then the workflow engine creates a target workflow based on the workflow definition model.
[0125] In one embodiment, the multi-dimensional context information includes at least one of the following: enterprise structure named entities identified based on the workflow requirement description; and process requirement information identified based on the workflow requirement description.
[0126] In one embodiment, the enterprise structure named entity is obtained by inputting the workflow requirement description into a named entity recognition model.
[0127] In one embodiment, the process requirement information is obtained by inputting the workflow requirement description into an emotional intent recognition model.
[0128] In one embodiment, the workflow generation device 50 that integrates a large language model and a knowledge base further includes:
[0129] The second acquisition module is used to acquire interactive prompt word templates for generating the workflow framework outline;
[0130] The second filling module is used to fill the workflow requirement description, the multi-dimensional context information and the domain knowledge fragment into the interaction prompt word template to generate interaction prompt words;
[0131] The third acquisition module is used to input the interactive prompt words into the large language model to obtain an initial workflow framework outline generated by the large language model. The initial workflow framework outline includes at least one of the following: workflow transition nodes, transition order, transition logic, and node tasks.
[0132] The first providing module is used to provide the initial workflow framework outline to the user and receive the user's confirmation of the initial workflow framework outline, or to receive the user's feedback on the modification of the initial workflow framework outline and the corresponding confirmation.
[0133] The first execution module is used to execute the step of "obtaining the structured prompt word template" when it receives confirmation from the user.
[0134] In one embodiment, the first filling module 54 is specifically used to take the user-confirmed initial workflow framework outline and / or the modification feedback made to the initial workflow framework outline as new domain knowledge fragments, and fill them together with the original workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments into the structured prompt word template to generate target prompt words.
[0135] In one embodiment, the first filling module 54 includes:
[0136] The first determining submodule is used to determine the workflow type identification prompt word template and embed the workflow requirement description into the corresponding field of the workflow type identification prompt word template to obtain the workflow type identification prompt word;
[0137] The first output submodule is used to input the workflow type identification prompt words into the large language model, and the instruction is output by the large language model to the target workflow type corresponding to the workflow requirement description;
[0138] The second determining submodule is used to determine the preset prompt word template corresponding to each preset workflow type. The preset workflow types include at least one of the following: administrative management, human resources and finance, production and manufacturing, customer service, IT operation and maintenance, and sales and marketing.
[0139] The first matching submodule is used to select the target template that best matches the target workflow type from a plurality of preset prompt word templates based on the correspondence between the preset workflow type and the preset prompt word template, so as to obtain a structured prompt word template.
[0140] In one embodiment, the workflow generation device 50 that integrates a large language model and a knowledge base further includes:
[0141] The third filling module is used to fill the corresponding fields of the structured prompt word template with the parsing error information returned by the workflow engine when the workflow engine parses the workflow definition model and an error occurs, so as to obtain the correction prompt word;
[0142] The fourth acquisition module is used to input the correction prompt words into the large language model and generate a correction workflow definition model;
[0143] The second creation module is used to deploy the modified workflow definition model to the workflow engine, and then the workflow engine creates the target workflow based on the modified workflow definition model.
[0144] Iterate through the above process until the preset termination condition for "Creating Target Workflow" is met.
[0145] In one embodiment, the workflow definition model includes executable workflow code and a corresponding natural language version of the workflow specification document, which is generated synchronously by the large language model.
[0146] This invention provides a workflow generation device that integrates a large language model (LLM) and a knowledge base. It acquires a user-provided workflow requirement description and, based on deep learning, identifies the multi-dimensional contextual information contained within it. It then retrieves enterprise-owned private knowledge bases based on this multi-dimensional contextual information to obtain domain knowledge fragments related to workflow generation. The workflow requirement description, multi-dimensional contextual information, and domain knowledge fragments are used as prompts to guide and constrain the large language model, generating a workflow definition model. Finally, a workflow engine is used to create a target workflow based on the workflow definition model, thus creatively integrating LLM, deep learning models, and a knowledge base (RAG). By leveraging deep learning and the enterprise's proprietary knowledge base, this system provides multi-dimensional, highly relevant contextual information for the LLM (Low-Low Flow Management) model. This enhances and constrains the automatic generation of LLM models, ultimately achieving end-to-end automatic transformation from unstructured user requirements to structured, executable workflow definitions. Based on natural language descriptions, it dynamically and intelligently generates workflows that align with the enterprise's actual situation and needs. This effectively overcomes the limitations of prompt words and LLM models, improves the accuracy of natural language processing in the automatic generation of workflows based on large language models, and ensures that the generated workflows are highly aligned with the enterprise's actual business needs, thereby enhancing the efficiency of automatic workflow generation.
[0147] Specific limitations regarding the workflow generation device for integrating large language models and knowledge bases can be found in the limitations of the workflow generation method for integrating large language models and knowledge bases mentioned above, and will not be repeated here. Each module in the aforementioned workflow generation device for integrating large language models and knowledge bases can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0148] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0149] The software tools or components not belonging to our company that appear in the embodiments of this invention are merely illustrative examples and do not represent actual use.
[0150] The data collection in this embodiment of the invention complies with the requirements of relevant laws and regulations, such as China's Personal Information Protection Law, GDPR (General Data Protection Regulation of the European Union), or information security standards of other countries and regions.
[0151] The data collection in this embodiment of the invention complies with the requirements of relevant laws and regulations, such as GDPR (General Data Protection Regulation of the European Union) or other national and regional information security standards.
[0152] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A workflow generation method integrating a large language model and a knowledge base, characterized in that, include: Define the workflow requirements description in natural language format; The workflow requirement description is input into the context recognition model, and the context recognition model outputs the corresponding multi-dimensional context information. The context recognition model is obtained based on the pre-training of a deep learning model. A retrieval request is generated based on the multi-dimensional context information, and the retrieval request is used to query the enterprise's private knowledge base to obtain domain knowledge fragments related to workflow generation. Obtain a structured prompt word template, and fill the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragment into the corresponding fields of the structured prompt word template to generate target prompt words; The target prompt words are input into the large language model to obtain the workflow definition model generated by the large language model; The workflow definition model is deployed to the workflow engine, and then the workflow engine creates the target workflow based on the workflow definition model.
2. The workflow generation method for integrating a large language model and a knowledge base as described in claim 1, characterized in that, The multi-dimensional contextual information includes at least one of the following: enterprise structure named entities identified based on the workflow requirement description; and process requirement information identified based on the workflow requirement description.
3. The workflow generation method for integrating a large language model and a knowledge base as described in claim 2, characterized in that, The enterprise structure named entity is obtained by inputting the workflow requirement description into the named entity recognition model.
4. The workflow generation method for integrating a large language model and a knowledge base as described in claim 2, characterized in that, The process requirement information is obtained by inputting the workflow requirement description into the emotion intent recognition model.
5. The workflow generation method for integrating a large language model and a knowledge base as described in claim 1, characterized in that, Before obtaining the structured prompt word template and filling the corresponding fields of the structured prompt word template with the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments to generate the target prompt word, the process also includes: Obtain interactive prompt templates for generating the workflow framework outline; The workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments are filled into the interaction prompt word template to generate interaction prompt words; The interactive prompts are input into the large language model to obtain an initial workflow framework outline generated by the large language model. The initial workflow framework outline includes at least one of the following: workflow transition nodes, transition order, transition logic, and node tasks. The system provides the initial workflow framework outline to the user and receives the user's confirmation of the initial workflow framework outline, or receives the user's feedback on the modification of the initial workflow framework outline and the corresponding confirmation. Upon receiving confirmation from the user, the step of "obtaining the structured prompt word template" is executed.
6. The workflow generation method for integrating a large language model and a knowledge base as described in claim 5, characterized in that, Obtain a structured prompt template, and fill the corresponding fields of the structured prompt template with the workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments to generate target prompts, including: The initial workflow framework outline confirmed by the user and / or the modification feedback made to the initial workflow framework outline are used as new domain knowledge fragments, and are filled into the structured prompt word template together with the original workflow requirement description, the multi-dimensional context information, and the domain knowledge fragments to generate target prompt words.
7. The workflow generation method for integrating a large language model and a knowledge base as described in claim 1, characterized in that, The process of obtaining the structured prompt word template includes: Determine the workflow type identification prompt template, and embed the workflow requirement description into the corresponding field of the workflow type identification prompt template to obtain the workflow type identification prompt; The workflow type identification prompt is input into the large language model, and the instruction is output by the large language model to the target workflow type corresponding to the workflow requirement description; Determine the preset prompt word template corresponding to each preset workflow type. The preset workflow types include at least one of the following: administrative management, human resources and finance, production and manufacturing, customer service, IT operation and maintenance, and sales and marketing. Based on the correspondence between the preset workflow type and the preset prompt word template, a target template that best matches the target workflow type is selected from multiple preset prompt word templates to obtain a structured prompt word template.
8. The workflow generation method for integrating a large language model and a knowledge base as described in claim 1, characterized in that, The method further includes: If the workflow engine encounters an error while parsing the workflow definition model, the parsing error information returned by the workflow engine is filled into the corresponding fields of the structured prompt word template to obtain the correction prompt word; The correction prompts are input into the large language model to generate a correction workflow definition model. The modified workflow definition model is deployed to the workflow engine, and then the workflow engine creates the target workflow based on the modified workflow definition model; Iterate through the above process until the preset termination condition for "creating the target workflow" is met.
9. The workflow generation method for integrating a large language model and a knowledge base as described in claim 1, characterized in that, The workflow definition model includes executable workflow code and a corresponding natural language version of the workflow specification document, which is generated synchronously by the large language model.
10. A workflow generation device integrating a large language model and a knowledge base, characterized in that, include: The first determination module is used to determine the workflow requirement description in natural language form; The first identification module is used to input the workflow requirement description into the context identification model, and the context identification model outputs the corresponding multi-dimensional context information. The context identification model is obtained based on the pre-training of a deep learning model. The first query module is used to generate a retrieval request based on the multi-dimensional context information, and use the retrieval request to query the enterprise's private knowledge base to obtain domain knowledge fragments related to workflow generation. The first filling module is used to obtain a structured prompt word template and fill the workflow requirement description, the multi-dimensional context information and the domain knowledge fragment into the corresponding fields of the structured prompt word template to generate target prompt words; The first acquisition module is used to input the target prompt word into the large language model to obtain the workflow definition model generated by the large language model; The first creation module is used to deploy the workflow definition model to the workflow engine, and then the workflow engine creates the target workflow based on the workflow definition model.
Citation Information
Patent Citations
Question and answer method and device based on large language model, medium and equipment
CN118568242A
Workflow engine data analysis method and system based on large model driving
CN119887102A
Question and answer mode scientific data processing workflow arrangement method and device based on large language model
CN120123378A
Method and system for automatic workflow generation by large language models
US20250068398A1
Shopping guide method and system based on large language model
WO2025118742A1
Cited By
Retrieval-driven workflow generation method and system for domain knowledge enhancement
CN121979536A