Distributed retrieval enhancement generation framework construction method oriented to cross-domain data
By constructing the Multi-RAG framework and adopting a layered and decoupled architecture, collaborative retrieval and generation of cross-domain data are realized, solving the challenges of retrieval and generation in cross-domain data environments, improving the comprehensiveness of retrieval and the accuracy of generation, and making it suitable for collaborative data utilization across institutions and fields.
Patent Information
- Application Number
- CN202510991542.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-31
AI Technical Summary
Traditional search enhancement generation techniques face challenges in cross-domain data environments, including data aggregation obstacles, scalability issues, and a lack of distributed collaboration, which affects the comprehensiveness of the search and the accuracy of the generated answers.
A distributed retrieval enhancement generation framework, Multi-RAG, is constructed. It adopts a layered and decoupled architecture design, reconstructing the system into a query routing layer, a distributed data node layer, and a collaborative generation service layer. Through the collaboration between modules, it realizes the collaborative retrieval and generation of cross-domain data.
Without integrating the original data, it effectively solves the problem of retrieving scattered data across domains, and achieves efficient cross-domain collaborative retrieval and generation. Its performance is close to that of centralized RAG, meeting the needs of cross-institutional and cross-domain collaborative data utilization.
Smart Images

Figure CN120873041A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data retrieval, specifically relating to a method for constructing a distributed retrieval enhancement generation framework for cross-domain data. Background Technology
[0002] With the powerful capabilities of Large Language Models (LLMs) in natural language processing tasks, Retrieval-Augmented Generation (RAG) technology has become a key means to improve the factual accuracy, timeliness of knowledge, and reduce "illusions" in models. However, with the advancement of digitalization across industries, data is showing a significant trend of being stored in a decentralized manner across domains. Due to reasons such as privacy protection and system heterogeneity, data from different fields and institutions is difficult to store and process centrally. This poses a serious challenge to the traditional RAG framework, which relies on a single vector library and centralized data storage: its inherent design is unable to effectively cope with the problem of cross-domain data fragmentation, resulting in a serious impact on the comprehensiveness of retrieval and the accuracy of generated answers. Therefore, how to achieve efficient cross-domain collaborative retrieval and generation without integrating the original data has become an important problem that urgently needs to be solved.
[0003] Although retrieval enhancement generation technology has made significant progress in single, centralized vector database scenarios, effectively improving the performance of centralized data management, its inherent bottlenecks in cross-domain environments are becoming increasingly prominent. The reality of naturally distributed data storage makes the traditional RAG paradigm, which relies on data centralization, difficult to apply. The core challenges include: (1) Data aggregation barriers: Centralizing dispersed data at the physical or logical level to build a vectorized database involves complex permission negotiation, data transmission and synchronization, which is costly and accompanied by significant privacy compliance risks; (2) Scalability issues: The continuous growth of data scale exacerbates the burden of building and maintaining centralized vector libraries and leads to retrieval delays; (3) Lack of distributed collaboration: Existing solutions for distributed data often rely on complex and high-risk data federation and synchronization mechanisms, while the standard RAG framework itself lacks native support for collaborative retrieval and information fusion of distributed data sources. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for constructing a distributed retrieval enhancement and generation framework for cross-domain data. This framework, Multi-RAG, is designed to perform collaborative retrieval and generation without integrating the original data. Specifically, Multi-RAG allows participating nodes (typically corresponding to different data domains or institutions) to autonomously select and maintain suitable embedding models and local vector indexes based on their local data characteristics. When a user query is received, the query routing layer within the framework preprocesses the query and forwards it in parallel to all relevant participating nodes. Each node then independently calculates the similarity between the query and local document fragments in its local environment, using its own embedding model and vector index. After calculation, each node submits only the top-scoring candidate document fragments (e.g., Top-N) from its local retrieval results to the framework's collaborative generation service layer. The core function of the collaborative generation service layer is to aggregate and globally evaluate candidate fragments from multiple nodes. It employs a unified semantic evaluation system to recalculate and sort the semantic relevance of all candidate fragments to the original query, and then selects the globally optimal subset of context fragments (e.g., Top-K) based on this sorting. Ultimately, these highly relevant document fragments, filtered through global reordering, will be submitted as input context to the large language model in the backend, which will then complete the task of generating the final answer.
[0005] To achieve the above objectives, the technical solution of the present invention is: a method for constructing a distributed retrieval enhancement generation framework for cross-domain data, which constructs a distributed retrieval enhancement generation framework Multi-RAG. Multi-RAG adopts a layered and decoupled distributed architecture design, reconstructing the centralized retrieval enhancement generation system into three mutually cooperating functional layers: a query routing layer, a distributed data node layer, and a collaborative generation service layer. Each functional layer contains multiple specialized modules, and the core functions of a specific layer are realized through the organic cooperation between the modules.
[0006] Furthermore, the query routing layer, as the framework's entry gateway, undertakes the core responsibilities of receiving user requests and distributing queries. The query routing layer contains two functional components: a query receiving module and a query distribution module. The query receiving module receives user queries through a unified interface and performs preprocessing. The query distribution module uses a parallel broadcast mechanism to synchronously forward query requests to all data nodes within the framework, ensuring that queries are fully covered across the entire data domain.
[0007] Furthermore, the query receiving module adopts a standardized RESTful API interface, supporting user input in various formats. After receiving a user query, the query receiving module preprocesses the query content, including text cleaning, format standardization, and basic semantic understanding. The query distribution module is the core functional component of the query routing layer. Based on the design principle of parallel processing, the query distribution module uses asynchronous communication to send query requests to all registered data nodes simultaneously.
[0008] Furthermore, the distributed data node layer forms the data foundation of the framework. Each node maintains an independent data set and retrieval capabilities. The core modules of the distributed data node layer include a data storage management module, a vectorization processing module, and a similarity retrieval module. The data storage management module is responsible for maintaining the specialized data sets and metadata information of the nodes. The vectorization processing module converts document fragments into high-dimensional vector representations. The similarity retrieval module performs efficient semantic matching and candidate fragment filtering on the received queries based on local data.
[0009] Furthermore, the data storage management module is responsible for maintaining the document collection and metadata information of the nodes, serving as a fundamental supporting component of the distributed data node layer. This module divides the dataset into several relatively independent subsets based on the document's subject area, knowledge type, and semantic features, assigning each subset to a data node. The vectorization processing module uses text embedding technology to convert document fragments into high-dimensional vector representations. Considering that different data domains may have different terminology and expression habits, the framework allows each node to select the most suitable embedding model based on its data characteristics. The vectorization process employs a batch processing optimization strategy. The similarity retrieval module uses a vector space model to achieve semantic matching between queries and documents. When a request is received from the query routing layer, the similarity retrieval module first converts the query text into a vector representation and then calculates the similarity with the local document vector library. The similarity measurement uses a cosine similarity algorithm, quickly locating the most relevant document fragments through approximate nearest neighbor search technology. Each node only returns the Top-N candidate fragments with the highest similarity scores, which are then submitted to the collaborative generation service layer for further processing.
[0010] Furthermore, the collaborative generation service layer is responsible for integrating the retrieval results from various data nodes, performing global optimization through a re-ranking algorithm, and ultimately driving the large language model to generate high-quality answers. The collaborative generation service layer includes three core components: a result aggregation module, a global re-ranking module, and an answer generation module. The result aggregation module collects and preprocesses candidate fragments from various nodes; the global re-ranking module re-evaluates the relevance of all candidate fragments through deep semantic understanding; and the answer generation module drives the large language model to generate the final answer based on the re-ranked document fragments.
[0011] Furthermore, the results aggregation module is responsible for collecting Top-N candidate segments from various data nodes to form a candidate pool. Since different nodes may use different embedding models and similarity calculation methods, the similarity scores returned by each node lack direct comparability. To address this heterogeneity issue, the system extracts the original scores, retaining only the segment text and metadata, and constructs a unified dataset to be re-ranked through text deduplication and format standardization. The global re-ranking module is the core component of the collaborative generation service layer. It employs a re-evaluation strategy based on deep semantic understanding, using a re-ranking model to globally optimize candidate segments. The re-ranking model is based on a dual-encoder architecture, re-evaluating all segments and queries within a unified semantic space. For relevance, the re-ranking process employs a batch processing strategy, combining all candidate fragments with the original query to form query-document pairs. The re-ranking model calculates the relevance score for each pair and performs a global ranking based on the recalculated scores. The answer generation module is responsible for driving the large language model to generate high-quality answers based on the re-ranked document fragments. The answer generation module uses prompting engineering techniques to organically combine the user query with the Top-K document fragments into a structured input sequence. Through clear role definitions, task descriptions, and context separation, it guides the model to generate accurate and relevant answers based on the provided evidence. The answer generation module also supports multi-turn dialogue scenarios, can maintain dialogue history, and consider the impact of contextual information in subsequent interactions.
[0012] Furthermore, the Multi-RAG implementation is as follows:
[0013] Multi-RAG allows each node participating in the framework to autonomously select and maintain an adapted embedding model and local vector index based on its local data characteristics. When a user query is received, the query routing layer within the framework is responsible for preprocessing the query and forwarding it in parallel to all relevant participating nodes. Each node then independently performs similarity calculation between the query and local document fragments in its local environment, using its own embedding model and vector index. After the calculation is completed, each node submits only the top-scoring candidate document fragments from its local retrieval results to the framework's collaborative generation service layer. The core function of the collaborative generation service layer is to summarize and globally evaluate candidate fragments from multiple nodes. It adopts a unified semantic evaluation system to recalculate and sort the semantic relevance of all candidate fragments to the original query, and selects the globally optimal subset of context fragments based on this sorting. Finally, these highly relevant document fragments, selected through global re-sorting, are submitted as input context to the backend large language model, which completes the task of generating the final answer.
[0014] The present invention also provides a distributed retrieval enhancement generation framework construction system for cross-domain data, including a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, it can implement the steps of any of the methods described above.
[0015] The present invention also provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor, wherein when the processor executes the computer program instructions, it can implement the steps of any of the methods described above.
[0016] Compared with the prior art, the present invention has the following beneficial effects:
[0017] 1) This invention proposes a lightweight distributed RAG framework (Multi-RAG) for cross-domain distributed data. This framework does not require complex data migration or federated learning, and effectively solves the problem of cross-domain distributed data retrieval.
[0018] 2) This invention designs a cross-node information fusion mechanism based on global reordering, which can effectively integrate retrieval results from different data domains;
[0019] 3) The effectiveness of the framework has been verified through detailed experiments. The results show that it is significantly better than the single-node solution in the distributed scenario and its performance is close to that of the centralized RAG. It provides a simple and efficient feasible path for solving the collaborative knowledge utilization of cross-institutional and cross-domain data in practical applications. Attached Figure Description
[0020] Figure 1 This is an overview diagram of the Multi-RAG framework of the present invention.
[0021] Figure 2 Here is a complete example of a Prompt.
[0022] Figure 3 The impact of the number of nodes on retrieval performance.
[0023] Figure 4 A comparison of the generation accuracy of different types of queries under different configurations. Detailed Implementation
[0024] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0025] This invention provides a method for constructing a distributed retrieval enhancement generation framework for cross-domain data. The distributed retrieval enhancement generation framework Multi-RAG is constructed. Multi-RAG adopts a layered and decoupled distributed architecture design, which reconstructs the centralized retrieval enhancement generation system into three mutually cooperating functional layers: query routing layer, distributed data node layer, and collaborative generation service layer. Each functional layer contains multiple specialized modules, and the core functions of a specific layer are realized through the organic cooperation between the modules.
[0026] The following is a detailed implementation process of the present invention.
[0027] 1. Overall Framework Architecture
[0028] This invention presents a method for constructing a distributed retrieval enhancement and generation framework for cross-domain data. The framework, Multi-RAG, employs a layered and decoupled distributed architecture, reconstructing the traditional centralized retrieval enhancement and generation system into three collaborative functional layers: a query routing layer, a distributed data node layer, and a collaborative generation service layer. Each functional layer contains multiple specialized modules, achieving core functions at a specific layer through organic collaboration between these modules. This layered-modular architecture effectively addresses the retrieval and generation challenges in cross-domain data environments, ensuring system performance while achieving data domain autonomy and privacy protection. An overview of the Multi-RAG framework is shown below. Figure 1 As shown.
[0029] The query routing layer, acting as the framework's entry gateway, bears the core responsibility of receiving user requests and distributing queries. This layer contains two functional components: a query receiving module and a query distribution module. The query receiving module receives user queries through a unified interface and performs preprocessing; the query distribution module uses a parallel broadcast mechanism to synchronously forward query requests to all data nodes within the framework, ensuring that queries are fully covered across the entire data domain.
[0030] The distributed data node layer forms the data foundation of the framework, with each node maintaining an independent data set and retrieval capabilities. The core modules of this layer include a data storage management module, a vectorization processing module, and a similarity retrieval module. The data storage management module is responsible for maintaining the specialized data sets and metadata information of each node; the vectorization processing module converts document fragments into high-dimensional vector representations; and the similarity retrieval module performs efficient semantic matching and candidate fragment filtering on received queries based on local data.
[0031] The collaborative generation service layer is responsible for integrating the retrieval results from various data nodes, performing global optimization through a re-ranking algorithm, and ultimately driving the large language model to generate high-quality answers. This layer comprises three core components: a result aggregation module, a global re-ranking module, and an answer generation module. The result aggregation module collects and preprocesses candidate fragments from each node; the global re-ranking module re-evaluates the relevance of all candidate fragments through deep semantic understanding; and the answer generation module drives the large language model to generate the final answer based on the re-ranked document fragments.
[0032] This three-tiered architecture offers significant technical advantages. Compared to traditional monolithic RAG systems, Multi-RAG achieves better scalability and fault tolerance through layered decoupling and modular design. The layers communicate via standardized interfaces, enabling the system to flexibly adapt to data environments of different sizes and types.
[0033] 11. Query Routing Layer Design and Implementation
[0034] The query routing layer is the front-end control unit of the Multi-RAG framework. It achieves standardized processing and distribution of user requests through the collaborative work of two core modules. The design philosophy of this layer is to ensure that each query is processed across all relevant data domains through an efficient routing mechanism, thereby maximizing the coverage of the retrieval and the completeness of the information obtained.
[0035] The query receiving module uses a standardized RESTful API interface, supporting user input in various formats. Upon receiving a user query, this module first preprocesses the query content, including text cleaning, format standardization, and basic semantic understanding. This preprocessing ensures that queries subsequently distributed to various data nodes have a consistent format and clear semantic expression, improving the overall retrieval accuracy.
[0036] The query distribution module is the core functional component of this layer. Based on the design principle of parallel processing, this module uses asynchronous communication to send query requests to all registered data nodes simultaneously. This broadcast distribution strategy avoids complex query routing decisions and ensures the comprehensiveness of the retrieval. In terms of transmission optimization, the module only sends the preprocessed query text and necessary retrieval control parameters (such as the number of Top-N nodes), effectively reducing the transmission of redundant metadata. Simultaneously, the asynchronous concurrent processing significantly improves the system's response efficiency, ensuring that the overall query latency is primarily limited by the response time of a single slowest node, rather than the linear sum of the response times of all nodes.
[0037] 1.2 Distributed Data Node Layer Architecture
[0038] The distributed data node layer is the data infrastructure of the Multi-RAG framework. Each node is a fully functional retrieval unit, achieving independent data storage, vectorization processing, and similarity retrieval capabilities through the collaborative work of three core modules. The node layer is designed according to the principles of autonomy and specialization, ensuring both the independence of each data domain and achieving efficient local retrieval performance.
[0039] The data storage management module is responsible for maintaining the document collection and metadata information of the nodes and is the basic supporting component of the node layer. In order to realistically simulate the scenario of cross-domain data distribution, this study conducted a scientific data partitioning based on the content characteristics of the MultiHop-RAG dataset
[32] . Specifically, we divided the dataset into several relatively independent subsets according to the subject domain, knowledge type and semantic features of the documents, and each subset was assigned to a data node. This partitioning strategy not only ensures the subject consistency and semantic relevance of the data within a single node, but also reflects the characteristics of specialized data storage in different institutions or fields in reality.
[0040] The vectorization module uses text embedding technology to convert document fragments into high-dimensional vector representations. Considering that different data domains may have different terminology and expression habits, the framework allows each node to select the most suitable embedding model based on its data characteristics. This flexible configuration not only improves the accuracy of vector representations but also provides a technical foundation for adapting to heterogeneous data environments. The vectorization process employs a batch processing optimization strategy, achieving high processing performance through reasonable batch planning and memory management.
[0041] The similarity retrieval module uses a vector space model to perform semantic matching between queries and documents. Upon receiving a request from the query routing layer, this module first converts the query text into a vector representation and then calculates its similarity with a local document vector library. The similarity metric employs a cosine similarity algorithm, using an approximate nearest neighbor search technique to quickly locate the most relevant document fragments. To balance retrieval quality and network transmission efficiency, each node returns only the top-N candidate fragments with the highest similarity scores; these fragments are then submitted to the collaborative generation service layer for further processing.
[0042] 1.3 Collaborative Generation Service Layer Design
[0043] The collaborative generation service layer, serving as the intelligent processing hub of the Multi-RAG framework, achieves the core functions of cross-node information fusion and answer generation through the collaborative work of three core modules. This layer integrates distributed retrieval results through a global re-ranking mechanism and drives the large language model to generate the final answer, realizing effective collaboration between local retrieval and global optimization.
[0044] The result aggregation module is responsible for collecting the Top-N candidate segments from each data node, forming a candidate pool of size M×N (N is the number of nodes). Since different nodes may use different embedding models and similarity calculation methods, the similarity scores returned by each node lack direct comparability. To address this heterogeneity issue, the system extracts the original scores, retaining only the segment text and metadata. Furthermore, it constructs a unified dataset for re-ranking through text deduplication and format standardization, laying the foundation for subsequent global evaluation.
[0045] The global re-ranking module is the core component of this layer. It employs a re-evaluation strategy based on deep semantic understanding, using a re-ranking model to globally optimize candidate fragments. The re-ranking model is based on a dual-encoder architecture, re-evaluating the relevance of all fragments to the query within a unified semantic space. This not only eliminates the impact of node heterogeneity but also captures fine-grained semantic associations. Compared to traditional vector similarity calculations, the re-ranking model, by jointly encoding the query and candidate documents, can capture more fine-grained semantic matching information, significantly improving the accuracy of relevance judgment. The re-ranking process uses a batch processing strategy to improve computational efficiency, forming query-document pairs with all candidate fragments and the original query. The re-ranking model calculates the relevance score for each pair and performs a global ranking based on the recalculated scores. The implementation is as shown in Algorithm 1.
[0046] Algorithm 1: Global Re-Ranking
[0047] enter:
[0048] Q: Preprocessed user queries
[0049] C = {C1,C2,…,C} m}: The set of Top-N candidate segments returned by m data nodes
[0050] M r Reordering model (dual encoder)
[0051] K: Output the number of Top-K items
[0052] Output:
[0053] R = [(d1,s1),...,(d k ,s k Top-K segments and their scores, sorted in descending order of relevance.
[0054] step:
[0055] 1. Initialize an empty set
[0056] 2. For each set of nodes C i ∈C:
[0057] 3. For each document fragment d:
[0058] 4. Perform text normalization: d.text ← normalize(d.text)
[0059] 5. If D will then add d to D.
[0060] 6. Construct the query-document pair set P ← {(Q,d)|d∈D}
[0061] 7. Divide P into several batches B according to the maximum batch size of the model.
[0062] 8. Initialize the empty list S
[0063] 9. For each batch b∈B:
[0064] 10. scores←M r .encode_and_score(b)
[0065] 11. Concatenate scores into S
[0066] 12. Sort all (d, score) pairs in S in descending order of score.
[0067] 13. R ← S's first K terms
[0068] 14. Return to R
[0069] The answer generation module is responsible for driving a large language model to generate high-quality answers based on reordered document fragments. This module employs carefully designed prompting engineering techniques, organically combining the user query with the Top-K document fragments into a structured input sequence. Through clear role definitions, task descriptions, and contextual separation, it guides the model to generate accurate and relevant answers based on the provided evidence. To fully leverage the advantages of distributed retrieval, the module's prompt design specifically emphasizes cross-domain information integration. The template explicitly instructs the language model to comprehensively consider information from different data sources and, where necessary, annotate the information sources to improve the credibility and interpretability of the generated answers. Simultaneously, the module supports multi-turn dialogue scenarios, maintaining dialogue history and considering the impact of contextual information in subsequent interactions. Complete prompts are as follows: Figure 2 As shown.
[0070] 2. Experimental Evaluation
[0071] To comprehensively verify the performance of the Multi-RAG framework in a cross-domain distributed environment, this invention designs a series of comparative experiments based on the MultiHop-RAG dataset. The MultiHop-RAG dataset is a benchmark dataset specifically built for multi-hop reasoning question answering tasks. It contains complex queries that require information integration across multiple document fragments, making it very suitable for evaluating the collaborative capabilities of distributed retrieval systems.
[0072] The experimental environment utilized Alibaba Cloud's Tongyi Qianwen series models as core technology components. During the document vectorization stage, all data nodes uniformly used the text-embedding-v2 model for text embedding. This model exhibits excellent performance in text understanding and can generate high-quality semantic vector representations. In the global re-ranking stage, the collaborative generation service layer employed the gte-rerank-v2 re-ranking model to re-evaluate the semantic relevance of candidate fragments. This model, based on an advanced dual-encoder architecture, can accurately capture the deep semantic relationships between queries and document fragments.
[0073] To simulate real-world cross-domain data distribution scenarios, this invention scientifically divides the MultiHop-RAG dataset according to subject areas and knowledge types. Specifically, the centralized configuration uses the complete dataset for retrieval; the three-node configuration distributes the dataset evenly across three nodes, with each node containing approximately one-third of the original data; in the two-node configuration, each node also contains approximately one-third of the original data, for a total data volume of two-thirds of the original dataset; and the single-node configuration uses only one-third of the original dataset to maintain the same data scale as individual nodes in other configurations. Documents in the dataset are assigned to different nodes based on their content characteristics, with each node maintaining a relatively independent and topic-related subset of documents. This partitioning strategy ensures both semantic consistency within a single node and reflects the specialized data storage characteristics of different institutions or departments in reality.
[0074] The experimental design followed the principle of controlling variables, evaluating system performance under different configurations by adjusting the number of nodes M, the number of fragments returned by a single node N, and the final number of document fragments selected K. To ensure the comparability of experimental results, the total candidate pool size M×N was kept constant for all configurations, allowing for comparison of the effects of different distribution strategies under the same computational resource constraints. Additionally, a centralized RAG was set up as a benchmark to evaluate the performance difference between the distributed architecture and traditional methods.
[0075] The retrieval performance evaluation adopted standard metrics in the field of information retrieval, including a multi-dimensional evaluation system such as Hits@10, Hits@4, MAP@10, and MRR@10. These metrics reflect the accuracy of the retrieval system from different perspectives and can comprehensively evaluate the retrieval capabilities of the Multi-RAG framework.
[0076] Experimental results are as follows Figure 3 As shown in Table 1, the centralized RAG system achieved the highest performance across all retrieval metrics, with Hits@10 at 0.7907, Hits@4 at 0.7091, MAP@10 at 0.2896, and MRR@10 at 0.5945. This result is in line with expectations, as centralized systems can perform searches on a globally complete dataset, possessing a natural advantage in information integrity.
[0077] Table 1. Impact of Node Count on Retrieval Performance
[0078]
[0079] The Multi-RAG framework exhibits excellent performance in a three-node configuration. When M=3, N=10, and K=10, the Hits@10 of the proposed method reaches 0.7659, only 3.1% lower than the centralized scheme, with the performance difference kept within an acceptable range. Other metrics also remain at high levels: Hits@4 is 0.6794, MAP@10 is 0.2752, and MRR@10 is 0.5776. This result demonstrates that, through reasonable node configuration and a global reordering mechanism, Multi-RAG can achieve near-centralized system retrieval performance in a distributed environment.
[0080] As the number of nodes decreased, system performance exhibited the expected downward trend. In a two-node configuration (M=2, N=15, K=10), Hits@10 dropped to 0.7206, a decrease of approximately 5.9% compared to the three-node configuration. This performance degradation is primarily due to the reduction in the total amount of searchable data; the total data volume in the two-node configuration is only 2 / 3 of the original dataset, resulting in a 1 / 3 reduction in data coverage compared to the three-node configuration. Simultaneously, the reduced number of nodes participating in collaborative retrieval also weakened the effect of multi-source information fusion, leading to an overall decline in retrieval performance.
[0081] The most significant performance difference occurred in the single-node configuration. When M=1, N=30, and K=10, the system effectively degraded to a traditional single-data source retrieval, with Hits@10 at only 0.4452, a 41.9% decrease compared to the three-node configuration. This contrast vividly demonstrates the value of the distributed collaboration mechanism and proves the crucial role of multi-node information fusion in improving retrieval performance.
[0082] From the perspective of retrieval quality, the Multi-RAG framework effectively integrates information from different data domains through a global re-ranking mechanism. The superior performance under a three-node configuration demonstrates that when data is reasonably distributed across multiple nodes, each node can provide high-quality candidate fragments based on its own specialized data. The global re-ranking module of the collaborative generation service layer can then filter out the most relevant information from these candidates, achieving an organic combination of local specialization and global optimization.
[0083] The quality assessment used the DeepSeek-R1 large language model as the answer generation engine, which demonstrates excellent performance in reasoning ability and knowledge integration. The assessment not only focused on overall answer accuracy but also conducted a detailed analysis of different types of queries in the MultiHop-RAG dataset, including comparison queries, inference queries, temporal queries, and null queries (queries with empty answers).
[0084] Overall generation performance such as Figure 4 As shown in Table 2, the Multi-RAG three-node configuration achieved an answer accuracy of 0.61, a 48% improvement compared to the 0.41 accuracy of the single-node configuration. This significant improvement demonstrates the positive effect of distributed collaborative retrieval on the quality of generated results. By integrating information from multiple data sources, the system can provide the language model with more comprehensive and accurate context, thereby generating higher-quality answers.
[0085] Table 2 Comparison of generation accuracy for different types of queries under different configurations
[0086]
[0087] Looking at the performance of different query types, inference queries achieved the highest accuracy, reaching 0.88 in the three-node configuration and 0.73 in the single-node configuration. This result indicates that large language models demonstrate powerful reasoning capabilities when sufficient background information is available for queries requiring logical reasoning. The Multi-RAG framework creates favorable conditions for inference tasks by providing relevant information from multiple data sources.
[0088] The accuracy for empty answer queries remained high in both configurations, at 0.92 and 0.95 respectively. These queries typically involve questions where the answer does not exist in the dataset, requiring the system to accurately identify and return a "no relevant information found" response. The high accuracy indicates that the system possesses good negative sample identification capabilities in both single-node and multi-node configurations.
[0089] Comparative and time-series queries showed significant performance differences. With a three-node configuration, the accuracy of comparative queries was 0.42, while that of time-series queries was 0.37. However, with a single-node configuration, the accuracy of both types of queries dropped to 0.10. This significant difference indicates that comparative and time-series analysis tasks heavily rely on cross-document information integration capabilities. A single data source often fails to provide the complete information needed for effective comparisons or time-series analysis, while multi-node collaborative retrieval can collect relevant evidence from different perspectives, providing better information support for these complex tasks.
[0090] The improved generation quality is primarily attributed to two optimizations. First, multi-node retrieval provides richer and more diverse contextual information, enabling the language model to understand the question from multiple perspectives and generate more comprehensive answers. Second, the global re-ranking mechanism ensures that the information provided to the language model is more relevant and of higher quality, reducing the interference of noise information on the generation process.
[0091] To verify the crucial role of the global reordering mechanism in the Multi-RAG framework, this invention designed a specific ablation experiment. By comparing the retrieval performance with and without the reordering module, the contribution of the reordering component in the collaborative generation service layer was analyzed in depth.
[0092] The ablation experiment was designed with all other experimental conditions unchanged, except for the removal of the re-ranking module. The Top-N candidate fragments from each node were simply merged and ranked according to their original similarity scores. This setup simulates a distributed retrieval scenario lacking a unified semantic evaluation mechanism, clearly demonstrating the value of the re-ranking module.
[0093] The experimental results are shown in Table 3. The reordering mechanism has a decisive impact on system performance. In the three-node configuration, after removing the reordering module, Hits@10 dropped sharply from 0.7659 to 0.6284, resulting in a performance loss of 18.0%. Other key indicators also showed significant degradation.
[0094] Table 3 Comparison of ablation experimental performance of reordering mechanism
[0095]
[0096]
[0097] Ablation experiments with a single-node configuration further confirm the importance of the reordering mechanism. Even with a single data source, the reordering module still played a positive role, improving Hits@10 from 0.3548 without reordering to 0.4452, an improvement of 25.5%. This result demonstrates that the reordering model, through deep semantic understanding, can more accurately assess the relevance of queries to document fragments, delivering performance improvements even in a single data source environment.
[0098] Ablation studies reveal the core function of the re-ranking mechanism within the Multi-RAG framework. Because different data nodes may employ different embedding models or possess different data features, the similarity scores returned by each node lack direct comparability. Simple score merging often leads to an imbalance in information quality, where high-quality candidate segments may be masked by low-quality but high-scoring segments. The re-ranking module effectively addresses this heterogeneity problem by recalculating the relevance of all candidate segments using a unified semantic evaluation system.
[0099] Furthermore, the dual-encoder architecture employed in the reordering module offers enhanced semantic understanding compared to traditional encoders. By jointly encoding queries and candidate documents, the dual encoder captures more granular semantic interaction information, thereby enabling more accurate relevance assessments. This deep semantic understanding capability is particularly crucial when handling complex queries, especially those requiring multi-hop inference.
[0100] This invention provides a distributed retrieval enhancement and generation framework, Multi-RAG, for cross-domain data, with the following core advantages:
[0101] First, this invention solves the obstacles to cross-domain data aggregation. It eliminates the need for physical or logical centralization of raw data and enables distributed nodes to autonomously maintain local vector indexes, avoiding complex permission negotiations and privacy compliance risks, and significantly reducing data migration costs.
[0102] Secondly, a cross-node information fusion mechanism based on global reordering was designed. The semantic consistency of multi-node retrieval results was evaluated by a dual encoder model, eliminating the scoring differences of heterogeneous data sources. This resulted in the retrieval index Hits@10 reaching 0.7659, which is close to 0.7907 in the centralized scheme, effectively improving the retrieval comprehensiveness and generation accuracy in a distributed environment.
[0103] Furthermore, the framework boasts excellent scalability. Through a layered and decoupled distributed architecture (query routing layer, data node layer, and collaborative generation layer), it supports dynamically adding or removing nodes. When the number of nodes M=3, the generation accuracy is improved by 48% compared to a single node, and the response latency is limited only to the slowest node, avoiding the performance bottleneck of a centralized vector library.
[0104] Finally, through asynchronous communication, fault tolerance mechanisms, and timestamp signatures, the transparent and traceable data processing flow is ensured, while the original data is made "usable but not visible," meeting the privacy protection needs of sensitive fields such as healthcare and finance.
[0105] The purpose of this invention is to provide an efficient and collaborative retrieval enhancement and generation solution for distributed data across institutions and domains, especially suitable for scenarios where data cannot be centrally stored. By upgrading the traditional centralized RAG paradigm to a distributed collaborative model, it can be widely applied in fields such as government data sharing, multi-center medical research, and joint modeling of financial risk control, solving the retrieval blind spots in cross-domain data silos and reshaping the knowledge utilization paradigm in a distributed environment.
[0106] The specific application of the method of this invention is as follows:
[0107] (1) System initialization and node access:
[0108] Participants deploy distributed data nodes based on the characteristics of the data domain. Each node independently selects an embedding model (such as text-embedding-v2) to build a local vector index and registers node metadata with the query routing layer.
[0109] (2) Query processing and distributed retrieval:
[0110] Users submit queries through a RESTful interface. The query routing layer preprocesses the requests (text cleaning, semantic parsing) and distributes the queries to all registered nodes in a parallel broadcast manner. After receiving the query, each node performs vectorization transformation and similarity calculation locally, and returns the Top-N candidate document fragments (e.g., N=10) to the collaborative generation service layer.
[0111] (3) Global reordering and answer generation:
[0112] The collaborative generation service layer aggregates candidate fragments from multiple nodes and recalculates relevance scores within a unified semantic space using the gte-rerank-v2 re-ranking model, selecting the Top-K fragments (e.g., K=10). Based on prompting engineering, the query and the re-ranked fragments are combined into a structured input (e.g., including role definitions and evidence source annotations) to drive a large language model (e.g., DeepSeek-R1) to generate the final answer.
[0113] The present invention also provides a distributed retrieval enhancement generation framework construction system for cross-domain data, including a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, it can implement the steps of any of the methods described above.
[0114] The present invention also provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor, wherein when the processor executes the computer program instructions, it can implement the steps of any of the methods described above.
[0115] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for constructing a distributed retrieval enhancement generation framework for cross-domain data, characterized in that, A distributed retrieval enhancement generation framework, Multi-RAG, is constructed. Multi-RAG adopts a layered and decoupled distributed architecture design, reconstructing the centralized retrieval enhancement generation system into three collaborative functional layers: a query routing layer, a distributed data node layer, and a collaborative generation service layer. Each functional layer contains multiple specialized modules, and the core functions of a specific layer are realized through the organic collaboration between the modules.
2. The method for constructing a distributed retrieval enhancement generation framework for cross-domain data according to claim 1, characterized in that, As the framework's entry gateway, the query routing layer is responsible for receiving user requests and distributing queries. It contains two functional components: a query receiving module and a query distribution module. The query receiving module receives user queries through a unified interface and performs preprocessing. The query distribution module uses a parallel broadcast mechanism to synchronously forward query requests to all data nodes within the framework, ensuring that queries are fully covered across the entire data domain.
3. The method for constructing a distributed retrieval enhancement generation framework for cross-domain data according to claim 2, characterized in that, The query receiving module adopts a standardized RESTful API interface, supporting user input in various formats. After receiving a user query, the query receiving module preprocesses the query content, including text cleaning, format standardization, and basic semantic understanding. The query distribution module is the core functional component of the query routing layer. Based on the design principle of parallel processing, the query distribution module uses asynchronous communication to send query requests to all registered data nodes simultaneously.
4. The method for constructing a distributed retrieval enhancement generation framework for cross-domain data according to claim 1, characterized in that, The distributed data node layer forms the data foundation of the framework. Each node maintains an independent data set and retrieval capability. The core modules of the distributed data node layer include a data storage management module, a vectorization processing module, and a similarity retrieval module. The data storage management module is responsible for maintaining the node's specialized data set and metadata information. The vectorization processing module converts document fragments into high-dimensional vector representations. The similarity retrieval module performs efficient semantic matching and candidate fragment filtering on the received queries based on local data.
5. The method for constructing a distributed retrieval enhancement generation framework for cross-domain data according to claim 4, characterized in that, The data storage management module is responsible for maintaining the document collection and metadata information of the nodes, and is a basic supporting component of the distributed data node layer; The data storage management module divides the dataset into several relatively independent subsets based on the document's subject domain, knowledge type, and semantic features, assigning each subset to a data node. The vectorization processing module uses text embedding technology to convert document fragments into high-dimensional vector representations. Considering that different data domains may have different professional terms and expression habits, the framework allows each node to select the most suitable embedding model based on its data characteristics. The vectorization process adopts a batch processing optimization strategy. The similarity retrieval module realizes semantic matching between queries and documents based on the vector space model. When a request is received from the query routing layer, the similarity retrieval module first converts the query text into a vector representation, and then calculates the similarity with the local document vector library. The similarity measurement uses the cosine similarity algorithm, which quickly locates the most relevant document fragments through approximate nearest neighbor search technology. Each node only returns the top-N candidate fragments with the highest similarity scores, and these fragments are submitted to the collaborative generation service layer for further processing.
6. The method for constructing a distributed retrieval enhancement generation framework for cross-domain data according to claim 1, characterized in that, The collaborative generation service layer is responsible for integrating the retrieval results from various data nodes, performing global optimization through a re-ranking algorithm, and ultimately driving the large language model to generate high-quality answers. The collaborative generation service layer consists of three core components: a result aggregation module, a global re-ranking module, and an answer generation module. The result aggregation module collects and preprocesses candidate segments from various nodes; the global re-ranking module re-evaluates the relevance of all candidate segments through deep semantic understanding. The answer generation module drives a large language model to generate the final answer based on the reordered document fragments.
7. The method for constructing a distributed retrieval enhancement generation framework for cross-domain data according to claim 6, characterized in that, The results aggregation module is responsible for collecting the Top-N candidate segments from various data nodes to form a candidate pool. Since different nodes may use different embedding models and similarity calculation methods, the similarity scores returned by each node lack direct comparability. To solve this heterogeneity problem, the system strips the original scores and retains only the segment text and metadata. It also constructs a unified dataset to be re-ranked through text deduplication and format standardization. The global re-ranking module is the core component of the collaborative generation service layer. It adopts a re-evaluation strategy based on deep semantic understanding and uses a re-ranking model to globally optimize the candidate segments. The re-ranking model is based on a dual encoder architecture and re-evaluates the relevance of all segments to the query in a unified semantic space. The re-ranking process adopts a batch processing strategy, forming query-document pairs with all candidate segments and the original query. The relevance score of each pair is calculated by the re-ranking model, and the global ranking is performed based on the recalculated scores. The answer generation module is responsible for driving the large language model to generate high-quality answers based on the reordered document fragments. The answer generation module adopts prompting engineering technology to organically combine the user query with the Top-K document fragments into a structured input sequence. Through clear role definitions, task descriptions and context separation, it guides the model to generate accurate and relevant answers based on the provided evidence. The answer generation module also supports multi-turn dialogue scenarios, can maintain dialogue history and consider the impact of contextual information in subsequent interactions.
8. The method for constructing a distributed retrieval enhancement generation framework for cross-domain data according to any one of claims 1-7, characterized in that, The specific implementation of Multi-RAG is as follows: Multi-RAG allows each node participating in the framework to autonomously select and maintain an adapted embedding model and local vector index based on its local data characteristics. When a user query is received, the query routing layer within the framework is responsible for preprocessing the query and forwarding it in parallel to all relevant participating nodes. Each node then independently performs similarity calculation between the query and local document fragments in its local environment, using its own embedding model and vector index. After the calculation is completed, each node submits only the top-scoring candidate document fragments from its local retrieval results to the framework's collaborative generation service layer. The core function of the collaborative generation service layer is to summarize and globally evaluate candidate fragments from multiple nodes. It adopts a unified semantic evaluation system to recalculate and sort the semantic relevance of all candidate fragments to the original query, and selects the globally optimal subset of context fragments based on this sorting. Finally, these highly relevant document fragments selected through global re-sorting will be submitted as input context to the backend large language model, which will complete the task of generating the final answer.
9. A system for constructing a distributed retrieval enhancement generation framework for cross-domain data, characterized in that, It includes a memory, a processor, and computer program instructions stored in the memory and executable by the processor, which, when executed by the processor, enable the implementation of the steps of the method as described in any one of claims 1-8.
10. A computer-readable storage medium having stored thereon computer program instructions executable by a processor, wherein when the processor executes the computer program instructions, it is able to implement the steps of the method as described in any one of claims 1-8.