Knowledge base dynamic retrieval method and system based on RAG

By vectorizing knowledge base information and semantically identifying user intent, establishing retrieval quality evaluation indicators, and dynamically adjusting matching parameters, the problems of low retrieval accuracy and poor diversity in RAG information retrieval in dynamic knowledge bases are solved, and efficient multi-scenario query and real-time optimization are achieved.

CN120670480AInactive Publication Date: 2025-09-19SICHUAN GAOLU INFORMATION TECHNOLOGY CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511178795.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-09-19
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing RAG information retrieval methods cannot meet the retrieval requirements of multi-scenario queries in dynamic knowledge bases. They have problems such as low retrieval accuracy, insufficient timeliness and poor result diversity. They are difficult to adapt to the real-time changes in knowledge base content and the diverse needs of user intentions.

Method used

By vectorizing knowledge base information and semantically identifying user intent, establishing retrieval quality evaluation indicators, dynamically adjusting matching parameters, performing iterative optimization and secondary matching, and improving retrieval accuracy.

Benefits of technology

It has achieved improved retrieval accuracy in dynamic knowledge bases, met the retrieval requirements of multi-scenario queries, improved the relevance, timeliness and diversity of retrieval results, and adapted to user feedback for real-time optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670480A_ABST
    Figure CN120670480A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge base dynamic retrieval method and system based on RAG, and relates to the technical field of information retrieval, and the method comprises the following steps: obtaining all information of a knowledge base, vectorizing and classifying different types of documents in all information of the knowledge base, and obtaining retrieval feature tags of all information in the knowledge base; the method comprises the following steps: collecting user retrieval input information, performing semantic recognition analysis on the user retrieval input information, judging a user retrieval intention, and configuring matching parameters; according to the method, vectorization is carried out on knowledge base information in advance, user intention is subjected to semantic recognition, preliminary feedback is made, meanwhile, retrieval quality evaluation and dynamic matching parameter adjustment are carried out on retrieval output results, then iterative optimization and secondary matching can be carried out on the retrieval output results according to user feedback conditions, and retrieval precision is improved. The problem that in the prior art, RAG information retrieval cannot meet the retrieval requirement of dynamic knowledge base multi-scene query is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information retrieval technology, and in particular to a RAG-based knowledge base dynamic retrieval method and system. Background Art

[0002] At present, in terms of knowledge retrieval, RAG usually adopts a fixed parameter configuration mode to implement knowledge retrieval, such as setting a fixed similarity threshold T, keyword similarity weight W and a preset recall number K. Although such a scheme can achieve an accuracy of 85% on the standard test set, it has significant defects in actual dynamic business scenarios: First, static parameters cannot meet all retrieval scenarios. For example, when high-precision document retrieval and rapid response are required, different schemes need to be formulated for different scenarios, resulting in serious manual dependence; second, static parameters are difficult to adapt to the dynamic update characteristics of the knowledge base, and the parameter adjustment cycle is much greater than the knowledge update speed; third, static parameters cannot guarantee the accuracy of questions and answers, especially in terms of semantic and keyword similarity, which is difficult to balance. Too high a semantic similarity weight will lead to mismatching of professional terms, and too high a keyword similarity weight cannot handle synonym expansion.

[0003] This means that when dealing with multimodal data and dynamic knowledge bases, traditional RAG retrieval methods face challenges such as low precision, insufficient timeliness, and poor result diversity. RAG information retrieval relies heavily on static parameter configurations, making it difficult to adapt to real-time changes in knowledge base content. Furthermore, their ability to understand user intent is limited, resulting in retrieval results that fail to meet diverse needs. Summary of the Invention

[0004] The purpose of the present invention is to solve the problem in the prior art that RAG information retrieval cannot meet the retrieval requirements of multi-scenario queries in dynamic knowledge bases, and to propose a RAG-based knowledge base dynamic retrieval method and system.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a RAG-based knowledge base dynamic retrieval method, comprising: Obtain all the information in the knowledge base, vectorize and classify different types of documents in the knowledge base, and obtain retrieval feature labels for all the information in the knowledge base; Collect user search input information, perform semantic recognition analysis on the user search input information, determine the user's search intent, and configure matching parameters; According to the user's search intent and matching parameters, the search feature tags of all information in the knowledge base are matched to obtain the search output results; According to the search output results and combined with the search feature labels of all information in the knowledge base, the search quality evaluation index is established; Use retrieval quality evaluation indicators to evaluate the retrieval output results and obtain the content quality of the retrieval output results; According to the content quality of the retrieval output results, the matching parameters are adjusted, and a secondary match is performed with the retrieval feature tags of all information in the knowledge base to output the final retrieval results.

[0006] In one feasible solution, the complete information of the knowledge base includes: One or more combinations of existing and / or real-time updated text documents, image files, and audio files.

[0007] In a feasible solution, the method for matching the retrieval feature tags of all information in the knowledge base includes: Generate semantic vectors based on user search input information and output user search intent; Based on the user's search intent and semantic vector, obtain the multimodal weight distribution and configure the initial matching parameters; According to the initial matching parameters, the retrieval feature tags of all information in the knowledge base are matched to determine the retrieval output results.

[0008] In a feasible solution, the method for establishing the retrieval quality evaluation index includes: Calculate the average similarity: Formula 1; Calculation timeliness: Formula 2; Calculating diversity: Formula 3; In Equation 1, Equation 2, and Equation 3, is the number of search results, For user queries, For the Search results, For the Search results, is the current time, For the results Release time, is the decay rate, For the results The eigenvector of For the results Vector representation of ; is the average similarity between the two retrieval results.

[0009] In a feasible solution, the method for obtaining the content quality of the search output result includes: Collect real-time user feedback results, use retrieval quality assessment indicators to perform weighted additional assessment on the retrieval output results, and obtain the content quality score of the retrieval output results; According to the content quality score of the search output results, a quality score adjustment threshold is pre-set; Using the quality score adjustment threshold to compare with the content quality score of the search output result to obtain matching adjustment information; According to the matching adjustment information, the search output results are iteratively optimized to determine the secondary matching parameters of the user's search input information.

[0010] In a feasible solution, the method for obtaining the content quality of the search output result further includes: Based on the real-time user feedback results, a feedback vector is generated, and the retrieval quality evaluation index is used to obtain the content quality score of the retrieval output result: Formula 4; Formula 5; In Equation 4 and Equation 5, is the weight of the comprehensive quality score. is the weight fraction of the feedback vector, and ; 、 、 are the average similarity weight, timeliness weight, and diversity weight in the comprehensive quality score, and ; If the content quality score of the search output result is less than the preset threshold, parameter adjustment is triggered.

[0011] In a feasible solution, the method for iteratively optimizing the search output results includes: Formula 6; In Equation 6, is the parameter set of the current iteration, is the parameter set after iterative update, is the learning rate, is the loss function Relative to the initial matching parameters The updated gradient of Score the content quality of the search output results, Based on parameters The function output of .

[0012] In a feasible solution, the method further includes: Real-time monitoring of loss function the changing trend of If the loss function If it decreases continuously, increase the learning rate To accelerate convergence; If the loss function If there is oscillation or rise, reduce the learning rate To improve stability.

[0013] In a second aspect, the present invention further provides a RAG-based knowledge base dynamic retrieval system, which adopts the RAG-based knowledge base dynamic retrieval method described in any one of the first aspects, and the retrieval system further includes: The knowledge base management module is used to obtain all the information in the knowledge base, vectorize and classify different types of documents, and generate retrieval feature tags; The user input processing module is used to collect user search input information, perform semantic recognition analysis, determine the user's search intent, and configure matching parameters; The retrieval matching module is used to match the retrieval feature tags of all information in the knowledge base according to the user's retrieval intention and matching parameters, and generate retrieval output results; The quality assessment module is used to establish a retrieval quality assessment index based on the retrieval output results and retrieval feature labels, and evaluate the content quality of the retrieval output results; The parameter optimization module is used to adjust the matching parameters based on the content quality score using the gradient descent optimization algorithm, perform secondary matching, and output the final retrieval results; The dynamic update module is used to monitor knowledge base updates in real time, perform vectorization processing on new or modified content, and update retrieval feature tags.

[0014] The beneficial effects of the present invention are: This invention provides preliminary feedback by vectorizing knowledge base information and semantically identifying user intent. It also evaluates the retrieval quality of the search output and dynamically adjusts matching parameters. It then iteratively optimizes and rematches the search output based on user feedback, improving search accuracy. This effectively addresses the existing problem of RAG information retrieval failing to meet the retrieval requirements of multi-scenario queries in dynamic knowledge bases. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A schematic diagram of the overall process of a RAG-based knowledge base dynamic retrieval method provided in an embodiment of the present invention; Figure 2 This is a partial flow chart of a RAG-based knowledge base dynamic retrieval method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0017] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0018] In the present invention, unless otherwise specified or limited, the terms "connection" and "fixation" should be understood in a broad sense. For example, "fixation" can mean fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two elements or interaction between two elements, unless otherwise specified. Those skilled in the art will be able to understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0019] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the meaning of "and / or" appearing throughout the text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme in which A and B are satisfied at the same time. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0020] Reference Figures 1 to 2In order to solve the above-mentioned shortcoming in the prior art that RAG information retrieval cannot meet the retrieval requirements of multi-scenario queries in dynamic knowledge bases, the present invention provides a RAG-based knowledge base dynamic retrieval method in this embodiment. The retrieval method makes preliminary feedback by vectorizing the knowledge base information and semantically identifying the user's intention, and at the same time evaluates the retrieval quality of the retrieval output results and dynamically adjusts the matching parameters. Then, the retrieval output results can be iteratively optimized and re-matched according to the user feedback to improve the retrieval accuracy. That is, it effectively solves the problem in the prior art that RAG information retrieval cannot meet the retrieval requirements of multi-scenario queries in dynamic knowledge bases.

[0021] Specifically, in its first aspect, the present invention provides a RAG-based dynamic knowledge base retrieval method, comprising: obtaining all information in the knowledge base, vectorizing and classifying different types of documents within the knowledge base, and obtaining retrieval feature labels for all information in the knowledge base. It should be noted that the knowledge base includes text documents (e.g., technical reports), images (e.g., flowcharts), and audio (e.g., meeting recordings). A unified retrieval feature label can be generated by vectorizing text using a model such as BERT, and / or processing image features using ResNet, and / or processing audio features using Wav2Vec. More specifically, BERT is used to generate 512-dimensional vectors for text documents, ResNet is used to generate 2048-dimensional feature vectors for flowcharts, and Wav2Vec is used to generate 768-dimensional vectors for audio. A clustering algorithm (e.g., K-means) is then used to classify the vectors by content, assign labels, and store them in the knowledge base. Furthermore, when new content is added to the knowledge base, the content is first identified, and then vectorized and labels are updated in real time based on the content category. The system collects user search input information, performs semantic recognition and analysis on it, determines the user's search intent, and configures matching parameters. Based on the user's search content, the BERT model is used to semantically vectorize the search text to identify the search intent. Based on the search intent, weights are assigned to the multimodal data (e.g., text weight: 0.6, image weight: 0.3, audio weight: 0.1). Using the semantic vectors and the assigned weights to the multimodal data, a cosine similarity match is then performed. This means that the search intent and matching parameters are matched against the search feature labels of all information in the knowledge base to obtain the search output. By combining the retrieval feature tags of all the information in the knowledge base, a retrieval quality assessment index can be established for the retrieval output results (e.g., a quality assessment of the retrieval output results based on cosine average similarity, timeliness, and diversity). The retrieval output results can be evaluated using the retrieval quality assessment index to obtain the content quality of the retrieval output results. Then, based on the real-time user feedback (e.g., the number of clicks, ratings, and dwell time of the retrieval output results), as well as the content quality of the retrieval output results, the matching parameters of the initial feedback retrieval output results can be adjusted, and a secondary match can be performed with the retrieval feature tags of all the information in the knowledge base to output the final retrieval results. That is, in this embodiment, preliminary feedback is provided by vectorizing the knowledge base information and semantically identifying user intent, while simultaneously evaluating the retrieval quality of the retrieval output results and dynamically adjusting the matching parameters. The retrieval output results can then be iteratively optimized and secondary matched based on user feedback to improve retrieval accuracy. It should be noted that all the information in the knowledge base includes one or more combinations of existing and / or real-time updated text documents, image files, and audio files.

[0022] In this embodiment, in order to facilitate understanding of how to use user retrieval input information to match all the information in the knowledge base, the following explanation is given here. Specifically, the method for matching the retrieval feature labels of all the information in the knowledge base includes: generating a semantic vector based on the user retrieval input information, and outputting the user's retrieval intention; the BERT model can be used to convert the user's retrieval input information into a semantic vector to identify the user's retrieval intention, and then obtain the multimodal weight distribution based on the user's retrieval intention and the semantic vector, and configure the initial matching parameters; then, based on the initial matching parameters, match the retrieval feature labels of all the information in the knowledge base to determine the retrieval output result. Here, to make it easier to understand how the above matching is performed, the following example is given. Suppose a user searches for "relevant information on smart bridge construction projects". The BERT model is used to convert the query into a 768-dimensional semantic vector, and its retrieval intent is identified as "technical applications related to smart bridge construction". According to its retrieval intent, the multimodal data in the knowledge base is weighted (such as text weight: 0.6, image weight: 0.3, audio weight: 0.1) to generate initial matching parameters. Then, the semantic vector is matched with the knowledge base feature labels (including "smart bridge construction" and "bridge") by cosine similarity. The knowledge base performs weight distribution and cosine similarity matching based on the above multimodal data, and returns the generated retrieval output results.

[0023] In this embodiment, in order to facilitate understanding of how to evaluate the content quality of the above-mentioned search output results to determine whether they meet the user's search requirements, the following description is provided. Specifically, the method for establishing the search quality evaluation index includes: Calculate the average similarity: Formula 1; Calculation timeliness: Formula 2; Calculating diversity: Formula 3; In Equation 1, Equation 2, and Equation 3, is the number of search results, For user queries, For the Search results, For the Search results, is the current time, For the results Release time, is the decay rate, For the results The eigenvector of For the results Vector representation of ; This is the average similarity between each pair of search results. Using the aforementioned search quality assessment metrics, we use average similarity to measure the relevance of search output results. Timeliness is used to prioritize the freshness of search output results, while diversity is employed to avoid duplication and ensure comprehensiveness and practicality. This multi-dimensional assessment ensures that search results are not only relevant but also meet user needs for up-to-date information and diverse content.

[0024] In this embodiment, to facilitate understanding of how matching parameters are adjusted based on real-time user feedback on search output results, the following example illustrates the method for obtaining the content quality of search output results. The method includes collecting real-time user feedback (e.g., click-through rate, rating, and dwell time of the search output results) and weighting the search output results using search quality assessment indicators to obtain a content quality score for the search output results. A quality score adjustment threshold can then be pre-set based on the content quality score of the search output results. The quality score adjustment threshold can then be compared with the content quality score of the search output results to determine whether iterative optimization of the search output results is necessary, thereby obtaining matching adjustment information. The search output results can then be iteratively optimized based on the matching adjustment information to determine secondary matching parameters for the user's search input information. Specifically, in this embodiment, a user feedback vector can be determined by collecting real-time user feedback on the search output results (e.g., click-through time, click volume, and user-generated ratings). The content quality of the search output results can then be evaluated using Equations 1 through 3 above. The two can be combined to form the basis for dynamic adjustment, thereby enhancing adaptability to user intent and addressing the shortcomings of traditional RAG in responding to user behavior.

[0025] Specifically, to facilitate understanding of how to utilize real-time user feedback results and search quality assessment indicators to assess the content quality of search output results, and how to combine the two as a basis for dynamic adjustment, the method for obtaining the content quality of search output results further includes: Based on real-time user feedback (e.g., users click on 3 documents, score 4 / 5, and stay for 50 seconds, 35 seconds, and 10 seconds on the output feedback results), a feedback vector is generated (the specific generation method here can use an interval scoring system, e.g., when the number of clicks is between 1 and 2, the click volume is assigned 1 point, when it is between 3 and 6, the click volume is assigned 2 points, .... The stay time (average 31.67 seconds): in the range of 30-60 seconds, the score is assigned 3 points, and the score (average 3.33 / 5 points): in the range of 3-4, the score is assigned 3 points, and the score and stay time are also calculated using the interval scoring system). Then, using the search quality assessment index, the content quality score of the search output result is obtained as follows: Formula 4; Formula 5; In Equation 4 and Equation 5, is the weight of the comprehensive quality score. is the weight fraction of the feedback vector, and ; 、 、 are the average similarity weight, timeliness weight, and diversity weight in the comprehensive quality score, and ; If the content quality score of the search output result is less than the preset threshold, parameter adjustment is triggered.

[0026] In this embodiment, to facilitate understanding of how to adjust the matching parameters of the search output results in real time based on the above-mentioned real-time user feedback results and search quality evaluation indicators, the method for iteratively optimizing the search output results includes: Formula 6; In Equation 6, is the parameter set of the current iteration, is the parameter set after iterative update, is the learning rate, is the loss function Relative to the initial matching parameters The updated gradient of Score the content quality of the search output results, Based on parameters The function output of .

[0027] In order to understand how to adjust the initial matching parameters, the following example is given. Specifically, assuming that the user clicks on 3 documents with a score of 4 / 5 and stays for 50 seconds, 35 seconds, and 10 seconds, and assuming that the cosine similarities between the semantic vectors of the above 3 documents and the user query in the retrieval results are 0.85, 0.75, and 0.65 respectively, the average similarity is Assuming that the document release times are July 2025, June 2025, and December 2024, and the current time is August 2025, the decay rate is , then the timeliness is calculated by formula 2: ; Assume that the pairwise cosine similarities of the retrieval result feature vectors are 0.4, 0.3, and 0.5, and the average diversity is At this time, the comprehensive quality score of formula 4 and formula 5 is:

[0028] Assuming that the initial matching parameters Including: similarity threshold T=0.8, multimodal weight (text: 0.6, image: 0.3, audio: 0.1), then the parameters are updated according to formula 6: Initial matching parameters: .

[0029] Loss function: ,

[0030] Assuming the value here is 0.657, which is less than the preset threshold value of 0.7, the loss function at this time is:

[0031] Set the learning rate is 0.01, then we can calculate the gradient of the loss function with respect to the parameters (assuming it is calculated using the gradient descent optimization algorithm):

[0032] Then the parameters can be updated according to formula 6 ; , , , ; Then update the parameters Normalize the multimodal weights (make sure they sum to 1): .

[0033] Using the updated parameter set Rematch with the knowledge base feature tags until user needs are met.

[0034] In a feasible solution, the method further includes: Real-time monitoring of loss function the changing trend of If the loss function If it decreases continuously, increase the learning rate To accelerate convergence; If the loss function If there is oscillation or rise, reduce the learning rate To improve stability. In addition, if new content is added to the knowledge base (such as a newly uploaded "Smart Bridge Construction Technology Report"), it will be vectorized and the search feature tags will be updated to ensure that the latest information is included in the next search.

[0035] In the second aspect, the present invention also provides a RAG-based knowledge base dynamic retrieval system, which adopts a RAG-based knowledge base dynamic retrieval method described in any one of the first aspects. The retrieval system also includes: a knowledge base management module, a user input processing module, a retrieval matching module, a quality assessment module, a parameter optimization module and a dynamic update module. The knowledge base management module is used to obtain all the information of the knowledge base, vectorize and classify different types of documents, and generate retrieval feature tags; the user input processing module is used to collect user retrieval input information, perform semantic recognition analysis, judge the user's retrieval intention, and configure matching parameters; the retrieval matching module is used to match the retrieval feature tags of all information in the knowledge base according to the user's retrieval intention and matching parameters, and generate a retrieval output result; the quality assessment module is used to establish a retrieval quality assessment index based on the retrieval output result and the retrieval feature tag, and evaluate the content quality of the retrieval output result; the parameter optimization module is used to adjust the matching parameters according to the content quality score using a gradient descent optimization algorithm, perform secondary matching, and output the final retrieval result; the dynamic update module is used to monitor the knowledge base update in real time, vectorize the newly added or modified content, and update the retrieval feature tag. That is, in this embodiment, the retrieval system implements a RAG-based dynamic retrieval method for knowledge bases described in the first aspect above through the above-mentioned knowledge base management module, user input processing module, retrieval matching module, quality assessment module, parameter optimization module and dynamic update module. By implementing the above-mentioned RAG-based dynamic retrieval method for knowledge bases, the retrieval system can evaluate the retrieval quality and dynamically adjust the matching parameters of the retrieval output results through vectorized knowledge base information and semantic recognition of user intentions, and then iteratively optimize and re-match the retrieval output results according to user feedback to improve the retrieval accuracy. That is, it effectively solves the problem in the prior art that RAG information retrieval cannot meet the retrieval requirements of multi-scenario queries in dynamic knowledge bases.

[0036] In some embodiments, the retrieval system can communicate using any currently known or later developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0037] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0038] A third aspect of the present invention provides a computer-readable medium having a computer program stored thereon, wherein when executed by a processor, the program implements a RAG-based knowledge base dynamic retrieval method as described in any one of the first aspects. The computer-readable medium in this embodiment can be written in one or more programming languages, or a combination thereof, to contain computer program code for performing the operations of some embodiments of the present disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0039] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0040] In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including program code for executing the methods shown in the flowcharts.

[0041] The fourth aspect of the present invention provides an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors implement a RAG-based knowledge base dynamic retrieval method as described in the first aspect. The above-mentioned computer-readable medium may be contained in the above-mentioned electronic device; or it may exist independently, that is, not assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can implement a RAG-based knowledge base dynamic retrieval method as described in the first aspect.

[0042] A fifth aspect of the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements a RAG-based knowledge base dynamic retrieval method as described in the first aspect.

[0043] The above descriptions are merely some preferred embodiments of the present disclosure and illustrate the underlying technical principles. Those skilled in the art should understand that the scope of the invention encompassed by the embodiments of the present disclosure is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the aforementioned inventive concept. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A knowledge base dynamic retrieval method based on RAG, characterized in that: include: Obtain all the information in the knowledge base, vectorize and classify different types of documents in the knowledge base, and obtain retrieval feature labels for all the information in the knowledge base; Collect user search input information, perform semantic recognition analysis on the user search input information, determine the user's search intent, and configure matching parameters; According to the user's search intent and matching parameters, the search feature tags of all information in the knowledge base are matched to obtain the search output results; According to the search output results and combined with the search feature labels of all information in the knowledge base, the search quality evaluation index is established; Use retrieval quality evaluation indicators to evaluate the retrieval output results and obtain the content quality of the retrieval output results; According to the content quality of the retrieval output results, the matching parameters are adjusted, and a secondary match is performed with the retrieval feature tags of all information in the knowledge base to output the final retrieval results.

2. The RAG-based knowledge base dynamic retrieval method according to claim 1, characterized in that: The complete information in the knowledge base includes: One or more combinations of existing and / or real-time updated text documents, image files, and audio files.

3. The RAG-based knowledge base dynamic retrieval method according to claim 2, characterized in that: The method for matching the retrieval feature tags of all information in the knowledge base includes: Generate semantic vectors based on user search input information and output user search intent; Based on the user's search intent and semantic vector, obtain the multimodal weight distribution and configure the initial matching parameters; According to the initial matching parameters, the retrieval feature tags of all information in the knowledge base are matched to determine the retrieval output results.

4. The RAG-based knowledge base dynamic retrieval method according to claim 3, characterized in that: The method for establishing the retrieval quality evaluation index comprises: Calculate the average similarity: Formula 1; Calculation timeliness: Formula 2; Calculating diversity: Formula 3; In Equation 1, Equation 2, and Equation 3, is the number of search results, For user queries, For the Search results, For the Search results, is the current time, For the results Release time, is the decay rate, For the results The eigenvector of For the results Vector representation of ; is the average similarity between the two search results.

5. The RAG-based knowledge base dynamic retrieval method according to claim 4, characterized in that: The method for obtaining the content quality of the search output result includes: Collect real-time user feedback results, use retrieval quality assessment indicators to perform weighted additional assessment on the retrieval output results, and obtain the content quality score of the retrieval output results; According to the content quality score of the search output results, a quality score adjustment threshold is pre-set; Using the quality score adjustment threshold to compare with the content quality score of the search output result to obtain matching adjustment information; According to the matching adjustment information, the search output results are iteratively optimized to determine the secondary matching parameters of the user's search input information.

6. The RAG-based knowledge base dynamic retrieval method according to claim 5, characterized in that: The method for obtaining the content quality of the search output result further includes: Based on the real-time user feedback results, a feedback vector is generated, and the retrieval quality evaluation index is used to obtain the content quality score of the retrieval output result: Formula 4; Formula 5; In Equation 4 and Equation 5, is the weight of the comprehensive quality score. is the weight fraction of the feedback vector, and ; 、 、 are the average similarity weight, timeliness weight, and diversity weight in the comprehensive quality score, and ; If the content quality score of the search output result is less than the preset threshold, parameter adjustment is triggered.

7. The RAG-based knowledge base dynamic retrieval method according to claim 6, characterized in that: The method for iteratively optimizing the search output results includes: Formula 6; In Equation 6, is the parameter set of the current iteration, is the parameter set after iterative update, is the learning rate, is the loss function Relative to the initial matching parameters The updated gradient of Score the content quality of the search output results, Based on parameters The function output of .

8. The RAG-based knowledge base dynamic retrieval method according to claim 7, characterized in that: The method further comprises: Real-time monitoring of loss function the changing trend of If the loss function If it decreases continuously, increase the learning rate to accelerate convergence; If the loss function If oscillation or rise occurs, reduce the learning rate to improve stability.

9. A knowledge base dynamic retrieval system based on RAG, characterized in that: The RAG-based knowledge base dynamic retrieval method according to claims 1 to 8 is adopted, and the retrieval system further includes: The knowledge base management module is used to obtain all the information in the knowledge base, vectorize and classify different types of documents, and generate retrieval feature tags; The user input processing module is used to collect user search input information, perform semantic recognition analysis, determine the user's search intent, and configure matching parameters; The retrieval matching module is used to match the retrieval feature tags of all information in the knowledge base according to the user's retrieval intention and matching parameters, and generate retrieval output results; The quality assessment module is used to establish a retrieval quality assessment index based on the retrieval output results and retrieval feature labels, and evaluate the content quality of the retrieval output results; The parameter optimization module is used to adjust the matching parameters based on the content quality score using the gradient descent optimization algorithm, perform secondary matching, and output the final retrieval results; The dynamic update module is used to monitor knowledge base updates in real time, perform vectorization processing on new or modified content, and update retrieval feature tags.

Citation Information

Patent Citations

  • Retrieval result determination method and device, storage medium and electronic device

    CN117493588A

  • Data retrieval method, device and system, electronic equipment and readable storage medium

    CN118093962A

  • Artificial intelligence voice call method based on large language model

    CN118486307A

  • LLM-based operation and maintenance knowledge intelligent question and answer method and system

    CN119669406A

  • Dynamic vector knowledge base construction and retrieval method based on multi-modal large model

    CN120277223A