Method for enhancing RPA digital employee planning ability based on retrieval enhancement generation mode
By introducing a method based on retrieval enhancement generation method among RPA digital employees, using RAG technology to rewrite problem and match information, the problems of high development costs and low data quality of existing RPA digital employees are solved, and more efficient task planning and execution capabilities are achieved.
Patent Information
- Application Number
- CN202411877439.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing RPA digital employees are difficult to effectively improve their planning and execution capabilities due to the high development costs, low industry data quality, high code model training requirements and strict evaluation indicators.
Using a method based on retrieval enhancement generation method, the user inputs questions and dialogue history, combined with the RAG's domain knowledge base and scenario knowledge base, problem rewrites and information matching are carried out, high-quality prompt words are generated, and the task planning and execution capabilities of digital employees are improved.
Through RAG technology, digital employees can provide high-quality prompt words in complex business scenarios, improve task planning, execution and answering capabilities, reduce redundancy and hallucination phenomena, and enhance the discipline and enterprise knowledge capabilities of multi-agents.
Smart Images

Figure CN119831017A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of RPA digital employees, and in particular to a method for enhancing the planning capability of RPA digital employees based on a retrieval-enhanced generation method. Background Art
[0002] RPA is an automated process based on software technology that can simulate manual operations and enable robots to perform daily operations in an enterprise. It mainly includes the following steps: data input, data processing, decision-making and data output. Through RPA technology, enterprises can automate tedious, repetitive and low-value work, improve work efficiency and accuracy, liberate human resources and reduce enterprise costs.
[0003] Large language models are becoming increasingly powerful, with human-like reasoning and task planning capabilities. Therefore, the implantation of multi-agents based on these models into RPA digital employees has also become a development direction for corporate research. At present, large language models have made significant progress in the field of multi-agents, and many excellent open source projects have emerged, such as MetaGPT, AutoGen, and XAgent, all of which have performed well.
[0004] Based on the multi-agent framework, intelligent RPA digital employees are designed in three main types:
[0005] 1. RPA based on natural language to generate business processes: This solution uses a large language model to automatically generate business processes and RPA scripts to achieve end-to-end intelligent automation. For example, iFlytek's Spark model can generate business processes based on natural language to help enterprise employees complete a large amount of repetitive work.
[0006] 2. RPA platform that automatically generates processes: Through NLP and process mining technology, RPA process files are automatically generated, which greatly shortens the development cycle and reduces implementation costs. At the same time, it supports monitoring and control of other brands of RPA and has strong scalability.
[0007] 3. Combination of intelligent dialogue management and RPA: This solution uses digital employees driven by large language models and combines them with RPA to achieve automated customer service and operation management. For example, Juzi Interactive Technology's solution covers the entire process from data processing to dialogue management, and has the advantages of large model drive, RPA automation, and intelligent dialogue management.
[0008] The main disadvantages of the above existing solutions are:
[0009] 1. High development cost, involving model training, system design, framework design, and requiring high computing power;
[0010] 2. High-quality industry data is scarce and difficult to collect;
[0011] 3. The code model training requirements are high, the evaluation indicators are harsh, and the code execution pass rate is low. Summary of the invention
[0012] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and provide a method for enhancing the RPA digital employee planning capability based on retrieval enhancement generation.
[0013] The purpose of the present invention is achieved through the following technical solutions:
[0014] The method for enhancing the RPA digital employee planning capability based on the retrieval enhancement generation method includes the following steps:
[0015] S1. The user inputs the current question, and the conversation history records are input into the digital employee conversation system in the form of a sliding window, retaining only the most recent k rounds of conversation records;
[0016] S2. Based on the user's current question and historical conversations, determine whether it is a business scenario-related question:
[0017] If it is judged as not, the user's question will be rewritten based on historical conversations, input into RAG's domain knowledge base for matching, and the topk related documents will be returned to the big model to answer the user's question;
[0018] If the answer is yes, the user's question will be rewritten based on historical conversations and input into the RAG scenario knowledge base for matching, and relevant business information and required digital employee information will be returned to the planned digital employee;
[0019] S3. Input the rewritten questions, business information, and digital employee information to the planning digital employee for task planning. Each subtask must clearly specify the digital employee x, what tools are needed, and what tasks are to be completed.
[0020] S4, planning digital employees to assign subtasks one by one to corresponding digital employees x for execution;
[0021] S5. Digital employee x executes tasks, runs RAG's RPA component library, matches the best RPA component information, and assembles parameters to form an executable RPA tool.
[0022] S6. Repeat S4-S5 until all subtasks are completed. If the RPA tool requires the user to fill in parameters, it needs to be returned to the user for filling and confirmation; otherwise, the RPA tool is executed directly;
[0023] S7. Finally, the results of RPA execution are returned to the planning digital employee, summarized and output to the user.
[0024] In step S2, the user's question is rewritten in combination with the historical conversation, which is specifically achieved in the following way:
[0025] Combine the most recent K rounds of conversation information between the user and the big model, and then let the big model rewrite the current question based on this conversation information, so that the user's question has certain contextual information, thereby increasing the accuracy of RAG matching.
[0026] The matching in step S2 or S5 is done through text retrieval of RAG:
[0027] (1) There are two matching methods:
[0028] The first multi-query search engine rewrites the user input question text into multiple questions by synonyms, and then converts these questions into vectors, calculates the cosine similarity between them and the vectors in the local knowledge base, sorts them from high to low according to the cosine similarity, and selects the first k texts with higher scores as the first matching results;
[0029] The second method uses the BM25 algorithm to match the user input question text with the local knowledge base, sorts them from high to low according to the matching value, and selects the top k texts with higher scores, which are recorded as the second matching results;
[0030] (2) weighted merging of the first matching result and the second matching result;
[0031] (3) Using hybrid rearrangement to calculate the scores of the weighted merged documents and sort them;
[0032] (4) After threshold screening, the final topK documents are returned.
[0033] In step (1), the cosine similarity (A, B) between the question text input by the user and the vector in the local knowledge base is calculated as follows:
[0034]
[0035] Among them, A and B are the vector of the user input question text and the vector in the local knowledge base respectively, · represents the dot product of the vectors, ||A|| and ||B|| represent the norm of vector A and the norm of vector B.
[0036] In step (1), the matching value BM25(D,Q) between the local knowledge base and the question text input by the user is calculated as follows:
[0037]
[0038] Where D is the local knowledge base, Q is the question text input by the user, n is the number of words in the question text input by the user, and qi For the i-th word in the user input question text, f(q i ,D) is q i The frequency of words in D; |D| is the number of words in D, avgd1 is the average document length of D, N represents the total number of documents in D, n(qi) represents the number of documents in D containing qi, k1 and k2 represent weight parameters, and b is the parameter used to adjust the length of documents in D.
[0039] In step (3), the score RRFscore(d∈D) of the weighted merged document is calculated as follows:
[0040]
[0041] Where D is the local knowledge base, Q is the user input question text, r(Q) is the set of retrievers, R is a set of rankings as 1...|D|, and k is a constant greater than or equal to 1.
[0042] At the same time, the present invention provides:
[0043] A server includes a processor and a memory, wherein the memory stores at least one program, and the program is loaded and executed by the processor to implement the above-mentioned method for enhancing the RPA digital employee planning capability based on retrieval enhancement generation.
[0044] A computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the above-mentioned method for enhancing the RPA digital employee planning capability based on retrieval-enhanced generation.
[0045] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0046] This invention can be roughly classified as the technical path of "combining intelligent dialogue management with RPA". In terms of task planning, the corresponding system design is targeted at RPA scenarios. The entire process only requires the use of the general capabilities of the model + prompts in specific scenarios. In terms of planning capabilities and task execution, the RAG method is used to make up for the background knowledge of prompts, so that digital employees can be more accurate when they are called.
[0047] Through the RAG method, the present invention can provide high-quality and concise prompts for the RPA digital employee system in complex business scenarios, thereby improving its task planning, execution and answering capabilities, and effectively overcoming difficulties such as inaccurate task planning (redundant / missing steps), continuous thinking entering an endless loop, inaccurate task execution, and problems in parameter acquisition.
[0048] At the same time, the present invention uses RAG as a tool for digital employees, which can enhance the capabilities of multiple agents in subject areas and corporate knowledge and reduce hallucination phenomena and real-time problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Flowchart of a method for enhancing RPA digital workforce planning capabilities based on a retrieval-enhanced generation approach.
[0050] Figure 2 Flowchart of tasks to perform for a digital worker.
[0051] Figure 3 Flowchart for text retrieval of RAG.
[0052] Figure 4 An architectural diagram for the digital workforce. DETAILED DESCRIPTION
[0053] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0054] The system is highly dependent on the basic capabilities of the model and the quality of the prompt words, which may lead to unstable model responses in practical applications. In order to solve these problems, the present invention designs a business scenario knowledge base and an RPA component parameter knowledge base, and introduces the RAG (retrieval enhanced generation) method to provide digital employees with targeted guidance on task planning and the RPA component parameter guidance required for task execution.
[0055] like Figure 1 , a method for enhancing the RPA digital employee planning capability based on the retrieval enhancement generation method, comprising the following steps:
[0056] S1. The user inputs the current question, and the conversation history records are input into the digital employee conversation system in the form of a sliding window, retaining only the most recent k rounds of conversation records;
[0057] S2. Based on the user's current question and historical conversations, determine whether it is a business scenario-related question:
[0058] If it is judged as not, the user's question will be rewritten based on historical conversations, input into RAG's domain knowledge base for matching, and the topk related documents will be returned to the big model to answer the user's question;
[0059] If the answer is no, it means that it is not a business scenario issue, so the big model can be put into a chat state and answer the user's question directly without calling RPA to complete it.
[0060] If the answer is yes, the user's question will be rewritten based on historical conversations and input into the RAG scenario knowledge base for matching, and relevant business information and required digital employee information will be returned to the planned digital employee;
[0061] S3. Input the rewritten questions, business information, and digital employee information to the planning digital employee for task planning. Each subtask must clearly specify the digital employee x, what tools are needed, and what tasks are to be completed.
[0062] S4, planning digital employees to assign subtasks one by one to corresponding digital employees x for execution;
[0063] S5, such as Figure 2 , digital employee x performs tasks, runs RAG's RPA component library, matches the best RPA component information, and assembles parameters to form an executable RPA tool;
[0064] S6. Repeat S4-S5 until all subtasks are completed. If the RPA tool requires the user to fill in parameters, it needs to be returned to the user for filling and confirmation; otherwise, the RPA tool is executed directly;
[0065] S7. Finally, the results of RPA execution are returned to the planning digital employee, summarized and output to the user.
[0066] In step S2, the user's question is rewritten in combination with the historical conversation, which is specifically achieved in the following way:
[0067] Combine the conversation information of the most recent K rounds (e.g., 5 rounds) between the user and the big model, and then let the big model rewrite the current question based on this conversation information, so that the user's question has certain contextual information, thereby increasing the accuracy of RAG matching.
[0068] for example:
[0069] First round of dialogue:
[0070] User: Hello, I want to handle the onboarding process.
[0071] AI: OK, we will process your onboarding now. You need to provide the following information: your name and mobile phone number.
[0072] Second round of dialogue:
[0073] User: My name is xxx, and my mobile number is: 134xxxx.
[0074] At this point, the big model will change the user's question to User: I want to handle the onboarding process, my name is: xxx, and my mobile number is: 134xxxx.
[0075] AI: OK, you can go through the onboarding process now.
[0076] like Figure 3 , the matching in step S2 or S5 is done through text retrieval of RAG:
[0077] (1) There are two matching methods:
[0078] The first multi-query search engine rewrites the user input question text into multiple questions by synonyms, and then converts these questions into vectors, calculates the cosine similarity between them and the vectors in the local knowledge base, sorts them from high to low according to the cosine similarity, and selects the first k texts with higher scores as the first matching results;
[0079] The second method uses the BM25 algorithm to match the user input question text with the local knowledge base, sorts them from high to low according to the matching value, and selects the top k texts with higher scores, which are recorded as the second matching results;
[0080] (2) weighted merging of the first matching result and the second matching result;
[0081] (3) Use hybrid rearrangement (RRF) to calculate the scores of weighted merged documents and sort them;
[0082] (4) After threshold screening, the final topK documents are returned.
[0083] In step S2, it is judged that the problem is not related to the business scenario, and the local knowledge base is the domain knowledge base of RAG; it is judged that the problem is related to the business scenario, and the local knowledge base is the scenario knowledge base of RAG; in step S5, the local knowledge base is the RPA component library of RAG.
[0084] In step (1), the cosine similarity (A, B) between the question text input by the user and the vector in the local knowledge base is calculated as follows:
[0085]
[0086] Among them, A and B are the vector of the user input question text and the vector in the local knowledge base respectively, · represents the dot product of the vectors, ||A|| and ||B|| represent the norm of vector A and the norm of vector B.
[0087] In step (1), the matching value BM25(D,Q) between the local knowledge base and the question text input by the user is calculated as follows:
[0088]
[0089] Where D is the local knowledge base, Q is the question text input by the user, n is the number of words in the question text input by the user, and q i For the i-th word in the user input question text, f(q i ,D) is q i The frequency of words in D; |D| is the number of words in D, avgd1 is the average document length of D, N represents the total number of documents in D, n(qi) represents the number of documents in D containing qi, k1 and k2 represent weight parameters, and b is the parameter used to adjust the length of documents in D.
[0090] In step (3), the score RRFscore(d∈D) of the weighted merged document is calculated as follows:
[0091]
[0092] Where D is the local knowledge base, Q is the user input question text, r(Q) is the set of retrievers, R is a set of rankings as 1...|D|, and k is a constant greater than or equal to 1 (the default is 60).
[0093] At the same time, the present invention provides:
[0094] A server includes a processor and a memory, wherein the memory stores at least one program, and the program is loaded and executed by the processor to implement the above-mentioned method for enhancing the RPA digital employee planning capability based on retrieval enhancement generation.
[0095] A computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the above-mentioned method for enhancing the RPA digital employee planning capability based on retrieval-enhanced generation.
[0096] Large models only have general capabilities. In vertical fields or specific business scenarios, their performance is relatively poor and they are prone to hallucinations. The solutions to this are as follows:
[0097] 1. Regularly fine-tune the model to allow the model to learn the knowledge base of vertical fields or business scenarios. Disadvantages: high cost, high data quality requirements, and difficult fitting;
[0098] 2. Through the RAG method, the relevant information is matched and provided to the large model as a reference; Advantages: simple, low cost and convenient.
[0099] By introducing the RAG approach, the present invention combines the big model with RPA, allowing the model to play the role of an RPA digital employee.
[0100] RAG can provide the contextual information digital workers need, such as:
[0101] 1. Reference information in vertical fields;
[0102] 2. The tools and scenario information required for specific scenarios;
[0103] 3. Parameters required when calling the RPA tool;
[0104] Then let the digital workers complete the following tasks:
[0105] 1. Able to answer users' vertical knowledge questions and answers;
[0106] 2. Able to complete the service process required by users;
[0107] 3. Ability to schedule RPA tools and execute them;
[0108] 4. Be able to summarize and reflect on the results.
[0109] The RAG approach can solve the shortcomings of large models in vertical fields or specific business scenarios.
[0110] Retrieval-Argumentation Generation (RAG) is an enhancement technology in the field of Large Language Models (LLMs). It makes up for some inherent limitations of LLMs (such as hallucinations, lack of real-time knowledge, etc.) by utilizing external retrieval systems. The rapid development of RAG technology is mainly due to its effectiveness in solving the resource limitation problem of large language models in the generation process, especially its effectiveness in dealing with hallucinations. These limitations usually stem from the lack of information and forgetting in the original training data, resulting in unsatisfactory results for information needs in specific fields, and there are problems such as insufficient knowledge memory mechanisms, outdated information, and catastrophic forgetting. These challenges are essentially inherent in LLMs and are difficult to fully solve only by optimizing architectural design or training methods. The introduction of RAG technology provides an innovative solution to the information gaps in these specific fields.
[0111] The core of RAG is to provide the information needed to generate answers to specific queries through external retrieval systems, thereby avoiding relying entirely on the knowledge within LLM. This approach not only helps to overcome the above limitations, but also makes it possible to utilize proprietary or pre-existing knowledge bases, thus avoiding the high cost of fine-tuning the model.
[0112] RPA is an automated process based on software technology that can simulate manual operations and enable robots to perform daily operations in an enterprise. It mainly includes the following steps: data input, data processing, decision-making and data output. Through RPA technology, enterprises can automate tedious, repetitive and low-value work, improve work efficiency and accuracy, liberate human resources and reduce enterprise costs.
[0113] The capabilities of large language models are increasing day by day, and they have human-like reasoning and task planning capabilities. Therefore, the multi-agents based on these models are implanted into RPA digital employees, which has also become the development direction of enterprise research. At present, large language models have made significant progress in the field of multi-agents, and many excellent open source projects have emerged, such as MetaGPT, AutoGen, and XAgent, which have performed well. Intelligent RPA digital employees are designed based on the multi-agent framework.
[0114] like Figure 4 The modules that RPA digital employees should have are: task planning, memory, tools, and actions.
[0115] Planning: mainly includes sub-goal decomposition, reflection and improvement. Sub-goal decomposition mainly means that digital employees can decompose large tasks into smaller, manageable sub-goals to effectively handle complex tasks; while reflection and improvement means that digital employees can self-criticize and self-reflect on past actions, learn from mistakes and improve future steps, thereby improving the quality of the final result.
[0116] Memory: It is divided into short-term memory and long-term memory. Short-term memory refers to treating all contextual learning (such as prompt engineering and in-context learning) as learning using the model's short-term memory; while long-term memory provides the agent with the ability to store and recall information for a long time. They usually store and recall information by using external vector storage and fast retrieval.
[0117] Tools: Digital workers learn to call external APIs to obtain additional information missing from model weights (which are usually difficult to modify after pre-training), including current information, code execution capabilities, access to proprietary information sources, etc.
[0118] Action: Based on the above planning, memory, and tools, the big model can decide what action needs to be performed in the end.
[0119] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A method for enhancing RPA digital employee planning capabilities based on retrieval enhancement generation, characterized in that: The following steps are involved: S1. The user inputs the current question, and the conversation history records are input into the digital employee conversation system in the form of a sliding window, retaining only the most recent k rounds of conversation records; S2. Based on the user's current question and historical conversations, determine whether it is a business scenario-related question: If it is judged as not, the user's question will be rewritten based on historical conversations, input into RAG's domain knowledge base for matching, and the topk related documents will be returned to the big model to answer the user's question; If the answer is yes, the user's question will be rewritten based on historical conversations and input into the RAG scenario knowledge base for matching, and relevant business information and required digital employee information will be returned to the planned digital employee; S3. Input the rewritten questions, business information, and digital employee information to the planning digital employee for task planning. Each subtask must clearly specify the digital employee x, what tools are needed, and what tasks are to be completed. S4, planning digital employees to assign subtasks one by one to corresponding digital employees x for execution; S5. Digital employee x executes tasks, runs RAG's RPA component library, matches the best RPA component information, and assembles parameters to form an executable RPA tool. S6. Repeat S4-S5 until all subtasks are completed. If the RPA tool requires the user to fill in parameters, it needs to be returned to the user for filling and confirmation; otherwise, the RPA tool is executed directly; S7. Finally, the results of RPA execution are returned to the planning digital employee, summarized and output to the user.
2. According to claim 1, the method for enhancing the RPA digital employee planning capability based on the retrieval enhancement generation method is characterized in that: In step S2, the user's question is rewritten in combination with the historical conversation, which is specifically achieved in the following way: Combine the most recent K rounds of conversation information between the user and the big model, and then let the big model rewrite the current question based on this conversation information, so that the user's question has certain contextual information, thereby increasing the accuracy of RAG matching.
3. According to claim 1, the method for enhancing the RPA digital employee planning capability based on the retrieval enhancement generation method is characterized in that: The matching in step S2 or S5 is done through text retrieval of RAG: (1) There are two matching methods: The first multi-query search engine rewrites the user input question text into multiple questions by synonyms, and then converts these questions into vectors, calculates the cosine similarity between them and the vectors in the local knowledge base, sorts them from high to low according to the cosine similarity, and selects the first k texts with higher scores as the first matching results; The second method uses the BM25 algorithm to match the user input question text with the local knowledge base, sorts them from high to low according to the matching value, and selects the top k texts with higher scores, which are recorded as the second matching results; (2) weighted merging of the first matching result and the second matching result; (3) Using hybrid rearrangement to calculate the scores of the weighted merged documents and sort them; (4) After threshold screening, the final topK documents are returned.
4. The method for enhancing RPA digital employee planning capabilities based on retrieval enhancement generation according to claim 3 is characterized in that: In step (1), the cosine similarity CosineSimilarity(A, B) between the user input question text and the vector in the local knowledge base is calculated as follows: Among them, A and B are the vector of the user input question text and the vector in the local knowledge base respectively, · represents the dot product of the vectors, ||A|| and ||B|| represent the norm of vector A and the norm of vector B.
5. According to claim 3, the method for enhancing the RPA digital employee planning capability based on the retrieval enhancement generation method is characterized in that: In step (1), the matching value BM25(D,Q) between the local knowledge base and the question text input by the user is calculated as follows: Where D is the local knowledge base, Q is the question text input by the user, n is the number of words in the question text input by the user, and q i For the i-th word in the user input question text, f(q i ,D) is q i The frequency of words in D; |D| is the number of words in D, avgd1 is the average document length of D, N represents the total number of documents in D, n(qi) represents the number of documents in D containing qi, k1 and k2 represent weight parameters, and b is the parameter used to adjust the length of documents in D.
6. The method for enhancing RPA digital employee planning capabilities based on retrieval enhancement generation according to claim 3 is characterized in that: In step (3), the score RRFscore(d∈D) of the weighted merged document is calculated as follows: Where D is the local knowledge base, Q is the user input question text, r(Q) is the set of retrievers, R is a set of rankings as 1...|D|, and k is a constant greater than or equal to 1.
7. A server, comprising a processor and a memory, characterized in that: At least one program is stored in the memory, and the program is loaded and executed by the processor to implement the method for enhancing the RPA digital employee planning capability based on retrieval-enhanced generation as described in any one of claims 1 to 6.
8. A computer-readable storage medium, wherein at least one program is stored in the storage medium, characterized in that: The program is loaded and executed by a processor to implement the method for enhancing the RPA digital employee planning capability based on retrieval-enhanced generation as described in any one of claims 1 to 6.
Citation Information
Patent Citations
RPA intelligent agent generated based on large model retrieval enhancement and interaction method thereof
CN118313411A
Digital employee-based report generation method, apparatus and device, and medium
CN118627487A
Autonomous agent system based on retrieval enhancement generation technology and generative large model
CN119003592A
Deployment operation and maintenance agent construction method and device based on multi-modal large model
CN119067158A