Multi-knowledge base fusion retrieval enhancement generation method and visual management system
By constructing a knowledge graph of multiple knowledge bases using GraphRAG technology and performing cross-base information fusion, the problem of multi-source knowledge fusion is solved, the semantic accuracy of search results and the uniformity of template format are achieved, and an intuitive knowledge management tool is provided.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-23
Smart Images

Figure CN122262302A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and artificial intelligence, and more specifically, to a retrieval enhancement generation method and visualization management system that integrates multiple knowledge bases. Background Technology
[0002] In the process of enterprise intelligent transformation, the efficient processing and generation of structured documents, compliance review texts, and accurate internal knowledge Q&A have become core technical requirements. Currently, this field widely adopts the Retrieval Augmented Generation (RAG) technology framework, which combines large language models with external knowledge bases to improve the accuracy and factuality of generated text. Typical applications include contract review, financial report generation, and employee process consulting.
[0003] However, traditional RAG systems mostly rely on vectorized fragments of documents for retrieval, making it difficult to capture and utilize complex semantic relationships within and across documents. This results in fragmented search results, affecting the logical coherence and depth of the generated content. Secondly, when faced with multiple independent knowledge bases formed by multiple departments and domains within an enterprise, existing methods lack effective collaborative retrieval mechanisms for multiple knowledge bases. Simple content splicing easily leads to information redundancy or conflicts, failing to provide a unified and accurate knowledge view for complex tasks. Furthermore, in scenarios requiring the output of structured documents, traditional methods struggle to balance the rigid requirements of template formats with the flexibility of content generation, often resulting in formatting errors or low content-template fit. Knowledge base management and content insights typically remain at the document list level, lacking intuitive visualization tools that reveal the inherent relationships within knowledge, thus limiting users' in-depth understanding and utilization of knowledge assets.
[0004] Therefore, there is an urgent need in this field for an integrated solution that can deeply integrate multi-source knowledge to achieve accurate document generation and provide intuitive knowledge insights, in order to break through the current technology's efficiency and effectiveness limits in practical enterprise applications. Summary of the Invention
[0005] In view of this, the present invention proposes a retrieval enhancement generation method and a visualization management system that integrates multiple knowledge bases to solve the problems existing in the prior art.
[0006] To achieve the above objectives, this invention proposes a multi-knowledge base fusion-based retrieval enhancement generation method, comprising the following steps: Step S1: Create and maintain multiple independent knowledge bases for different business domains. Each knowledge base uses GraphRAG technology to process and store the uploaded domain documents as knowledge graphs. Step S2: In response to user queries, construct a virtual unified knowledge graph from multiple knowledge bases selected by the user and apply a graph attention network to perform semantic retrieval and deep fusion of cross-database information, and generate a retrieval-enhanced summary. Step S3: Align and fuse the enhanced search summary with the predefined document template structure to guide the large language model to generate text content that conforms to the template framework and is deeply integrated with search knowledge.
[0007] Further, step S1 specifically includes: S11. Receive and store domain documents in various formats uploaded by users to the distributed file system; S12. Use a large language model to extract key entities and semantic relationships between entities from document content blocks; S13. Using the entities as nodes and semantic relationships as edges, construct a cross-document knowledge graph and store it in a graph database, while simultaneously establishing a full-text search index.
[0008] Further, step S2 specifically includes: S21. Encode the user query into a high-dimensional query vector and obtain the list of target knowledge bases selected by the user; S22. Based on the underlying knowledge graph of each target knowledge base, a virtual unified knowledge graph for this query is constructed in memory by sharing entity or topic nodes; S23. Starting from the query vector, perform subgraph sampling based on random walk on the virtual unified knowledge graph; S24. Input the sampled subgraph and the query vector into the graph attention network, calculate the importance weight of each node for the current query, and output the rearranged set of context information. S25. Summarize and integrate the context information set to form a search-enhanced summary.
[0009] Furthermore, step S3 specifically includes: S31. Use a sequence-to-graph neural network to parse a predefined document template into a template structure graph, wherein the nodes in the graph include variable slots; S32. Using the graph attention alignment module, the retrieved knowledge subgraph obtained in step S2 is semantically aligned with the template structure graph, and relevant knowledge nodes are injected into the corresponding variable slots to form a fusion generation graph. S33. Based on the user's query intent, the fused generated graph is adaptively traversed to generate an enhanced prompt sequence containing structural markers and knowledge context; S34. Input the enhanced prompt sequence into a large language model to generate the final text.
[0010] Furthermore, the method also includes a step of visual management: S41. Extract knowledge graph data from the graph database and generate an interactive visualization view based on the force-directed graph layout algorithm; S42. Render the visualization view in real time on the front-end interface and provide interactive functions such as node dragging, zooming, highlighting associations, and keyword search; S43. When the knowledge base content is updated, the graph data is automatically updated and the visualization view is updated synchronously with a smooth animation on the front end.
[0011] On the other hand, to achieve the above objectives, this invention proposes a multi-knowledge base fusion-based retrieval enhancement generation visualization management system for implementing the above method, the system comprising: The knowledge base construction and management module is used to create and maintain multiple independent knowledge bases, and to realize the knowledge graphization of documents based on GraphRAG technology; The cross-database retrieval and fusion module is used to respond to user queries and perform cross-database graph neural retrieval and deep information fusion from the selected knowledge base; The adaptive content generation module is used to integrate search results with document templates and guide the large model to generate structured text. The visualization and interaction module is used to dynamically visualize and interact with the knowledge graph.
[0012] Furthermore, the knowledge base construction and management module includes a document processing unit, a graph construction unit, and a graph database storage unit; The cross-database retrieval and fusion module includes a query encoding unit, a virtual graph construction unit, and a graph attention retrieval unit; The adaptive content generation module includes a template parsing unit, a graph alignment unit, and a prompt construction unit; The visualization interaction module includes a layout engine, a rendering unit, and an interaction response unit.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention employs GraphRAG technology to transform documents from various domains into structured knowledge graphs, replacing traditional text block vector libraries. This enables the system to deeply understand and utilize complex semantic relationships within and across documents, significantly improving the semantic accuracy of subsequent retrieval and the ability to make associative inferences.
[0014] In the retrieval stage, this invention adopts a cross-knowledge base graph neural network retrieval method. By constructing a virtual unified graph and using a graph attention network, it achieves real-time deep fusion and intelligent weighting of information from multiple knowledge bases, directly providing accurate cross-domain knowledge support for the generation stage and overcoming the information fragmentation problem of traditional multi-database retrieval.
[0015] In the generation stage, this invention proposes a dynamic template graph fusion generation technology, which parses the document template into a structural graph and aligns and injects it with the retrieved knowledge subgraph in real time, driving the large model to perform context awareness. This ensures that the output text strictly follows the preset format specifications, deeply matches the retrieved knowledge, and can adaptively adjust the level of detail in the content, achieving a balance between accuracy and flexibility.
[0016] Finally, an interactive and dynamic knowledge graph display was implemented through visualization, which is linked with the knowledge base. Based on force-oriented layout and real-time update mechanism, it empowers users to intuitively understand knowledge relationships and discover hidden patterns through exploration and search. Attached Figure Description
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. In the drawings: Figure 1 This is a schematic diagram of the overall process of the multi-knowledge base fusion retrieval enhancement generation method of the present invention; Figure 2 This is a schematic diagram of the framework structure of the multi-knowledge base fusion-based retrieval enhancement generation visualization management system of the present invention. Detailed Implementation
[0018] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0019] This embodiment proposes a method, such as Figure 1 As shown, the steps include: Step S1: Create and maintain multiple independent knowledge bases for different business domains. Each knowledge base uses GraphRAG technology to process and store the uploaded domain documents as knowledge graphs. Step S2: In response to user queries, construct a virtual unified knowledge graph from multiple knowledge bases selected by the user and apply a graph attention network to perform semantic retrieval and deep fusion of cross-database information, and generate a retrieval-enhanced summary. Step S3: Align and fuse the enhanced search summary with the predefined document template structure to guide the large language model to generate text content that conforms to the template framework and is deeply integrated with search knowledge.
[0020] This embodiment provides intelligent text and document processing services through multi-knowledge base fusion and retrieval enhancement generation technology combined with a visual interface. By constructing multiple independent knowledge bases, each corresponding to a specific business domain, it supports users to upload documents such as regulations, financial documents, and operation manuals, and to perform CRUD (Create, Read, Update, Delete) management.
[0021] Specifically, the system first creates a dedicated knowledge base for each business area through the system interface. For contract review or financial verification, the system names and identifies the scope of the area. When users upload regulatory financial documents or operation manuals, the system automatically receives documents in multiple formats and stores them in a distributed file system.
[0022] GraphRAG technology is used for document preprocessing, and deep relationships within the document content are analyzed based on graph structure. Each document is segmented into semantically coherent content blocks, and then a large language model is used to extract key entities, contract terms or financial indicators, and semantic relationships between entities from the content blocks. The extraction process utilizes a pre-trained BERT encoder layer to perform contextual embedding to identify entity types and relationship categories, forming preliminary node and edge data.
[0023] Extracted entities are used as nodes, and relationships are used as edges. All content block information is integrated to construct a cross-document knowledge graph. A graph neural network is used for node embedding to optimize the capture of indirect references between contract terms and compliance regulations. The constructed knowledge graph is stored in Neo4j, and full-text search indexes are built for nodes and edges to support efficient traversal and querying. The graph structure transforms unstructured documents into a structured knowledge network, enhancing the semantic accuracy of subsequent retrieval.
[0024] The knowledge base management system provides CRUD (Create, Read, Update, Delete) functions, allowing users to view the knowledge base file list through an interface and monitor file upload status and large model learning progress in real time. It also supports users deleting or replacing documents to trigger GraphRAG to re-analyze and update the knowledge graph. The visualization component automatically generates an interactive keyword relationship graph after the knowledge base is built, using graph database visualization tools to present the network layout of nodes and edges. Users can explore content relationships through drag-and-drop operations, such as viewing the connection paths between financial data fields and validation rules, enhancing the intuitiveness of knowledge browsing. In the retrieval enhancement process, cross-knowledge base graph neural retrieval technology is employed to accurately retrieve relevant information from multiple selected knowledge bases. The specific steps are as follows: Users input prompts or upload files to be processed through the interactive interface. The system uses a large language model to perform deep semantic encoding on the user's query, generating a high-dimensional query vector. Simultaneously, the user interface provides a multi-select list displaying all built independent knowledge bases. Users select their target knowledge base, and the system records these selections as the basis for the search scope.
[0025] The system accesses the pre-built GraphRAG knowledge graph at the underlying level of each selected knowledge base. Then, it logically connects the individual graphs in memory to create a virtual unified knowledge graph for this query. Connection points are automatically established through pre-identified shared core entities or topic nodes across different knowledge bases. Subsequently, starting with the query vector, the system executes a random walk algorithm on the virtual unified knowledge graph, prioritizing nodes that are highly semantically relevant to the query and located on connection paths between different knowledge bases, dynamically sampling subgraph structures containing multi-source information.
[0026] The sampled cross-database subgraph and the initial query vector are input into a pre-trained graph attention network. This network, while focusing on the text embedding vector of each node, dynamically calculates the importance weight of each node in the subgraph for the current query through an attention mechanism. This significantly increases the weight of information from different knowledge bases that is highly relevant to the query, while suppressing relevant but redundant or secondary information. The final output is a deeply fused and importance-reordered set of node-sequential contextual information.
[0027] A large language model is used to summarize and integrate the rearranged information set to generate a search-enhanced summary directly targeting the user's query. This summary is then used as the most relevant context and merged with the user's original suggestions to construct the final enhanced suggestion, which is then fed into the text generation model. In this way, the generation model relies on accurate cross-database knowledge that has undergone deep filtering, weighting, and fusion via graph neural networks, rather than the unprocessed raw search fragments.
[0028] It is understandable that the multi-knowledge base retrieval and generation method proposed in this embodiment achieves semantic-level deep fusion and priority determination of multi-knowledge base information in the retrieval stage through the construction of a temporary virtual unified graph and the weight allocation mechanism of the graph attention network, providing more accurate knowledge support for the generation step.
[0029] During the generation phase, the LightRAG mechanism combines document templates with a large language model to integrate search results and generate text content. This process adaptively adjusts the template to ensure that the output content highly matches user needs. Users can view the status of the knowledge base files and the learning progress of the large model in real time, and monitor the task processing status through a progress bar. The specific steps are as follows: A deep learning parser is used to process user-uploaded compliance review reports and financial voucher templates. This deep learning parser, based on a sequence-to-graph neural network, parses the template's chapters, paragraphs, lists, titles, tables, emphasized text, and reserved variable slots into a directed acyclic graph, called the template structure graph. Nodes in the graph represent logical units within the template, and edges represent the structural relationships between units. Each variable slot node is accompanied by type constraints and a generation prompt description.
[0030] The knowledge subgraph obtained from the cross-database retrieval in the previous stage is aligned with the template structure graph in real time. This process is accomplished by a graph attention alignment module, which calculates the semantic relevance score between each entity node in the knowledge subgraph and each variable slot node in the template graph, and establishes temporary connections. The relevance score is based on the similarity of text embeddings, the association strength between the entity in the knowledge graph and the query intent, and the contextual type constraints of the slot in the template. Subsequently, highly relevant knowledge graph nodes and their associated edges are injected into the corresponding slot nodes of the template graph, forming a fusion generation graph that integrates the template framework and specific knowledge.
[0031] After acquiring the fused graph, an adaptive serialization and hint construction process is performed based on it. The graph traversal engine selectively performs a depth-first traversal of the generated graph according to the user's query intent and predefined document generation logic. The order and level of detail of content generation are dynamically determined based on the traversal path. Specifically, if the retrieved knowledge indicates that a certain risk clause is extremely high, the traversal engine activates and prioritizes accessing detailed explanation branches related to that risk in the graph. Finally, the engine converts the sequence of traversed nodes into an enhanced hint sequence with structural tags and knowledge context.
[0032] The large language model receives the aforementioned enhanced prompt sequence as input. This sequence explicitly indicates the document's target structure, the generation requirements for each section, and the specific knowledge fragments embedded. The model generates text based on this, guiding the generation process through structural markers in the sequence to ensure the output strictly adheres to the template's chapter and format requirements. Simultaneously, the model elaborates on or directly quotes at nodes where knowledge has been injected, and creatively completes template nodes without specified details based on the overall context.
[0033] The final generated document precisely matches the template framework, deeply integrates search knowledge, and uses a graph traversal strategy to adaptively adjust the level of detail and focus of the content, ensuring a high degree of alignment with user needs.
[0034] The visualization generation process begins immediately after the knowledge base is built. This process uses interactive dynamic knowledge graph visualization technology to transform the structured graph data obtained from GraphRAG analysis within the knowledge base into graphical elements that can be manipulated and rendered on the front end. Specifically, the system backend extracts all graph data from the specified knowledge base from the graph database, including entity nodes and relation edges. Entity nodes correspond to contract clause names or financial data fields extracted from document content blocks, while relation edges represent semantic connections between concepts.
[0035] The visualization generation engine works in collaboration with a force-directed graph layout algorithm and a web graphics library. The engine first converts entity nodes and relation edge data into a front-end recognizable data format. Then, the force-directed layout algorithm calculates the initial position of each node. This algorithm simulates the attraction and repulsion forces in a physical system, naturally attracting semantically related nodes closer together and pushing away unrelated or weakly related nodes. This automatically forms a graphical layout that reflects the inherent structure of the knowledge. The visual style of the nodes is dynamically adjusted based on attributes. Node size is positively correlated with its frequency or importance in the knowledge base, edge thickness corresponds to relation strength, and color coding is used to distinguish entity types.
[0036] When users access the visualization interface through a browser, the system renders a complete knowledge graph view in real time. Users can drag any node with the mouse to rearrange the layout locally, zoom in and out using the scroll wheel to focus on specific clusters, and click on any node to highlight its directly related edges and adjacent nodes. A sidebar simultaneously displays the node's detailed attributes, such as the source document name, a summary of its content, and a list of other related nodes. The interface includes a built-in search function; after a user enters keywords, the system instantly highlights all matching nodes in the graph and animated the connections between them, helping users quickly locate key concept networks.
[0037] When users add, delete, or modify documents in the knowledge base, the system automatically triggers GraphRAG's incremental analysis process, updating the underlying knowledge graph data and immediately pushing data update instructions to the front end. The front-end visualization engine seamlessly receives the new data and uses smooth transition animations to readjust node positions and edge connections, ensuring that the visualization view always remains consistent with the latest state of the knowledge base. Through interactive dynamic graphs, while statically displaying keyword relationships, user-driven real-time exploration reveals hidden semantic patterns and cross-document associations in the knowledge base, greatly enhancing the intuitiveness and deep insight capabilities of knowledge management.
[0038] The system interface integrates a knowledge base management panel, displaying file names, upload status, and processing progress. It supports multiple database selection and fusion applications, optimizing search results.
[0039] The system is deployed in a node machine environment and can pre-load internal company documents while allowing users to upload custom files to expand the knowledge base as needed. The interactive workflow includes file upload, input prompts, task execution, and result output, generating review comments, operation guides, or financial documents, and enhancing usability with color-coding and contact information. The system also supports connection to external systems such as the company's OA financial module for automated data entry.
[0040] This embodiment further proposes a multi-knowledge base fusion-based enhanced retrieval and visualization management system, the framework of which is as follows: Figure 2As shown, it includes a knowledge base construction and management module, a cross-database retrieval and fusion module, and an adaptive content generation module; The knowledge base construction and management module is used to create and maintain multiple independent knowledge bases and realize the knowledge graphization of documents based on GraphRAG technology. It includes a document processing unit, a graph construction unit, and a graph database storage unit.
[0041] The cross-database retrieval and fusion module is used to respond to user queries and perform cross-database graph neural network retrieval and deep information fusion from selected knowledge bases. It includes a query encoding unit, a virtual graph construction unit, and a graph attention retrieval unit.
[0042] The adaptive content generation module is used to integrate the search results with the document template and guide the large model to generate structured text, including a template parsing unit, a graph alignment unit, and a prompt construction unit.
[0043] The visualization and interaction module is used to dynamically visualize and interact with the knowledge graph, including a template parsing unit, a graph alignment unit, and a prompt construction unit.
[0044] In summary, this embodiment improves retrieval accuracy through multi-knowledge base fusion, lowers the barrier to entry through visual management, and is applicable to various scenarios such as contract review, employee consultation, and financial verification. Based on LightRAG and knowledge graph technology, it ensures that content generation is controllable and highly adaptable.
[0045] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for multi-knowledge base fusion for search enhancement generation, characterized in that, Includes the following steps: Step S1: Create and maintain multiple independent knowledge bases for different business domains. Each knowledge base uses GraphRAG technology to process and store the uploaded domain documents as knowledge graphs. Step S2: In response to user queries, construct a virtual unified knowledge graph from multiple knowledge bases selected by the user and apply a graph attention network to perform semantic retrieval and deep fusion of cross-database information, and generate a retrieval-enhanced summary. Step S3: Align and fuse the enhanced search summary with the predefined document template structure to guide the large language model to generate text content that conforms to the template framework and is deeply integrated with search knowledge.
2. The method of claim 1, wherein, Step S1 specifically includes: S11. Receive and store domain documents in various formats uploaded by users to the distributed file system; S12. Use a large language model to extract key entities and semantic relationships between entities from document content blocks; S13. Using the entities as nodes and semantic relationships as edges, construct a cross-document knowledge graph and store it in a graph database, while simultaneously establishing a full-text search index.
3. The method of claim 1, wherein, Step S2 specifically includes: S21. Encode the user query into a high-dimensional query vector and obtain the list of target knowledge bases selected by the user; S22. Based on the underlying knowledge graph of each target knowledge base, a virtual unified knowledge graph for this query is constructed in memory by sharing entity or topic nodes; S23. Starting from the query vector, perform subgraph sampling based on random walk on the virtual unified knowledge graph; S24. Input the sampled subgraph and the query vector into the graph attention network, calculate the importance weight of each node for the current query, and output the rearranged set of context information. S25. Summarize and integrate the context information set to form a search-enhanced summary.
4. The method of claim 1, wherein, Step S3 specifically includes: S31. Use a sequence-to-graph neural network to parse a predefined document template into a template structure graph, wherein the nodes in the graph include variable slots; S32. Using the graph attention alignment module, the retrieved knowledge subgraph obtained in step S2 is semantically aligned with the template structure graph, and relevant knowledge nodes are injected into the corresponding variable slots to form a fusion generation graph. S33. Based on the user's query intent, the fused generated graph is adaptively traversed to generate an enhanced prompt sequence containing structural markers and knowledge context; S34. Input the enhanced prompt sequence into a large language model to generate the final text.
5. The method of claim 1, wherein, The method also includes a step of visual management: S41. Extract knowledge graph data from the graph database and generate an interactive visualization view based on the force-directed graph layout algorithm; S42. Render the visualization view in real time on the front-end interface and provide interactive functions such as node dragging, zooming, highlighting associations, and keyword search; S43. When the knowledge base content is updated, the graph data is automatically updated and the visualization view is updated synchronously with a smooth animation on the front end.
6. A multi-knowledge base integrated retrieval enhancement generation visualization management system, characterized in that, The system for implementing the method as described in any one of claims 1 to 5 comprises: The knowledge base construction and management module is used to create and maintain multiple independent knowledge bases, and to realize the knowledge graphization of documents based on GraphRAG technology; The cross-database retrieval and fusion module is used to respond to user queries and perform cross-database graph neural retrieval and deep information fusion from the selected knowledge base; The adaptive content generation module is used to integrate search results with document templates and guide the large model to generate structured text. The visualization and interaction module is used to dynamically visualize and interact with the knowledge graph.
7. The system according to claim 6, characterized in that, The knowledge base construction and management module includes a document processing unit, a graph construction unit, and a graph database storage unit; The cross-database retrieval and fusion module includes a query encoding unit, a virtual graph construction unit, and a graph attention retrieval unit; The adaptive content generation module includes a template parsing unit, a graph alignment unit, and a prompt construction unit; The visualization interaction module includes a layout engine, a rendering unit, and an interaction response unit.