Data circulation method for communicating multiple RAG systems

Through intelligent agents, and using role-based access management and dynamic data masking technology, data sharing difficulties and privacy security problems caused by independent operation of RAG systems are solved, cross-domain data circulation and application are realized, and Data security and privacy protection.

CN119202183AActive Publication Date: 2024-12-27WUXI RES INST OF APPLIED TECH TSINGHUA UNIV +1

Patent Information

Application Number
CN202411321596.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-27
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The existing RAG system operates independently and cannot share data resources, limiting its application potential and value on a larger scale. At the same time, how to protect privacy and security during the data flow is a major challenge.

Method used

Connect multiple RAG systems through intelligent agents, use role-based access management mechanisms and dynamic data masking technology to realize cross-departmental, cross-institutional, and cross-field data circulation, and protect data privacy without destroying the original system Safety.

Benefits of technology

The circulation and application of data elements between multiple RAG systems is realized, which enhances the efficiency and effectiveness of handling complex tasks, while ensuring data privacy and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202183A_ABST
    Figure CN119202183A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and particularly discloses a data circulation method for communicating multiple RAG systems, comprising: sending a user question to an RAG system, so that the RAG system can determine a corresponding dynamic description content; reasoning according to the dynamic description content and the historical dialogue to judge whether the RAG system needs to be called to answer the user question; when the RAG system needs to be called, splitting the user question into a plurality of sub-questions according to the user question and the dynamic description content, and sequentially calling the RAG system corresponding to the plurality of sub-questions to obtain a corresponding answer result; and when the user question can be replied according to the answer result, returning the answer result to the user side. According to the method, data elements can be circulated in a cross-department, cross-mechanism and cross-field manner under the condition that an original single RAG system is not damaged, and the data elements are mutually combined on the premise of protecting privacy security, so that a new value is generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a data flow method for connecting multiple RAG systems. Background Art

[0002] like Figure 1 As shown, it is now very popular to use a single retrieval-augmented generation (RAG) system to implement data element applications in big models. Through the process of "user question input → execute retrieval → combine the retrieved relevant knowledge with the user question to form an enhanced prompt → send it to the big model (LLM) to generate a response", combining information retrieval and big models, it can solve the problems of big model illusions, difficulties in knowledge updating and maintenance, and potential risks of privacy data leakage to a certain extent.

[0003] For example, there are a large number of different departments / subsidiaries in an enterprise, and each department / subsidiary has its own local RAG system that stores a large amount of information from different sources and types, some of which have confidentiality requirements, while others are allowed to circulate between departments or subsidiaries. A single RAG system has certain limitations. Although more and more RAG systems are currently in use, most of the existing RAG systems operate independently, and data elements cannot be interoperable, which limits their application potential and value on a larger scale. For example, a single RAG system cannot share data resources or collaborate with other RAG systems, which affects their efficiency and effectiveness in handling complex tasks.

[0004] In addition, how to protect data privacy and security within the connected RAG system is also a major challenge; therefore, how to enable the local data elements therein to circulate while minimizing damage to the original system and protecting data privacy and security, and combine them with data elements in other RAG systems to generate more value in actual scenarios has become an urgent problem to be solved.

[0005] ReAct (Reasoning and Acting) intelligent agent is a framework that combines reasoning and action driven by a large model. It also introduces an observation link. After each action, it will first observe the current situation and then proceed to the next step of reasoning. It aims to improve the performance and explainability of large language models (LLMs) in solving complex tasks. Figure 2As shown in the figure, the operation process of the ReAct agent is as follows: the user question enters the Agent (intelligent agent) → enters the reasoning stage, analyzes the input data in combination with the pre-written tool information in the system, generates decisions and plans → performs specific actions based on the decisions, calls the corresponding tools → obtains feedback from the called tools → the big model observes the decisions and plans generated in the reasoning stage and the feedback data obtained in the tool call → the big model adjusts the reasoning and actions based on this information to determine whether the answer can be generated directly, or whether it needs to be iterated in a loop to continuously optimize the results.

[0006] In the current ReAct intelligent agent framework, the information about tools needed in the reasoning process is pre-set, which makes the relevant description information of the tools rigid and general, making it difficult for the intelligent agent to make decisions and plans based on this information, and unable to accurately determine the tools needed to solve the input problem. Summary of the invention

[0007] In view of the above-mentioned drawbacks existing in the prior art, the present invention provides a data circulation method connecting multiple RAG systems. Without destroying the original single RAG system, data elements can be circulated across departments, institutions and fields, and combined with each other under the premise of protecting privacy and security to generate new value.

[0008] As a first aspect of the present invention, a data flow method for connecting multiple RAG systems is provided, wherein the multiple RAG systems are all connected to an intelligent agent, and the data flow method for connecting multiple RAG systems comprises the following steps: Step S1: When the intelligent agent receives a user question input by a user terminal, the user question is embedded in a corresponding prompt word template to generate a first prompt word, and then the first prompt word is sent to all RAG systems that can be accessed under the user's authority, so that the large model in each RAG system can determine the dynamic description content corresponding to the RAG system according to the first prompt word, wherein the dynamic description content is the specific aspects of the user question that the RAG system can answer; Step S2: returning corresponding dynamic description content to the intelligent agent through each RAG system; Step S3: After the intelligent agent receives the dynamic description content returned by each RAG system, it embeds all the dynamic description content and historical dialogue into the corresponding prompt word template to generate a second prompt word, and performs reasoning based on the second prompt word to determine whether it is necessary to call the corresponding RAG system to answer the user question; Step S4: When the intelligent agent determines that the corresponding RAG system needs to be called to answer the user's question, the user's question and all dynamic description contents are embedded in the corresponding prompt word template to generate a third prompt word, and the user's question is divided into a plurality of sub-questions and their corresponding RAG systems according to the third prompt word; Step S5: calling the RAG systems corresponding to the sub-questions in sequence through the intelligent agent, and inputting the corresponding sub-questions into the corresponding RAG systems to obtain the answer results returned by the corresponding RAG systems; Step S6: When the intelligent agent determines that it can reply to the user's question based on the answer results returned by the RAG system, the answer results returned by each RAG system are formed into a final answer result and returned to the user end.

[0009] Furthermore, the method further comprises the following steps: Use the role-based access rights management mechanism to assign one or more roles to each user. Different roles have different access rights to the RAG system. Among them, for the RAG system where users can only access non-sensitive information, the dynamic data masking technology is used to desensitize the dynamic description content through regular expressions combined with the reasoning generation capability of the large model in the RAG system to obtain the desensitized dynamic description content; Among them, for the RAG system in which users can only access non-sensitive information, dynamic data masking technology is used to desensitize the answer results returned by the RAG system through regular expressions combined with the reasoning and generation capabilities of the large model in the RAG system to obtain the desensitized answer results.

[0010] Further, the use of a role-based access rights management mechanism to assign one or more roles to each user, where different roles have different access rights to the RAG system, also includes: Assign one or more roles to each user based on the actual organizational structure, so that the user can determine the role he / she belongs to after logging in; Set different roles to have different access rights, so that certain access rights are allowed under certain roles; Whether resources can be accessed and operations can be performed is set as RAG system access rights to ensure that the intelligent agent can only access the RAG system in the authority when handling the user's problem.

[0011] Furthermore, the step S6 further includes the following steps: When the intelligent agent is unable to reply to the user's question according to the answer result returned by the RAG system, it returns to step S3 to perform reasoning again to update the answer result returned by the RAG system until it can reply to the user's question according to the updated answer result returned by the RAG system.

[0012] The data circulation method for connecting multiple RAG systems provided by the present invention has the following advantages: by introducing an intelligent agent based on large model capabilities, using its decision-making and execution capabilities to connect multiple independent RAG systems, the circulation and application of data elements across fields, institutions and departments are realized. At the same time, a role-based access control mechanism (Role-Based Access Control) and dynamic data masking technology (DDM) are added to ensure that data is effectively protected during the circulation process to avoid privacy leakage and unauthorized access. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention, but do not constitute a limitation of the present invention.

[0014] Figure 1 The figure is an operation flow chart of a single RAG system in the prior art.

[0015] Figure 2 This is an operation flow chart of the ReAct intelligent agent in the prior art.

[0016] Figure 3 A flow chart of a data flow method for connecting multiple RAG systems provided by the present invention.

[0017] Figure 4 This is a flow chart of a specific implementation of the data flow method for connecting multiple RAG systems provided by the present invention.

[0018] Figure 5 A schematic diagram of the connection between the ReAct intelligent agent provided by the present invention and multiple RAG systems.

[0019] Figure 6 This is a flow chart of the implementation of the RAG system provided by the present invention. DETAILED DESCRIPTION

[0020] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation method, structure, characteristics and effects of the data flow method for connecting multiple RAG systems proposed by the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.

[0021] In this embodiment, a data flow method for connecting multiple RAG systems is provided, such as Figure 3-5 As shown, multiple RAG systems are connected to the intelligent agent, and the data flow method connecting multiple RAG systems includes the following steps: Step S1: When the intelligent agent receives a user question input by a user terminal, the user question is embedded in a corresponding prompt word template to generate a first prompt word, and then the first prompt word is sent to all RAG systems that can be accessed under the user's authority, so that the large model in each RAG system can determine the dynamic description content corresponding to the RAG system according to the first prompt word, wherein the dynamic description content is the specific aspects of the user question that the RAG system can answer; It should be noted that the big model in a single RAG system determines whether it can answer any aspect of the user's question, and if so, which aspect, and returns this information to the intelligent agent as the dynamic description content of each RAG system. Among them, the "big model" in this scenario is the local big model in the department's RAG system. The "big model" can be Llama3_70B _Instruct, Qwen_2_72B, or ChatGLM3_7B, which depends on their local settings.

[0022] Specifically, the "dynamic description content" is a description of the RAG system that is specific to the user's question, rather than a general summary, that is, a description that changes according to the user's question. For example, a user asks a question about a person's name, but this person's name generally does not appear in the pre-written RAG system description content (the RAG system description content is generally "xxx company annual report", "A department past project summary"). At this time, the large model in the intelligent agent may make a misjudgment and skip the relevant RAG system. Using dynamic description content may result in a description content similar to "can provide information on projects that xxx person has participated in in A department".

[0023] Example 1: 1. Background: Group B has multiple subsidiaries, each subsidiary has multiple departments, and each department is equipped with a local RAG system to manage and answer various types of information.

[0024] 2. User question: "Information about customer Zhang Xiaojuan" is sent to the RAG system with appropriate prompt words.

[0025] 3. The dynamic description returned by the RAG system is as follows: a)RAG_1: "I can answer questions about the utility bill payment details of Zhang Xiaojuan's client." b)RAG_2: "I can answer the question about the registered address of Zhang Xiaojuan's client." c)RAG_3: "I can answer questions about Zhang Xiaojuan's purchase record at store E in March." Example 2: 1. Background: Group B has multiple subsidiaries, each subsidiary has multiple departments, and each department is equipped with a local RAG system to manage and answer various types of information.

[0026] 2. User question: "Project experience on large-model federated learning", combined with appropriate prompt words, is sent to the RAG system.

[0027] 3. The dynamic description returned by the RAG system is as follows: a)RAG_1: “I can answer questions about project experience in large model deployment.” b)RAG_2: “I can answer questions about project experience in federated learning.” c)RAG_3: "I can answer questions about my experience in the large-scale federated learning project in the financial field of XX banks." Step S2: returning corresponding dynamic description content to the intelligent agent through each RAG system; Step S3: After the intelligent agent receives the dynamic description content returned by each RAG system, it embeds all the dynamic description content and historical conversations into the corresponding prompt word template to generate a second prompt word, and performs reasoning based on the second prompt word to determine whether it is necessary to call the corresponding RAG system to answer the user question; the purpose is to make a judgment on the progress of solving the current user problem: if the intelligent agent believes that it has obtained enough information, it does not need to call the RAG system to answer the user question; if the intelligent agent believes that it has not obtained enough information, it needs to call the corresponding RAG system to help itself answer the user question.

[0028] It should be noted that the conversation history refers to: past user questions and LLM interaction content, which will appear in the "Current Conversation" part of the following prompt words, that is, in the current conversation, the previous rounds of input in the intelligent agent, the reasoning generation in the large model Thought, Action, Action Input format, and the tool return after calling the tool: Observation.

[0029] Step S4: When the intelligent agent determines that the corresponding RAG system needs to be called to answer the user's question, the user's question and all dynamic description contents are embedded in the corresponding prompt word template to generate a third prompt word, and the user's question is divided into a plurality of sub-questions and their corresponding RAG systems according to the third prompt word; For example, the user problem is decomposed into: Sub-question 1 = "Details of Zhang Xiaojuan's water and electricity bills in the past month", the RAG system corresponding to sub-question 1 = "RAG_1"; Sub-question 2 = "Zhang Xiaojuan's address", the RAG system corresponding to sub-question 2 = "RAG_2".

[0030] Step S5: calling the RAG systems corresponding to the sub-questions in sequence through the intelligent agent, and inputting the corresponding sub-questions into the corresponding RAG systems to obtain the answer results returned by the corresponding RAG systems; Step S6: When the intelligent agent determines that it can reply to the user's question based on the answer results returned by the RAG system, the answer results returned by each RAG system are formed into a final answer result and returned to the user end.

[0031] Preferably, the method further comprises the following steps: The RAG system uses a role-based access control mechanism to assign one or more roles to each user. Different roles have different access rights to the RAG system. Among them, for the RAG system where users can only access non-sensitive information, the dynamic data masking technology (DDM) is used to desensitize the dynamic description content through regular expressions combined with the reasoning generation capability of the large model in the RAG system to obtain the desensitized dynamic description content; thereby improving the shortcomings of the previous ReAct Agent framework, which is rigid description of the callable tools and cannot provide detailed descriptions related to user problems. At the same time, it will not leak RAG description information that is not related to the problem, or leak sensitive information of the RAG system that the user is not authorized to view.

[0032] It should be noted that the prompt words are used to explicitly let the large model in the RAG system generate answers in the following workflow: 1. Identify sensitive words in sentences, such as time-related words; 2. Replace the recognized words with ***.

[0033] In the above example, "I can answer questions about Zhang Xiaojuan's purchase records in E store in March", the time is: March, 1. Use the reasoning generation capability of the large model to desensitize the information: "Please identify all time information and replace it with ****"; 2. Then use regular expressions to fill in the gaps in the answers and replace all fixed-format time / number content with ***; 3. Dynamic description content after desensitization: I can answer questions about customer Zhang Xiaojuan’s purchase record in store E in month ***.

[0034] In the above example, "I can answer questions about the experience of cooperating with Jiangsu Bank on the large-scale federated learning project in the financial field", the partners are: Jiangsu Bank, Finance, 1. Use the reasoning generation capability of the large model to desensitize the information: "Please identify all entity names and replace them with ****"; 2. Then use regular expressions to fill in the gaps in the answers and replace all fixed-format entity names with ***; 3. Dynamic description content after desensitization: I can answer questions about my experience in the large-scale federated learning project in the financial field in cooperation with ***.

[0035] For RAG systems where users can only access non-sensitive information, dynamic data masking (DDM) is used to desensitize the answer results returned by the RAG system through regular expressions combined with the reasoning generation capabilities of the large model in the RAG system to obtain desensitized answer results. Sensitive information will vary depending on the scenario / company / department, but it is basically consistent with the examples in the dynamic description content. Desensitization is first performed using the capabilities of the large model, and then regular expressions are used to fill in the gaps to a certain extent.

[0036] Preferably, Figure 6 As shown, the role-based access rights management mechanism is used to assign one or more roles to each user, and different roles have different access rights to the RAG system, and also includes: Assign one or more roles to each user based on the actual organizational structure, so that the user can determine the role he / she belongs to after logging in; Set different roles to have different access rights, so that certain access rights are allowed under certain roles; Whether resources can be accessed and operations can be performed is set as RAG system access rights to ensure that the intelligent agent can only access the RAG system in the authority when handling the user's problem.

[0037] For example, user A's role is "B Group C Company Administrator", which has full permissions to query the independent RAG systems (RAG_1, RAG_2) of all departments of C Company, and has permissions to query non-sensitive information in the RAG_3 system that belongs to the same B Group but not C Company.

[0038] Preferably, the step S6 further comprises the following steps: When the intelligent agent is unable to reply to the user's question according to the answer result returned by the RAG system, it returns to step S3 to reason and think again to update the answer result returned by the RAG system until it can reply to the user's question according to the updated answer result returned by the RAG system.

[0039] The data circulation method for connecting multiple RAG systems provided by the present invention can promote the circulation and application of data elements between RAG systems, circulate data elements that were not originally circulated, and further create value. In addition, without significantly modifying the original RAG system, the privacy and security of the flow of data elements are guaranteed.

[0040] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.

Claims

1. A data flow method for connecting multiple RAG systems, characterized in that: Multiple RAG systems are connected to the intelligent agent, and the data flow method connecting multiple RAG systems includes the following steps: Step S1: When the intelligent agent receives a user question input by a user terminal, the user question is embedded in a corresponding prompt word template to generate a first prompt word, and then the first prompt word is sent to all RAG systems that can be accessed under the user's authority, so that the large model in each RAG system can determine the dynamic description content corresponding to the RAG system according to the first prompt word, wherein the dynamic description content is the specific aspects of the user question that the RAG system can answer; Step S2: returning corresponding dynamic description content to the intelligent agent through each RAG system; Step S3: After the intelligent agent receives the dynamic description content returned by each RAG system, it embeds all the dynamic description content and historical dialogue into the corresponding prompt word template to generate a second prompt word, and performs reasoning based on the second prompt word to determine whether it is necessary to call the corresponding RAG system to answer the user question; Step S4: When the intelligent agent determines that the corresponding RAG system needs to be called to answer the user's question, the user's question and all dynamic description contents are embedded in the corresponding prompt word template to generate a third prompt word, and the user's question is divided into a plurality of sub-questions and their corresponding RAG systems according to the third prompt word; Step S5: calling the RAG systems corresponding to the sub-questions in sequence through the intelligent agent, and inputting the corresponding sub-questions into the corresponding RAG systems to obtain the answer results returned by the corresponding RAG systems; Step S6: When the intelligent agent determines that it can reply to the user's question based on the answer results returned by the RAG system, the answer results returned by each RAG system are formed into a final answer result and returned to the user end.

2. The data flow method for connecting multiple RAG systems according to claim 1, characterized in that: The following steps are also included: Use the role-based access rights management mechanism to assign one or more roles to each user. Different roles have different access rights to the RAG system. Among them, for the RAG system where users can only access non-sensitive information, the dynamic data masking technology is used to desensitize the dynamic description content through regular expressions combined with the reasoning generation capability of the large model in the RAG system to obtain the desensitized dynamic description content; Among them, for the RAG system in which users can only access non-sensitive information, dynamic data masking technology is used to desensitize the answer results returned by the RAG system through regular expressions combined with the reasoning generation capabilities of the large model in the RAG system to obtain the desensitized answer results.

3. The data flow method for connecting multiple RAG systems according to claim 2, characterized in that: The use of a role-based access rights management mechanism to assign one or more roles to each user, where different roles have different access rights to the RAG system, also includes: Assign one or more roles to each user based on the actual organizational structure, so that the user can determine the role he / she belongs to after logging in; Set different roles to have different access rights, so that certain access rights are allowed under certain roles; Whether resources can be accessed and operations can be performed is set as RAG system access rights to ensure that the intelligent agent can only access the RAG system in the authority when handling the user's problem.

4. The data flow method for connecting multiple RAG systems according to claim 1, characterized in that: The step S6 further comprises the following steps: When the intelligent agent is unable to reply to the user's question according to the answer result returned by the RAG system, it returns to step S3 to perform reasoning again to update the answer result returned by the RAG system until it can reply to the user's question according to the updated answer result returned by the RAG system.

Citation Information

Patent Citations

  • Multi-round dialogue processing method, device and equipment based on RAG

    CN117743559A

  • Retrieval enhancement decision controller based on step-by-step reasoning of large language model

    CN118095435A

  • Dynamic adaptation question answering system and method based on hierarchical structure and retrieval enhancement

    CN118193714A

  • Machine dialogue capability improving method and system based on social simulation system

    CN118468930A

  • Data-Informed Decision Making Through a Domain-General Artificial Intelligence Platform

    US20220343903A1

Cited By

  • Poster generation method and device based on RAG poster design and electronic equipment

    CN119886053A