Business-adaptive RAG knowledge base rapid question and answer implementation method

By building a business-enhanced knowledge base and executing multi-level dynamic retrieval, the problems of shallow knowledge integration, low retrieval accuracy, and uncontrollable generation of RAG technology in enterprise applications are solved, achieving efficient, accurate, and secure enterprise-level question-and-answer services.

CN121786159APending Publication Date: 2026-04-03YIJIN TECH (SHANGHAI) CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing RAG technology suffers from shallow knowledge integration, low retrieval accuracy, and weak controllability in enterprise applications. It is difficult to understand business terminology, process logic, and internal rules, resulting in inaccurate answers and potential leakage of sensitive information.

Method used

We build a business-enhanced knowledge base, identify and link business entities through multi-level dynamic retrieval, label rich business attribute metadata, perform progressive retrieval based on keywords, semantic vectors and business knowledge graphs, generate answers by combining large language models, and ensure the accuracy and security of answers through fact verification and permission filtering.

Benefits of technology

It achieves deep integration of fragmented and structured business knowledge, ensuring that search results are highly relevant to the business context, generating accurate and secure answers, and adapting to the rapidly changing business needs of enterprises.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786159A_ABST
    Figure CN121786159A_ABST
Patent Text Reader

Abstract

The invention discloses a business-adaptive RAG knowledge base rapid question and answer implementation method, relates to the technical field of natural language processing and knowledge base retrieval, and realizes deep fusion and accurate context extraction of fragmented and structured business knowledge by constructing a business enhanced knowledge base and executing multi-stage dynamic retrieval. When an original business document is subjected to intelligent structured analysis and segmentation, a link business entity is identified, rich business attribute metadata is marked, in the process, an unstructured text is converted into an enhanced knowledge fragment carrying clear business semantics, a semantic vector is generated through an embedded model, and on the basis, the semantic vector is subjected to semantic segmentation; according to the method, rapid preliminary screening based on keywords and metadata, fine arrangement based on semantic vectors and association expansion based on a business knowledge graph are sequentially executed, the progressive retrieval strategy ensures that retrieval results are highly related to business contexts, and the accuracy of generated answers is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing and knowledge base retrieval technology, specifically to a business-adaptive method for rapid question answering using a RAG knowledge base. Background Technology

[0002] As enterprises deepen their digital transformation, unstructured knowledge such as business documents, process specifications, and product manuals is experiencing explosive growth. Traditional keyword-matching-based document retrieval and static question-and-answer dialogue systems struggle to handle complex, dynamic, and context-dependent business consultation needs. In recent years, Retrieval-Enhanced Generative Algorithm (RAG) technology, combining the advantages of information retrieval and large language models, has shown potential in open-domain question answering. However, general-purpose RAG frameworks face significant adaptation gaps when directly applied to complex and ever-changing business scenarios, failing to effectively understand business terminology, process logic, and inherent rules, thus greatly reducing their practicality.

[0003] Furthermore, at the knowledge representation level, existing technologies, particularly general text segmentation and vectorization methods, disrupt the inherent logical structure of business documents and fail to integrate business entities and metadata, resulting in a "flattened" knowledge representation and the loss of key business semantics. Secondly, at the retrieval level, single vector retrieval is easily misled by semantic similarity, returning fragments with low relevance or that are outdated. Simple keyword retrieval cannot handle complex business queries and lacks the ability to perform fine-grained filtering based on metadata and to perform associative reasoning based on business graphs. At the same time, at the generation and controllability level, directly splicing the retrieved original fragments into context lacks optimization for information redundancy, timeliness priority, and logical structure. Moreover, the generation process lacks effective constraints on the accuracy of business facts, terminology consistency, and security boundaries, which may leak sensitive information and make it difficult to adapt to rapid business changes.

[0004] In summary, existing RAG technologies face core challenges in enterprise-level applications, including shallow knowledge fusion, low retrieval accuracy, and weak generation controllability. Therefore, there is an urgent need for a novel RAG system construction and question-answering methodology that can deeply integrate business characteristics, achieve accurate retrieval, controllable generation, and continuous self-evolution. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a business-adaptive RAG knowledge base rapid question-answering implementation method. This method achieves deep integration and accurate context extraction of fragmented and structured business knowledge by constructing a business-enhanced knowledge base and performing multi-level dynamic retrieval. During intelligent structured parsing and segmentation of the original business documents, it identifies linked business entities and annotates rich business attribute metadata. This process transforms unstructured text into enhanced knowledge fragments carrying clear business semantics, and generates semantic vectors through an embedding model. Based on this, it sequentially performs rapid initial screening based on keywords and metadata, fine ranking based on semantic vectors, and association expansion based on the business knowledge graph. This progressive retrieval strategy ensures that within the response time, not only semantically relevant fragments are found, but also content with insufficient permissions or outdated content is filtered out through metadata. Furthermore, it mines key information that is indirectly related to the query and logically close through graph association, ensuring that the retrieval results are highly relevant to the business context and improving the accuracy of the generated answers.

[0006] To solve the above-mentioned technical problems, this invention provides the following technical solution: a business-adaptive RAG knowledge base rapid question-answering implementation method, the specific steps of which are as follows:

[0007] S100: Perform structured parsing and intelligent segmentation on the input business documents, identify and link the business entities within them, label the business attribute metadata of the segmented knowledge fragments, identify the business scenario to which the query belongs, generate semantic vector representations of each knowledge fragment, and construct a business-enhanced knowledge base that includes vector indexes, keyword indexes, and graph associations.

[0008] S200: Receive user query and sequentially obtain a set of relevant knowledge fragments from the business-enhanced knowledge base through first-level retrieval based on keywords and business attribute metadata, second-level retrieval based on semantic vector similarity, and third-level retrieval based on business knowledge graph association expansion.

[0009] S300. The candidate set of relevant knowledge fragments is dynamically weighted and reordered according to the current user's query intent classification, the relevance score of each knowledge fragment to the query, the timeliness tag in the business attribute metadata, and the degree of matching with the user's role permissions, and assembled into an optimized context sequence according to a preset context organization template.

[0010] S400. Input the user query and the optimized context sequence into the large language model, constrain the terminology expression by injecting a business terminology table, perform logical verification of the business facts in the generated text based on predefined fact verification rules, filter the content according to the user role, and output a traceable answer with reference knowledge fragments.

[0011] S500: Collect user feedback data on the output answers, optimize the embedding model and / or large language model based on the feedback data, and perform S100 to incrementally update the business-enhanced knowledge base for newly added business documents.

[0012] Furthermore, in S100, the structured parsing and intelligent segmentation specifically include:

[0013] Based on the format, chapter titles, numbering system, and layout characteristics of the business documents, the documents are divided into multiple knowledge segments that retain a logical structure.

[0014] The business entities include product models, internal codes, technical terms, and process nodes;

[0015] The business attribute metadata includes the department, project identifier, effective date, confidentiality level, and version number.

[0016] Furthermore, the specific steps of S200 are as follows:

[0017] S210, First-level retrieval: Based on the keywords in the user query and the business attribute metadata, a rapid initial screening is performed to obtain the first candidate fragment set;

[0018] S220, Second-level retrieval: Convert the user query into a query vector, calculate the cosine similarity between the query and the semantic vector of each knowledge segment in the first candidate segment set, and select the K segments with the highest similarity to form the second candidate segment set;

[0019] S230, Level 3 retrieval: Using the business entities identified in the second candidate fragment set as nodes, query the first-degree and second-degree related entities and their relationships in the business knowledge graph, and use the knowledge fragments corresponding to the related entities as the extended fragment set;

[0020] S240. Result fusion: The first candidate fragment set, the second candidate fragment set, and the extended fragment set are deduplicated and fused according to a preset priority rule to form a knowledge fragment candidate set.

[0021] Furthermore, in S300, the implementation process of dynamic weighting and reordering is as follows:

[0022] For each knowledge fragment candidate obtained in S200, a comprehensive weighted score is calculated, wherein the comprehensive weighted score is obtained by quantitatively evaluating and weighting multiple dimensions affecting the fragment quality, i.e., S zh (d,q)=w1·Sim xsd (v d ,v q )+w2·R(t d )+w3·P(ld ,r u )-w4·Re(d,C), where d represents a knowledge fragment to be sorted, q represents the user query, and Sim xsd (v d ,v q ) represents the segment semantic vector v generated based on S100. d With query semantic vector v q The cosine similarity is used to quantify semantic relevance, R(t) d () is based on the effective date t in the business attribute metadata. d The calculated time-dependent decay function, the value of which varies with t d The value decreases with increasing time from the current point in time, prioritizing the updating of knowledge, P(l d ,r u ) is the access control matching function, which matches the security level l of fragment d. d With the current user role r u Access permissions are matched, and a positive value is returned if access is allowed, otherwise zero is returned to ensure security filtering. Re(d,C) is used to measure the information overlap between fragment d and other fragments selected into the current optimization context sequence C. w1, w2, w3, w4 are adjustable positive weight coefficients corresponding to each dimension. All candidate fragments are sorted in descending order based on the calculated comprehensive weighted score to achieve reordering.

[0023] Furthermore, in step S300, the selection of the context organization template is based on the intent classification result of the user query. This intent classification involves analyzing the query text using a classifier and categorizing it into factual, process-oriented, and decision-oriented types, where:

[0024] For factual queries, the template adopts a structure of core answer, key parameters, and background information, placing factual fragments that directly match the query at the beginning of the context;

[0025] For process-oriented queries, the template adopts a structure of process triggering conditions, step sequence, step output, and exception handling branches, and organizes knowledge fragments according to the time sequence of the process;

[0026] For decision-making queries, the template adopts a structure of problem definition, comparison of alternative solutions, evaluation basis of solutions, and recommendation conclusion, and groups and arranges knowledge fragments that support different solutions according to the comparison dimension.

[0027] Furthermore, in S300, the step of optimizing the generation of the context sequence is as follows:

[0028] S310, Query Intent Recognition: Classify the user query intent and output classification labels, wherein the labels include one of fact query, process consultation, fault diagnosis, clause interpretation, and decision support;

[0029] S320, Dynamic scoring and sorting of candidate fragments: For the knowledge fragment candidate set obtained in S200, calculate the comprehensive weighted score of each fragment, and sort them in descending order according to the score to form a preliminary ordered list;

[0030] S330. Intent-based template selection and context assembly: Based on the query intent classification tags, select the corresponding template from the predefined context organization template library, select fragments sequentially from the preliminary ordered list according to the logical structure specified by the selected template, extract the core content and fill it into the corresponding position of the template, and output the optimized context sequence with clear structure, high information density and length that meets the model limit.

[0031] Furthermore, in step S400, the specific steps for logically verifying the generated text based on predefined fact verification rules are as follows:

[0032] After the large language model generates the answer text, a parallel fact verification subprocess is started. The fact verification subprocess extracts the business entity, key values, dates and phrases representing logical relationships from the generated text in real time as fact items to be verified.

[0033] Each fact item to be verified is matched and logically consistent with all source knowledge fragments in the optimized context sequence output by S300.

[0034] If a fact item to be verified is not explicitly supported in all source fragments, or directly contradicts the statements in the source fragments, then the fact item is marked as unverified or conflicting.

[0035] Based on the verification results, corresponding actions are triggered: for unverified items, limiting instructions are added to the final output answer; for conflicting items, the large language model is required to regenerate that part of the content based on the credible source fragment.

[0036] Furthermore, the fact verification rules include compliance constraints, business logic constraints, and expression specification constraints.

[0037] Furthermore, in S500, for newly added and modified business documents, the input business documents are structured and intelligently segmented in real time through S100. The generated new knowledge fragments and their vectors, indexes, and metadata are incrementally updated to the business-enhanced knowledge base, and the relevant graph relationships are updated synchronously to ensure the timeliness of knowledge.

[0038] Compared with existing technologies, this business-adaptive RAG knowledge base fast question answering implementation method has the following advantages:

[0039] This invention achieves deep integration and precise context extraction of fragmented and structured business knowledge by constructing a business-enhanced knowledge base and executing multi-level dynamic retrieval. During the intelligent structured parsing and segmentation of original business documents, it identifies linked business entities and annotates rich business attribute metadata. This process transforms unstructured text into enhanced knowledge fragments carrying clear business semantics, and generates semantic vectors through an embedding model. Based on this, it sequentially performs rapid initial screening based on keywords and metadata, fine ranking based on semantic vectors, and association expansion based on a business knowledge graph. This progressive retrieval strategy ensures that within the response time, not only are semantically relevant fragments found, but also content with insufficient permissions or outdated content is filtered out through metadata. Furthermore, it mines key information that is indirectly related to the query and logically close through graph association, ensuring that the retrieval results are highly relevant to the business context and improving the accuracy of the generated answers.

[0040] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description

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

[0042] Figure 1 A flowchart illustrating the steps involved in implementing a rapid question-answering method for a business-adaptive RAG knowledge base.

[0043] Figure 2 A flowchart illustrating the three-level progressive retrieval process in a business-adaptive RAG knowledge base rapid question-answering implementation method;

[0044] Figure 3 A flowchart illustrating the operation of a business-adaptive RAG knowledge base rapid question-answering implementation method. Detailed Implementation

[0045] To better understand the above technical solutions, a detailed description of the solutions will be provided below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0046] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a business-adaptive RAG knowledge base fast question-answering implementation method,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise; “plural” generally includes at least two.

[0047] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.

[0048] To address the shortcomings of existing technologies, this invention first describes the enterprise-level knowledge-based question-and-answer scenario. In today's digital operations, enterprises accumulate massive amounts of business documents, such as product specifications, project reports, process manuals, contract terms, and technical white papers. These documents are typically diverse in format, complex in structure, and dense with technical terminology, and are subject to frequent updates and version iterations. Employees need to quickly and accurately obtain information from these documents in their daily work to support decision-making, problem-solving, or process tracking. However, traditional full-text search or static FAQ systems struggle to meet the high requirements for accuracy, timeliness, security, and contextual relevance. The business-adaptive RAG (Retrieval Enhanced Generation) knowledge base rapid question-and-answer method provided by this invention is specifically designed for such complex business scenarios. It aims to achieve intelligent, accurate, and secure question-and-answer services through deep integration of business semantics, refined retrieval, and controllable generation.

[0049] This invention provides a business-adaptive RAG knowledge base rapid question answering implementation method. By constructing a business-enhanced knowledge base, performing a three-level progressive retrieval, dynamically optimizing the context, driving a large language model to generate traceable answers and continuously learning and optimizing, a complete intelligent question answering system is formed. This system deeply analyzes and enhances the representation of the original business documents, then accurately locates relevant knowledge through a multi-level hybrid retrieval mechanism, and then forms a high-quality context through intelligent sorting and assembly. Finally, a constrained large language model generates reliable answers, and self-evolution is achieved by combining user feedback.

[0050] Specifically, such as Figure 1 As shown, a business-adaptive RAG knowledge base fast question-answering implementation method is described, and the specific steps of the method are as follows:

[0051] S100: Perform structured parsing and intelligent segmentation on the input business documents, identify and link the business entities within them, label the business attribute metadata of the segmented knowledge fragments, identify the business scenario to which the query belongs, generate semantic vector representations of each knowledge fragment, and construct a business-enhanced knowledge base that includes vector indexes, keyword indexes, and graph associations.

[0052] S200: Receive user query and sequentially obtain a set of relevant knowledge fragments from the business-enhanced knowledge base through first-level retrieval based on keywords and business attribute metadata, second-level retrieval based on semantic vector similarity, and third-level retrieval based on business knowledge graph association expansion.

[0053] S300. The candidate set of relevant knowledge fragments is dynamically weighted and reordered according to the current user's query intent classification, the relevance score of each knowledge fragment to the query, the timeliness tag in the business attribute metadata, and the degree of matching with the user's role permissions, and assembled into an optimized context sequence according to a preset context organization template.

[0054] S400. Input the user query and the optimized context sequence into the large language model, constrain the terminology expression by injecting a business terminology table, perform logical verification of the business facts in the generated text based on predefined fact verification rules, filter the content according to the user role, and output a traceable answer with reference knowledge fragments.

[0055] S500: Collect user feedback data on the output answers, optimize the embedding model and / or large language model based on the feedback data, and perform S100 to incrementally update the business-enhanced knowledge base for newly added business documents.

[0056] In practical implementation, S100 is used to transform unstructured raw business documents into an enhanced knowledge fragment library rich in business semantics and easy to retrieve efficiently. It receives input business documents and performs structured parsing and intelligent segmentation. The parsing process is based on the inherent logical characteristics of the document. For example, for technical manuals, it identifies chapter titles, numbering systems, tables, chart captions, and specific page layouts. Based on these characteristics, the document is split into multiple knowledge fragments that retain the original logical coherence. While segmenting, a pre-trained or fine-tuned named entity recognition model is used to identify and link key business entities from the text, including: specific product models, unique codes used internally by the enterprise, domain-specific terms, and key nodes in the business process. These identified entities are not only part of the text content, but are also extracted and an index relationship between entities and fragments is established. Furthermore, each knowledge fragment is annotated with rich business attribute metadata. This metadata originates from document content analysis, document attributes, information specified during user uploads, and information inferred through rules. The metadata fields include: the department or business line to which the document / fragment belongs, the associated project identifier, the effective date or last update date of the content, the confidentiality level, and the document version number. This metadata provides key dimensions for subsequent fine-grained filtering and sorting based on business rules. After completing the content and metadata annotation, each knowledge fragment is transformed into a high-dimensional semantic vector representation through an embedding model, constructing a business-enhanced knowledge base with multiple indexes. This business-enhanced knowledge base includes a vector index: storing the semantic vectors of all fragments and supporting approximate nearest neighbor search; a keyword and metadata inverted index: supporting efficient Boolean queries on business entities, terms, and various metadata fields; and a business knowledge graph: constructing a lightweight association network with identified business entities as nodes and relationships such as co-occurrence, affiliation, and sequential order in documents as edges, supporting associative reasoning.

[0057] When S200 receives a user's natural language query, it initiates a three-level progressive retrieval process, such as... Figure 2 As shown, the specific search steps are as follows:

[0058] S210, First-level retrieval: Based on the keywords in the user query and the business attribute metadata, a rapid initial screening is performed to obtain the first candidate fragment set;

[0059] S220, Second-level retrieval: Convert the user query into a query vector, calculate the cosine similarity between the query and the semantic vector of each knowledge segment in the first candidate segment set, and select the K segments with the highest similarity to form the second candidate segment set;

[0060] S230, Level 3 retrieval: Using the business entities identified in the second candidate fragment set as nodes, query the first-degree and second-degree related entities and their relationships in the business knowledge graph, and use the knowledge fragments corresponding to the related entities as the extended fragment set;

[0061] S240. Result fusion: The first candidate fragment set, the second candidate fragment set, and the extended fragment set are deduplicated and fused according to a preset priority rule to form a knowledge fragment candidate set.

[0062] S300 performs refined evaluation and organization of the candidate set, generating an optimized context sequence tailored to the large language model. In this embodiment, the user query is first classified by intent. A pre-trained text classifier is used to analyze the query and categorize it into preset intent categories, such as: factual queries (asking about specific parameters or definitions), process queries (asking about operation steps or approval flows), decision-making queries (requesting solution comparison or risk assessment), fault diagnosis queries, and clause interpretation queries. This classification result will directly guide the subsequent context organization strategy. For each fragment d in the knowledge fragment candidate set obtained in S200, a comprehensive weighted score S is calculated. zh (d,q), the S zh (d,q)=w1·Sim xsd (v d ,v q )+w2·R(t d )+w3·P(l d ,r u )-w4·Re(d,C), where d represents a knowledge fragment to be sorted, q represents the user query, and Sim xsd (v d ,v q ) represents the segment semantic vector v generated based on S100. d With query semantic vector v q The cosine similarity is used to quantify semantic relevance, R(t) d () is based on the effective date t in the business attribute metadata. d The calculated time-dependent decay function, the value of which varies with t d The value decreases with increasing time from the current point in time, prioritizing the updating of knowledge, P(l d ,r u ) is the access control matching function, which matches the security level l of fragment d. d With the current user role r uAccess permissions are matched, and a positive value is returned if access is allowed, otherwise zero is returned to ensure security filtering. Re(d,C) is used to measure the information overlap between fragment d and other fragments selected into the current optimized context sequence C. w1, w2, w3, and w4 are adjustable positive weight coefficients corresponding to each dimension. All candidate fragments are sorted in descending order based on the calculated comprehensive weighted score to achieve reordering. Based on the query intent classification results, the most matching template is selected from a predefined context organization template library. The template specifies the structure of the answer and the organization logic of the fragments. In this embodiment, the template includes:

[0063] Fact-based query template: It adopts the structure of "core answer, key parameters / attribute column, relevant background / basis explanation", and the fact fragments that are sorted first and directly match the query are placed at the beginning of the context.

[0064] Process-oriented query template: It adopts the structure of "process triggering conditions and inputs, input / operation / output, exception handling and branch judgment", and knowledge fragments are organized and filled according to the time or logical order of the process.

[0065] Decision-making query template: It adopts the structure of "problem definition and constraints, description / advantages / disadvantages / applicable conditions, comprehensive evaluation and recommendations", which supports the grouping and comparison of knowledge fragments of different solutions.

[0066] Finally, according to the structure of the selected template, the high-scoring fragments are selected sequentially from the preliminary ordered list, their core content is extracted, and they are filled into the corresponding positions in the template. At the same time, the total length of the generated context is monitored to ensure that it does not exceed the input token limit of the backend large language model. Finally, an optimized context sequence with a clear structure, high information density, and logical coherence is output. Each cited knowledge fragment is accompanied by its source identifier, laying the foundation for the traceability of the answer.

[0067] S400 inputs the user query and the assembled optimized context sequence into the selected large language model. Before or during generation, the following mechanisms ensure the accuracy, compliance, and security of the answer:

[0068] Business terminology constraint: The enterprise's internal business terminology is injected as prompt words, forcing the model to maintain terminology consistency during generation.

[0069] Fact Validation and Logical Verification: After the model generates the initial answer text, a parallel fact validation subprocess is initiated. This subprocess uses rules and a lightweight model to extract key business entities, numerical values, dates, and phrases representing conditional and causal relationships from the generated text in real time as fact items to be validated. These fact items are then compared item by item with the optimized context sequence (i.e., a reliable source) output by the S300. The validation rules include:

[0070] Compliance constraints: Check whether the content complies with predefined rules and terms.

[0071] Business logic constraints: Check whether the statements conform to business rules.

[0072] Expression constraints: Check for absolute assertions.

[0073] If a fact is not explicitly supported by the source fragment, it is marked as unverified; if it directly contradicts the source fragment, it is marked as conflicting. For unverified items, a limiting statement is added to the corresponding part of the final answer; for conflicting items, the large language model is required to regenerate that part based on the credible source fragment.

[0074] Role-based content filtering: Before the final output, the generated text is scanned again based on the current user's role to filter out or desensitize sensitive information that the role does not have the right to view, ensuring information security. The final output is a traceable answer with source identifiers for reference knowledge fragments, and may include confidence level prompts or verification instructions.

[0075] S500 provides a user feedback interface. The collected feedback data is used to continuously fine-tune the semantic embedding model, making it better able to understand enterprise-specific semantic similarities. For newly added or revised business documents, the S100 process is triggered in real-time or periodically to parse them into new knowledge fragments and incrementally update the vector index, keyword index, and knowledge graph of the business-enhanced knowledge base, while simultaneously updating relevant metadata to ensure the timeliness and completeness of knowledge. This process achieves self-evolution capabilities, adapting to rapid business changes.

[0076] like Figure 3 As shown, this paper illustrates a business-adaptive method for implementing rapid question answering in the RAG knowledge base. The specific process for rapid question answering in the RAG knowledge base is as follows:

[0077] (1) Building a business-enhanced knowledge base

[0078] Document parsing and intelligent segmentation: Receives business documents in various formats and intelligently splits them into multiple knowledge fragments that retain their original logical relationships based on their structural characteristics such as format, chapter titles, and numbering systems.

[0079] Business entity identification and linking: Deep analysis is performed on each knowledge fragment to identify key business entities, such as product models, internal codes, and technical terms, and these entities are linked to the existing business knowledge graph to establish relationships.

[0080] Business metadata annotation: Annotate each knowledge fragment with rich business attribute metadata.

[0081] Semantic vectorization representation: Using an embedding model fine-tuned with business domain data, the text content of each knowledge fragment is converted into a high-dimensional semantic vector.

[0082] Multimodal index construction: The results of the above processing are persisted and stored, and three types of indexes are constructed:

[0083] Vector index: Stores semantic vectors of knowledge fragments, supporting fast similarity search.

[0084] Keyword Index: Stores text content and business entities, and supports keyword and metadata matching.

[0085] Knowledge Graph Association Index: Stores the relationships between entities and knowledge fragments in the knowledge graph, supporting extended retrieval based on associations.

[0086] (2) Quick Q&A for user queries

[0087] Receive and parse user queries: Receive natural language questions submitted by users.

[0088] Identify query intent: Analyze user queries to determine their intent category.

[0089] Three-level progressive retrieval: Retrieving relevant fragments from the constructed knowledge base:

[0090] Level 1: Keyword and metadata retrieval: Based on the keywords and business attributes in the query, quick matching and initial screening are performed to obtain the first round of candidate fragment set.

[0091] Level 2: Semantic Vector Refinement: The user query is also converted into a semantic vector, and the similarity is calculated with the fragment vectors in the first-level search results. The fragments are then refined according to their similarity and the most relevant fragments are selected.

[0092] Level 3: Graph Association Expansion: Starting with the business entities in the finely arranged fragments, search for entities with first- or second-degree associations in the business knowledge graph, and retrieve the knowledge fragments corresponding to these associated entities to supplement potential indirect related contexts.

[0093] (3) Dynamic weighting and context assembly

[0094] Multi-dimensional scoring: For all retrieved candidate fragments, a comprehensive weighted score is calculated by taking into account their semantic relevance to the query, the timeliness of the metadata, the degree of matching with the user's role permissions, and the information redundancy between fragments.

[0095] Assemble by Intent Template: Based on the identified query intent, select the corresponding context organization template. Then, according to the segment's score, fill in the core content of the segment according to the template structure, assembling it into an optimized context sequence that is information-condensed and logically clear.

[0096] (4) Controllable content generation and verification

[0097] Constrained text generation: Input the user query and the assembled context sequence into the large language model, and require the model to strictly follow the pre-defined business terminology list when generating the answer.

[0098] Fact verification and access control filtering: Perform fact verification on the initial answers generated by the model to ensure that key data, dates and logic are consistent with the context. At the same time, filter out sensitive information that the user does not have permission to access based on user roles.

[0099] Output traceable answers: Return the final answer to the user along with the source of the knowledge fragments referenced in the answer, ensuring the traceability and credibility of the answer.

[0100] (5) Continuous optimization

[0101] New business: When there are new or modified business documents, the knowledge base incremental update process is automatically started to ensure the timeliness of knowledge and complete this Q&A.

[0102] In summary, through the close integration and synergy of the above steps, this invention constructs an intelligent question-answering system that deeply integrates business characteristics, provides accurate and controllable retrieval, and generates reliable and traceable results. It effectively solves the core challenges faced by general RAGs in enterprise scenarios, such as the flattening of knowledge representation, insufficient retrieval accuracy, and uncontrollable generation. It provides a complete technical solution for enterprises to achieve efficient, accurate, and secure information acquisition from massive, complex, and dynamic business knowledge.

[0103] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A business-adaptive method for rapid question answering using a RAG knowledge base, characterized in that: The specific steps of this method are as follows: S100: Perform structured parsing and intelligent segmentation on the input business documents, identify and link the business entities within them, label the business attribute metadata of the segmented knowledge fragments, identify the business scenario to which the query belongs, generate semantic vector representations of each knowledge fragment, and construct a business-enhanced knowledge base that includes vector indexes, keyword indexes, and graph associations. S200: Receive user query and sequentially obtain a set of relevant knowledge fragments from the business-enhanced knowledge base through first-level retrieval based on keywords and business attribute metadata, second-level retrieval based on semantic vector similarity, and third-level retrieval based on business knowledge graph association expansion. S300. The candidate set of relevant knowledge fragments is dynamically weighted and reordered according to the current user's query intent classification, the relevance score of each knowledge fragment to the query, the timeliness tag in the business attribute metadata, and the degree of matching with the user's role permissions, and assembled into an optimized context sequence according to a preset context organization template. S400. Input the user query and the optimized context sequence into the large language model, constrain the terminology expression by injecting a business terminology table, perform logical verification of the business facts in the generated text based on predefined fact verification rules, filter the content according to the user role, and output a traceable answer with reference knowledge fragments. S500: Collect user feedback data on the output answers, optimize the embedding model and / or large language model based on the feedback data, and perform S100 to incrementally update the business-enhanced knowledge base for newly added business documents.

2. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 1, characterized in that, In S100, structured parsing and intelligent segmentation specifically include: Based on the format, chapter titles, numbering system, and layout characteristics of the business documents, the documents are divided into multiple knowledge segments that retain a logical structure. The business entities include product models, internal codes, technical terms, and process nodes; The business attribute metadata includes the department, project identifier, effective date, confidentiality level, and version number.

3. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 1, characterized in that, The specific steps of S200 are as follows: S210, First-level retrieval: Based on the keywords in the user query and the business attribute metadata, a rapid initial screening is performed to obtain the first candidate fragment set; S220, Second-level retrieval: Convert the user query into a query vector, calculate the cosine similarity between the query and the semantic vector of each knowledge segment in the first candidate segment set, and select the K segments with the highest similarity to form the second candidate segment set; S230, Level 3 retrieval: Using the business entities identified in the second candidate fragment set as nodes, query the first-degree and second-degree related entities and their relationships in the business knowledge graph, and use the knowledge fragments corresponding to the related entities as the extended fragment set; S240. Result fusion: The first candidate fragment set, the second candidate fragment set, and the extended fragment set are deduplicated and fused according to a preset priority rule to form a knowledge fragment candidate set.

4. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 1, characterized in that, In S300, the implementation process of dynamic weighting and reordering is as follows: For each knowledge fragment candidate obtained in S200, a comprehensive weighted score is calculated, wherein the comprehensive weighted score is obtained by quantitatively evaluating and weighting multiple dimensions affecting the fragment quality, i.e., S zh (d,q)=w1ΨSim xsd (v d ,v q )+w2·R(t d )+w3·P(l d ,r u )-w4·Re(d,C), where d represents a knowledge fragment to be sorted, q represents the user query, and Sim xsd (v d ,v q ) represents the segment semantic vector v generated based on S100. d With query semantic vector v q The cosine similarity is used to quantify semantic relevance, R(t) d () is based on the effective date t in the business attribute metadata. d The calculated time-dependent decay function, P(l) d ,r u ) is the access control matching function, which matches the security level l of fragment d. d With the current user role r u Access is matched based on permissions. If access is allowed, a positive value is returned; otherwise, zero is returned. Re(d,C) is used to measure the information overlap between fragment d and other fragments selected into the current optimization context sequence C. w1, w2, w3, w4 are adjustable positive weight coefficients corresponding to each dimension. All candidate fragments are sorted in descending order based on the calculated comprehensive weighted score.

5. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 4, characterized in that, In step S300, the selection of the context organization template is based on the intent classification result of the user query. The intent classification analyzes the query text using a classifier and categorizes it into factual, process-oriented, and decision-oriented types, where: For factual queries, the template adopts a structure of core answer, key parameters, and background information, placing factual fragments that directly match the query at the beginning of the context; For process-oriented queries, the template adopts a structure of process triggering conditions, step sequence, step output, and exception handling branches, and organizes knowledge fragments according to the time sequence of the process; For decision-making queries, the template adopts a structure of problem definition, comparison of alternative solutions, evaluation basis of solutions, and recommendation conclusion, and groups and arranges knowledge fragments that support different solutions according to the comparison dimension.

6. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 5, characterized in that, In step S300, the step of optimizing the generation of the context sequence is as follows: S310, Query Intent Recognition: Classify the user query intent and output classification labels, wherein the labels include one of fact query, process consultation, fault diagnosis, clause interpretation, and decision support; S320, Dynamic scoring and sorting of candidate fragments: For the knowledge fragment candidate set obtained in S200, calculate the comprehensive weighted score of each fragment, and sort them in descending order according to the score to form a preliminary ordered list; S330. Intent-based template selection and context assembly: Based on the query intent classification tags, select the corresponding template from the predefined context organization template library, select fragments sequentially from the preliminary ordered list according to the logical structure specified by the selected template, extract the core content and fill it into the corresponding position of the template, and output the optimized context sequence.

7. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 1, characterized in that, In step S400, the specific steps for logically verifying the generated text based on predefined fact verification rules are as follows: After the large language model generates the answer text, a parallel fact verification subprocess is started. The fact verification subprocess extracts the business entity, key values, dates and phrases representing logical relationships from the generated text in real time as fact items to be verified. Each fact item to be verified is matched and logically consistent with all source knowledge fragments in the optimized context sequence output by S300. If a fact item to be verified is not explicitly supported in all source fragments, or directly contradicts the statements in the source fragments, then the fact item is marked as unverified or conflicting. Based on the verification results, corresponding actions are triggered: for unverified items, limiting instructions are added to the final output answer; for conflicting items, the large language model is required to regenerate that part of the content based on the credible source fragment.

8. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 7, characterized in that, The fact verification rules include compliance constraints, business logic constraints, and expression standardization constraints.

9. The method for implementing rapid question answering in a business-adaptive RAG knowledge base according to claim 1, characterized in that, In step S500, for newly added and modified business documents, the input business documents are structured and intelligently segmented in real time through step S100. The generated new knowledge fragments and their vectors, indexes, and metadata are incrementally updated to the business-enhanced knowledge base, and the relevant graph relationships are updated synchronously.

Citation Information

Cited By

  • Intelligent place name and address data matching and retrieval method based on large language model

    CN122019574A

  • Database metadata information processing method and system based on RAG and large model

    CN122019734A

  • A large model knowledge base construction method and device, medium and equipment

    CN122153014A