An agent prompt word generation method, device, equipment and storage medium

CN122819463APending Publication Date: 2026-09-25CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610966539.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0003]本发明提供一种智能体提示词生成方法、装置、设备及存储介质,以解决效率较低、准确性较差、无法有效生成可执行的智能体提示词的技术问题

Benefits of technology

[0008]上述智能体提示词生成方法、装置、设备及存储介质所实现的方案中,可以通过客户端获取当前需求文档,将所述当前需求文档进行分词处理,得到分词处理后的需求文档;利用训练完成后的文档识别模型对分词处理后的需求文档进行识别,得到业务流程节点、用户交互路径和系统响应逻辑,并输出结构化数据;其中,所述文档识别模型是通过根据历史需求文档和预训练模型训练得到的;根据业务流程节点和所述结构化数据,生成第一提示词;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122819463A_ABST
    Figure CN122819463A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses an agent prompt word generation method, device and equipment and a storage medium, which comprises the following steps: obtaining a current requirement document; performing word segmentation processing on the current requirement document to obtain a requirement document after word segmentation processing; identifying the requirement document after word segmentation processing by using a document recognition model after training, obtaining a business process node, a user interaction path and system response logic, and outputting structured data; generating first prompt words according to the business process node and the structured data; generating second prompt words according to the user interaction path and the system response logic; and taking the first prompt words and the second prompt words as a whole to form complete agent prompt words. The application can be applied to the question and answer scene of financial technology and medical health, improves the executable of the prompt words, and can improve the accuracy and efficiency of generating the prompt words.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence technology and natural language processing technology, and in particular to a method, apparatus, device and storage medium for generating intelligent agent prompt words. Background Technology

[0002] In the fields of fintech and healthcare, there is a development of application software and the construction of intelligent systems. Currently, in the process of software development and intelligent system construction, the processing of requirements documents typically relies on manual content extraction and logical analysis, which is inefficient and prone to missing key information, especially in scenarios involving complex business logic and interaction processes, making it difficult to guarantee accuracy. While some Natural Language Processing (NLP) tools exist for document summarization and keyword extraction, these methods often lack a deep understanding of business logic and interaction processes, and cannot effectively generate executable agent prompts. Summary of the Invention

[0003] This invention provides a method, apparatus, device, and storage medium for generating intelligent agent prompts, in order to solve the technical problems of low efficiency, poor accuracy, and inability to effectively generate executable intelligent agent prompts.

[0004] Firstly, a method for generating intelligent agent prompt words is provided, including: Get the current requirements document; The current requirement document is segmented into words to obtain the segmented requirement document. The trained document recognition model is used to identify the segmented requirement document to obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; Based on the business process nodes and the structured data, generate a first prompt word; Based on the user interaction path and the system response logic, a second prompt word is generated; The first prompt word and the second prompt word are combined as a whole to form a complete agent prompt word.

[0005] Secondly, an intelligent agent prompt word generation device is provided, comprising: The requirements document retrieval module is used to retrieve the current requirements document; The word segmentation module is used to segment the current requirement document into words to obtain the segmented requirement document. The document recognition module is used to identify the segmented requirement document using the trained document recognition model, obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; The first prompt word generation module is used to generate a first prompt word based on the business process node and the structured data; The second prompt word generation module is used to generate a second prompt word based on the user interaction path and the system response logic; The prompt word formation module takes the first prompt word and the second prompt word as a whole to form a complete intelligent agent prompt word.

[0006] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described intelligent agent prompt generation method.

[0007] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described intelligent agent prompt generation method.

[0008] In the above-mentioned intelligent agent prompt word generation method, device, equipment, and storage medium, the current requirement document can be obtained through a client, and the current requirement document can be segmented to obtain a segmented requirement document; the segmented requirement document can be identified using a trained document recognition model to obtain business process nodes, user interaction paths, and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; and a first prompt word is generated based on the business process nodes and the structured data. Based on the user interaction path and the system response logic, a second prompt word is generated. The first and second prompt words are then combined to form a complete intelligent agent prompt word, which is fed back to the client. In this invention, for intelligent question-answering engines in various application scenarios in the fintech and healthcare fields, a trained document recognition model is used to identify the segmented requirement document, obtaining business process nodes, user interaction paths, and system response logic, and outputting structured data. Based on the business process nodes and structured data, a first prompt word is generated. Based on the user interaction path and system response logic, a second prompt word is generated. The first and second prompt words are combined to form a complete intelligent agent prompt word, which contains information about the user interaction path and system response logic, improving the executability of the prompt word. Automated processing of the requirement document improves the efficiency of prompt word generation. The trained document recognition model can identify business process nodes, user interaction paths, and system response logic, reducing logical errors in the prompt word and thus improving its accuracy. Attached Figure Description

[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a schematic diagram of an application environment for the intelligent agent prompt word generation method in one embodiment of the present invention.

[0011] Figure 2 This is a flowchart illustrating a method for generating intelligent agent prompts in one embodiment of the present invention.

[0012] Figure 3 This is a schematic diagram of the intelligent agent prompt word generation device in one embodiment of the present invention.

[0013] Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention.

[0014] Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] The intelligent agent prompt word generation method provided in this embodiment of the invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can obtain the current requirement document from the client, perform word segmentation on the current requirement document to obtain a segmented requirement document; use a trained document recognition model to identify the segmented requirement document, obtain business process nodes, user interaction paths, and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; based on the business process nodes and the structured data, a first prompt word is generated; based on the user interaction path and the system response logic, a second prompt word is generated; the first prompt word and the second prompt word are combined as a whole to form a complete intelligent agent prompt word, which is fed back to the client. In this invention, intelligent agents are used in various application scenarios in the fields of fintech and healthcare. This question-answering engine utilizes a trained document recognition model to identify segmented requirement documents, obtaining business process nodes, user interaction paths, and system response logic, and outputting structured data. Based on the business process nodes and structured data, it generates a first prompt word; based on the user interaction path and system response logic, it generates a second prompt word. The first and second prompt words, as a whole, form a complete intelligent agent prompt word, which contains information about the user interaction path and system response logic, improving the executability of the prompt words. Automated processing of requirement documents improves the efficiency of prompt word generation. The trained document recognition model can identify business process nodes, user interaction paths, and system response logic, reducing logical errors in the prompt words and thus improving their accuracy. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0017] Please see Figure 2 As shown, Figure 2 A flowchart illustrating the intelligent agent prompt word generation method provided in this embodiment of the invention includes the following steps: S10: Obtain the current requirements document.

[0018] The intelligent agent prompt word generation method provided by this invention can be applied to intelligent question answering engines in various application scenarios in the fields of fintech and healthcare. Intelligent question answering engines are usually implemented through a server. The server can generate a first prompt word and a second prompt word in real time based on the current requirement document. The first prompt word and the second prompt word are used as a whole to form an intelligent agent prompt word. Inputting the intelligent agent prompt word into the intelligent agent can output the result required by the current requirement document.

[0019] It should be noted that the current requirements document can be a document developed to implement a specific functional requirement, such as a document developed to implement a user login function.

[0020] S20: Perform word segmentation on the current requirement document to obtain the word segmentation requirement document.

[0021] It should be noted that word segmentation is performed on the current requirements document. Specifically, the current requirements document can be segmented into Chinese words. For example, "user login function" can be segmented to obtain the segmented results such as "user", "login", and "function". Word segmentation tools such as jieba can be used, combined with a domain dictionary for professional terminology recognition.

[0022] S30: Use the trained document recognition model to identify the segmented requirement document, obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model.

[0023] As one implementation method, the trained document recognition model is used to identify the segmented requirement document. Specifically, it can identify business process nodes, such as "register", "login", and "place an order", by extracting verb-object phrases and classifying intents. Specifically, it can identify user interaction paths by analyzing the interaction patterns between "users and the system", such as extracting interactive verbs like "click", "input", and "select". Specifically, it can identify system response logic, such as "display", "jump", and "verify", by recognizing feedback from "system to user".

[0024] As one implementation method, the trained document recognition model is used to identify the segmented requirement document to obtain business process nodes. Specifically, sentence components such as subject, predicate, object, attributive, and adverbial can be identified, and then verb-object structures such as "click button" and "submit form" can be extracted to obtain business process nodes. For example, for an insurance business platform in the fintech field, the user interface of the insurance business platform, including content pinning management, pinned list display, adding pinned content, editing pinned content, and unpinning content, can all be used as business process nodes. Among them, the content pinning management function can be the first-level business process node, and the pinned list display, adding pinned content, editing pinned content, and unpinning content can be the second-level business process nodes. By constructing a syntactic dependency tree through different levels of business process nodes, it is easier to determine the order of business logic later. Business process nodes can determine the core task of prompt words, user interaction paths can determine the dialogue flow that the agent needs to simulate, and system response logic can determine the agent's response strategy and branching conditions.

[0025] As one implementation method, the trained document recognition model is used to identify the segmented requirement document to obtain the user interaction path and system response logic. The user interaction path refers to the user's interaction with the page (user operations on the page), such as querying the list of pinned content, adding pinned content, editing pinned content, and unpinning pinned content. The system response logic can be the response logic of the API (Application Programming Interface) call interface to Vuex (the state management tool). After the user operates on the page, the page requests data from Vuex (the state management tool), Vuex calls the API, the API returns data to Vuex, and Vuex returns the corresponding data to the page.

[0026] As an example, a user sends a command to the page to query the list of pinned content. The page requests the list data from Vuex, and Vuex calls the `getList` interface from the API. The API returns the list data to Vuex, and Vuex updates the list data on the page. A user sends a command to the page to add pinned content. The page requests the `onRelease` interface from Vuex, and the API returns the result; the page then refreshes the list data in Vuex. A user sends a command to the page to edit pinned content. The page requests the `onRelease` interface from Vuex, and the API returns the result; the page then refreshes the list data in Vuex. A user sends a command to the page to remove pinned content. The page requests the `cancel` interface from Vuex, and the API returns the result; the page then refreshes the list data in Vuex.

[0027] As an example, the structured data includes {"action": "User Registration", "steps": [ {"step":1, "action": "Enter Mobile Number", "element": "Mobile Number Input Box"}, {"step": 2, "action": "Click to Register", "element": "Register Button"}, {"step": 3, "action": "Receive Verification Code", "channel": "SMS"}, {"step": 4, "action": "Enter Verification Code", "element": "Verification Code Input Box"}, {"step": 5, "action": "Complete Registration", "result": "Account Created Successfully"}]}. In the above structured data, `action` represents the action, `element` represents the element, `steps` represents the execution order, and `result` represents the result.

[0028] Step 30, the training process of the document recognition model, includes: Obtain historical requirement documents marked with business process nodes and interaction paths; The pre-trained model is trained using supervised learning based on the historical requirement documents, with business process node recognition, user interaction path recognition, and system response logic recognition as training objectives, to obtain the document recognition model after training.

[0029] It should be noted that the pre-trained model can be BERT / RoBERTa, etc. Regarding the structure of BERT and RoBERTa models, both are based on a bidirectional Transformer Encoder (multi-layer self-attention plus a feedforward network), without a decoder. The specific structure includes embeddings, an encoder, and a pooler. The encoder typically has 12 or 24 layers, and multi-head self-attention enables bidirectional context modeling. The pooler takes [CLS] vectors for downstream tasks such as classification. Compared to the BERT model, the RoBERTa model removes the NSP (Next Sentence Prediction) task, dynamic masking, larger batch / data, and byte-level BPE, resulting in more thorough training while maintaining a largely consistent structure. On large-scale unlabeled corpora, a masked language model is used for self-supervised learning. For downstream tasks, pre-trained weights are loaded, task heads are added, and all parameters are trained again with a small amount of labeled data. BERT and RoBERTa achieve powerful general-purpose language understanding capabilities through deep bidirectional Transformers, MLM pre-training, and fine-tuning.

[0030] In this embodiment, historical requirement documents are retrieved after the business process nodes and interaction paths have been marked. The pre-trained model is trained using supervised learning based on historical requirement documents. The training objectives are business process node recognition, user interaction path recognition, and system response logic recognition. This results in a document recognition model that can more accurately identify business logic and interaction paths, reduce the logic error rate, and improve the accuracy of generated prompt words (first prompt word and second prompt word).

[0031] In some embodiments, after obtaining the historical requirements document marked with business logic nodes and interaction paths, the process includes: The historical requirement documents are standardized based on a preset business rule template, so that the historical requirement documents meet the format of the preset business rule template, resulting in standardized historical requirement documents.

[0032] As one implementation method, the preset business rule template can be set according to the actual situation. For example, the conditional logic statements can be standardized into "if...then..." or "when...trigger...".

[0033] In this embodiment, historical requirement documents are standardized based on a preset business rule template, so that the historical requirement documents meet the format of the preset business rule template and are obtained as standardized historical requirement documents. This can improve the efficiency of training the model and improve the accuracy of model recognition.

[0034] S40: Generate a first prompt word based on the business process node and the structured data.

[0035] It should be noted that the first prompt includes business process nodes and structured data. For example, the business process node is user login, and the structured data is the data under the user login process node.

[0036] In step S40, a first prompt word is generated based on the business process node and the structured data, including: Select the corresponding preset prompt word template according to the business process node; The structured data is filled into the preset prompt word template, and the paragraphs are adjusted according to the business logic order of the structured data; Add role definitions and output format constraints to generate the first prompt word.

[0037] As an example, considering a telemedicine scenario in the healthcare field, the specific business logic is user login, generating the prompt: "You are a remote medical intelligent customer service assistant." User intent: Account login. Required parameters: Username / phone number, password, verification code. Interaction flow: 1. Ask the user for their login method (account or phone number), 2. Verify the user's entered credentials, 3. If a verification code is required, send and verify the code, 4. After successful login, guide the user to the homepage. Output requirements: JSON format, including intent, entities, and response. Wherein, business logic: User login can be a business process node, and the order of business logic can be determined based on the constructed syntactic dependency tree or the logical relationships between multiple different business process nodes.

[0038] It should be noted that role definition can be used to specify in the instructions given to the intelligent agent (large model) what "identity / perspective / profession / personality" it uses to understand and answer questions. For example, in the example above, "You are an intelligent customer service assistant for an insurance platform" is a role definition.

[0039] In step S40, a first prompt word is generated based on the business process node and the structured data, including: Based on the business process nodes and the structured data, multiple third prompt words are generated, and the first semantic similarity between any two of the third prompt words is obtained; If the first semantic similarity is greater than the preset first similarity threshold, then the two third prompt words are merged to obtain the first prompt word.

[0040] As one implementation method, multiple third prompt words may be generated based on the business process nodes and the structured data. It is necessary to obtain the first semantic similarity between any two third prompt words. If the first semantic similarity is greater than a preset first similarity threshold, the two third prompt words are merged to obtain the first prompt word. When merging two first prompt words, one of the prompt words can be selected, and the first similarity threshold can be 0.8. If the first semantic similarity is not greater than the preset first similarity threshold, an optimization reminder can be triggered to supplement missing semantics, correct ambiguous expressions, and regenerate the first prompt word.

[0041] In this embodiment, multiple third prompt words are generated through business process nodes and structured data, and the first semantic similarity between any two third prompt words is obtained. If the first semantic similarity is greater than a preset first similarity threshold, the two first prompt words are merged to obtain a first prompt word. After merging multiple third prompt words, a first prompt word is finally obtained, which improves the accuracy of generating the first prompt word and helps to improve the accuracy of the final intelligent agent's output results.

[0042] S50: Generate a second prompt word based on the user interaction path and the system response logic.

[0043] Step S50: Based on the user interaction path and the system response logic, generate a second prompt word, including: Based on the user interaction path and the system response logic, multiple fourth prompt words are generated, and the second semantic similarity between any two of the fourth prompt words is obtained; If the second semantic similarity is greater than the preset second similarity threshold, then the two corresponding fourth prompt words will be merged to obtain the second prompt word.

[0044] In this embodiment, multiple fourth prompt words are generated based on the user interaction path and system response logic. The second semantic similarity between any two fourth prompt words is obtained. If the second semantic similarity is greater than a preset second similarity threshold, the two fourth prompt words are merged to obtain a second prompt word. After merging multiple fourth prompt words, a single second prompt word is finally obtained, which improves the accuracy of generating the second prompt word and helps to improve the accuracy of the final intelligent agent's output results.

[0045] As one implementation method, multiple fourth prompt words are generated based on the user interaction path and the system response logic. The second semantic similarity between any two fourth prompt words is obtained. If the second semantic similarity is greater than a preset second similarity threshold, the two fourth prompt words are merged to obtain a second prompt word. When merging two second prompt words, one of the prompt words can be selected, and the second similarity threshold can be 0.8. If the second semantic similarity is not greater than the preset second similarity threshold, an optimization reminder can be triggered to supplement missing semantics and correct ambiguous expressions. Contextual consistency checks can be performed on the second prompt words. Specifically, this involves checking whether the entities mentioned before and after the prompt word are consistent (e.g., mixing "user" and "customer"), verifying the logical coherence between steps, and detecting whether branch conditions cover all scenarios.

[0046] In step S50, after generating the second prompt word based on the user interaction path and the system response logic, the method further includes: Convert the second prompt word into a preset JSON format or a preset XML format; Create a new version in the preset repository and record the change log; Configure the API key and deploy the first and second prompt words in the test environment to verify the second prompt word.

[0047] In this embodiment, the first prompt word and the second prompt word are deployed as a whole into the intelligent agent system, and the execution effect and logical integrity of the second prompt word are verified by simulating user interaction process and response logic.

[0048] As an example, the test scenario is a user login function. The test steps are as follows: Simulate a user entering "I want to log in to my account"; the agent recognizes the intent as "login"; triggers a prompt, asking for the login method; the user selects "login with mobile number"; the agent responds correctly; simulates entering an incorrect verification code; verifies the accuracy of the error message; enters the correct verification code; verifies the successful login process. Verification metrics can be set, such as intent recognition accuracy ≥ 95%, consistency between response content and prompt ≥ 90%, and 100% completeness of the interaction process.

[0049] In step S50, after generating the second prompt word based on the user interaction path and the system response logic, the method further includes: Extract interactive nodes from the structured data; Determine the business logic sequence based on the business process nodes, establish the connection relationship between the interaction nodes based on the business logic sequence, and construct the connection edges. The interactive nodes and the connecting edges are converted into text code drawing format to generate a visual flowchart.

[0050] It should be noted that the above-mentioned visual flowchart may include the content of the first prompt and the content of the second prompt. The visualization process may also include branching, i.e., identifying conditional branches and generating corresponding branch paths. The text code drawing format can be a markup language format for text code drawing. Specifically, an editor / platform can render this markup language into a graph, and the text code drawing format can be Mermaid.

[0051] As an example, the text code for graphing can include graph TD, A [Start] --> B {Select login method}, B -->|username and password| C [Enter username and password], B -->|mobile number| D [Enter mobile number], C --> E {Verification successful?}, D --> F [Get verification code], F --> G [Enter verification code], G --> E, E -->|Yes| H [Login successful], E -->|No| I [Prompt error].

[0052] In this embodiment, the generated flowchart can intuitively display the interaction path, making it easier for developers to perform logic verification and debugging, and shortening the development cycle.

[0053] As can be seen, in the above solution, the intelligent question-answering engine for various application scenarios in the fintech and healthcare fields utilizes a trained document recognition model to identify the segmented requirement documents, obtaining business process nodes, user interaction paths, and system response logic, and outputting structured data. Based on the business process nodes and structured data, a first prompt word is generated; based on the user interaction path and system response logic, a second prompt word is generated; the first and second prompt words are combined as a whole to form a complete intelligent agent prompt word, which contains information about the user interaction path and system response logic, improving the executability of the prompt words; automating the processing of requirement documents can improve the efficiency of prompt word generation; and the trained document recognition model can identify business process nodes, user interaction paths, and system response logic, reducing logical errors in the prompt words and thus improving the accuracy of the generated prompt words.

[0054] The intelligent agent prompt word generation method provided in this invention reduces the workload of manual intervention by automating the processing of requirement documents, and can improve processing speed by more than 50%. Combined with a model, it can more accurately identify business logic and interaction paths, reducing the logic error rate to below 10%. The generated prompt words are more consistent with actual business scenarios, improving the accuracy and consistency of the intelligent agent's response in complex interactions. This method is applicable to various types of requirement documents, possesses good versatility and scalability, and can be widely applied in fields such as intelligent customer service, intelligent assistants, and automated processes.

[0055] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0056] In one embodiment, an agent prompt word generation device is provided, which corresponds one-to-one with the agent prompt word generation method in the above embodiments. For example... Figure 3 As shown, the intelligent agent prompt word generation device includes a requirement document acquisition module 101, a word segmentation module 102, a document recognition module 103, a first prompt word generation module 104, a second prompt word generation module 105, and a prompt word formation module 106. Detailed descriptions of each functional module are as follows: The requirement document acquisition module 101 is used to acquire the current requirement document; The word segmentation module 102 is used to perform word segmentation on the current requirement document to obtain the word segmented requirement document. The document recognition module 103 is used to recognize the segmented requirement document using the trained document recognition model, obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; The first prompt word generation module 104 is used to generate a first prompt word based on the business process node and the structured data; The second prompt word generation module 105 is used to generate a second prompt word based on the user interaction path and the system response logic; The prompt word formation module takes the first prompt word and the second prompt word as a whole to form a complete intelligent agent prompt word.

[0057] In one embodiment, the intelligent agent prompt word generation device further includes a model training module, which is used for: Obtain historical requirement documents marked with business process nodes and interaction paths; The pre-trained model is trained using supervised learning based on the historical requirement documents, with business process node recognition, user interaction path recognition, and system response logic recognition as training objectives, to obtain the document recognition model after training.

[0058] In one embodiment, the first prompt word generation module 104 generates a first prompt word based on the business process node and the structured data, including: Select the corresponding preset prompt word template according to the business process node; The structured data is filled into the preset prompt word template, and the paragraphs are adjusted according to the business logic order of the structured data; Add role definitions and output format constraints to generate the first prompt word.

[0059] In one embodiment, the first prompt word generation module 104 generates a first prompt word based on the business process node and the structured data, including: Based on the business process nodes and the structured data, multiple third prompt words are generated, and the first semantic similarity between any two of the third prompt words is obtained; If the first semantic similarity is greater than the preset first similarity threshold, then the two corresponding first prompt words will be merged to obtain the first prompt word; In one embodiment, the second prompt word generation module 105 generates a second prompt word based on the user interaction path and the system response logic, including: Based on the user interaction path and the system response logic, multiple fourth prompt words are generated, and the second semantic similarity between any two of the fourth prompt words is obtained; If the second semantic similarity is greater than the preset second similarity threshold, then the two corresponding fourth prompt words will be merged to obtain the second prompt word.

[0060] In one embodiment, the intelligent agent prompt word generation device further includes a verification module, which is used for: After generating the second prompt word based on the user interaction path and the system response logic, Convert the second prompt word into a preset JSON format or a preset XML format; Create a new version in the preset repository and record the change log; Configure the API key, deploy the first prompt word and the second prompt word in the test environment, and verify the second prompt word.

[0061] In one embodiment, the intelligent agent prompt word generation device further includes a visualization module, which is used for: After generating the second prompt word based on the user interaction path and the system response logic, Extract interactive nodes from the structured data; Determine the business logic sequence based on the business process nodes, establish the connection relationship between the interaction nodes based on the business logic sequence, and construct the connection edges. The interactive nodes and the connecting edges are converted into text code drawing format to generate a visual flowchart.

[0062] In one embodiment, the intelligent agent prompt word generation device further includes a standardization module, which is used for: The historical requirement documents are standardized based on a preset business rule template, so that the historical requirement documents meet the format of the preset business rule template, resulting in standardized historical requirement documents.

[0063] This invention provides an intelligent agent prompt word generation device. It utilizes a trained document recognition model to identify segmented requirement documents, obtaining business process nodes, user interaction paths, and system response logic, and outputting structured data. Based on the business process nodes and structured data, a first prompt word is generated; based on the user interaction path and system response logic, a second prompt word is generated. The first and second prompt words, as a whole, form a complete intelligent agent prompt word, which contains information about the user interaction path and system response logic, improving the executability of the prompt word. Automated processing of the requirement document improves the efficiency of prompt word generation. The trained document recognition model can identify business process nodes, user interaction paths, and system response logic, reducing logical errors in the prompt words and thus improving their accuracy.

[0064] Specific limitations regarding the agent prompt generation device can be found in the limitations of the agent prompt generation method described above, and will not be repeated here. Each module in the aforementioned agent prompt generation device 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.

[0065] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a server-side intelligent agent prompt word generation method.

[0066] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the client-side functions or steps of an intelligent agent prompt word generation method.

[0067] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Get the current requirements document; The current requirement document is segmented into words to obtain the segmented requirement document. The trained document recognition model is used to identify the segmented requirement document to obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; Based on the business process nodes and the structured data, generate a first prompt word; Based on the user interaction path and the system response logic, a second prompt word is generated; The first prompt word and the second prompt word are combined as a whole to form a complete agent prompt word.

[0068] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: Get the current requirements document; The current requirement document is segmented into words to obtain the segmented requirement document. The trained document recognition model is used to identify the segmented requirement document to obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; Based on the business process nodes and the structured data, generate a first prompt word; Based on the user interaction path and the system response logic, a second prompt word is generated; The first prompt word and the second prompt word are combined as a whole to form a complete agent prompt word.

[0069] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0070] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0071] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0072] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0073] The above-described 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 the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for generating prompt words for an intelligent agent, characterized in that, include: Get the current requirements document; The current requirement document is segmented into words to obtain the segmented requirement document. The trained document recognition model is used to identify the segmented requirement document to obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; Based on the business process nodes and the structured data, generate a first prompt word; Based on the user interaction path and the system response logic, a second prompt word is generated; The first prompt word and the second prompt word are combined as a whole to form a complete agent prompt word.

2. The intelligent agent prompt word generation method according to claim 1, characterized in that, The training process of the document recognition model includes: Obtain historical requirement documents marked with business process nodes and interaction paths; The pre-trained model is trained using supervised learning based on the historical requirement documents, with business process node recognition, user interaction path recognition, and system response logic recognition as training objectives, to obtain the document recognition model after training.

3. The intelligent agent prompt word generation method according to claim 1, characterized in that, Based on the business process nodes and the structured data, a first prompt word is generated, including: Select the corresponding preset prompt word template according to the business process node; The structured data is filled into the preset prompt word template, and the paragraphs are adjusted according to the business logic order of the structured data; Add role definitions and output format constraints to generate the first prompt word.

4. The intelligent agent prompt word generation method according to claim 1, characterized in that, The step of generating a first prompt word based on the business process node and the structured data includes: Based on the business process nodes and the structured data, multiple third prompt words are generated, and the first semantic similarity between any two of the third prompt words is obtained; If the first semantic similarity is greater than the preset first similarity threshold, then the two corresponding third prompt words will be merged to obtain the first prompt word; The second prompt word is generated based on the user interaction path and the system response logic. include, Based on the user interaction path and the system response logic, multiple fourth prompt words are generated, and the second semantic similarity between any two of the fourth prompt words is obtained; If the second semantic similarity is greater than the preset second similarity threshold, then the two corresponding fourth prompt words will be merged to obtain the second prompt word.

5. The intelligent agent prompt word generation method according to claim 1, characterized in that, After generating the second prompt word based on the user interaction path and the system response logic, the process further includes: Convert the second prompt word into a preset JSON format or a preset XML format; Create a new version in the preset repository and record the change log; Configure the API key, deploy the first prompt word and the second prompt word in the test environment, and verify the second prompt word.

6. The intelligent agent prompt word generation method according to claim 1, characterized in that, After generating the second prompt word based on the user interaction path and the system response logic, the process further includes: Extract interactive nodes from the structured data; Determine the business logic sequence based on the business process nodes, establish the connection relationship between the interaction nodes based on the business logic sequence, and construct the connection edges. The interactive nodes and the connecting edges are converted into text code drawing format to generate a visual flowchart.

7. The intelligent agent prompt word generation method according to claim 2, characterized in that, After obtaining the historical requirements document with business logic nodes and interaction paths marked, it includes: The historical requirement documents are standardized based on a preset business rule template, so that the historical requirement documents meet the format of the preset business rule template, resulting in standardized historical requirement documents.

8. A device for generating prompt words for an intelligent agent, characterized in that, include: The requirements document retrieval module is used to retrieve the current requirements document; The word segmentation module is used to segment the current requirement document into words to obtain the segmented requirement document. The document recognition module is used to identify the segmented requirement document using the trained document recognition model, obtain business process nodes, user interaction paths and system response logic, and output structured data; wherein, the document recognition model is trained based on historical requirement documents and a pre-trained model; The first prompt word generation module is used to generate a first prompt word based on the business process node and the structured data; The second prompt word generation module is used to generate a second prompt word based on the user interaction path and the system response logic; The prompt word formation module takes the first prompt word and the second prompt word as a whole to form a complete intelligent agent prompt word.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the agent prompt word generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the agent prompt word generation method as described in any one of claims 1 to 7.