Adaptive retrieval augmentation generation system based on multi-dimensional problem characteristics and implementation method

By constructing an adaptive retrieval enhancement generation system based on multi-dimensional question features, the problem of adapting traditional retrieval enhancement generation technology to diverse query needs has been solved, achieving rapid integration and efficient answer generation, and improving the system's flexibility and accuracy.

CN121684065BActive Publication Date: 2026-05-01NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NAT UNIV OF DEFENSE TECH
Filing Date
2026-02-09
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Traditional search enhancement generation techniques are difficult to adapt to diverse user query needs. Existing systems cannot dynamically adjust search strategies, resulting in insufficient search accuracy or incomplete recall. Development costs are high and the cycle is long, and it is impossible to quickly integrate new search engines or matching rules.

Method used

An adaptive retrieval enhancement generation system based on multidimensional problem features is adopted. Through RAG initialization module, text processing module, model initialization module, vector processing module, retrieval module and RAG retrieval generation module, an extensible retrieval strategy pool and adaptive decision module are constructed to realize plug-in integration and configuration adjustment, and decouple the module architecture to reduce the risk of code refactoring.

Benefits of technology

It enables rapid adaptation to multiple domain scenarios, improves the quality of answer generation and retrieval efficiency, reduces development costs and cycle time, and enhances the system's robustness and ability to handle uncertain queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121684065B_ABST
    Figure CN121684065B_ABST
Patent Text Reader

Abstract

The application relates to a kind of adaptive retrieval enhancement generation systems and implementation methods based on multidimensional problem characteristics.The system includes: RAG initialization module, text processing module, model initialization module, vector processing module, retriever module and RAG retrieval generation module.The input end of retriever module receives the text vector of vector processing module, and the output end is connected to RAG retrieval generation module, and the strategy pool of five types of retrieval strategies and adaptive decision module are built-in, for determining the retrieval strategy and constructing RAG prompt words by keyword matching and problem length determination.RAG retrieval generation module is used to reconstruct the user question, and the retriever module is called to input the obtained text segment into the large language model to generate an answer.The method can improve the retrieval efficiency and answer generation quality of the RAG system.
Need to check novelty before this filing date? Find Prior Art

Description

An Adaptive Retrieval Enhancement Generation System and Implementation Method Based on Multidimensional Question Features Technical Field

[0001] This invention relates to the fields of artificial intelligence and information retrieval technology, and in particular to an adaptive retrieval enhancement generation system and implementation method based on multidimensional question features. Background Technology

[0002] Traditional retrieval augmentation (RAG) techniques play a crucial role in improving the accuracy of large-scale model knowledge and overcoming illusions. However, their retrieval strategies are typically fixed and singular, making it difficult to adapt to diverse user query needs. Existing RAG systems often employ a single retrieval tool based on vector similarity or a simple combination of manually preset rules, resulting in rigid strategies, reliance on expert experience for optimization, and an inability to dynamically respond to different query intentions and complexities. While large-scale models excel in semantic understanding and content generation, they are not deeply integrated with flexible, multi-strategy retrieval scheduling mechanisms, making the retrieval process a static bottleneck in the intelligent workflow.

[0003] Currently, traditional search enhancement generation methods require manual pre-setting or selection of a single search strategy (such as a fixed similarity threshold), which is inefficient and easily limited by subjective experience, making it difficult to guarantee optimal adaptability to different queries. Existing systems cannot dynamically adjust search strategies based on the specific semantic intent, complexity, and other characteristics of the query, leading to insufficient search accuracy or incomplete recall when facing diverse problems. Most RAG systems use tightly coupled single search modules; adding new search algorithms or modifying search logic requires refactoring the core code, resulting in high development costs and long development cycles. They cannot quickly integrate new search engines or matching rules through configuration or plug-in methods, making it difficult to meet the complex search needs of multiple domains and scenarios. Summary of the Invention

[0004] Therefore, it is necessary to provide an adaptive retrieval enhancement generation system and implementation method based on multidimensional problem features that can support general intelligent agents and has generalization support capabilities for various fields, in order to address the above-mentioned technical problems.

[0005] An adaptive retrieval enhancement generation system based on multidimensional problem features, the system comprising: a RAG initialization module, a text processing module, a model initialization module, a vector processing module, a retrieval module, and a RAG retrieval generation module.

[0006] The output of the RAG initialization module is connected to the text processing module and the model initialization module respectively, and is used to load the review system configuration and initialize the large model client.

[0007] The output of the text processing module is connected to the vector processing module, which is used to detect the text format and segment long text according to parameters, generating a list of overlapping text segments.

[0008] The output of the model initialization module is connected to the vector processing module and the RAG retrieval and generation module, respectively, to configure model parameters to support vectorization and dialogue functions.

[0009] The output of the vector processing module is connected to the retrieval module to detect the compatibility of the local vector library and process the text vectors based on the detection results.

[0010] The input end of the retrieval module receives the text vector from the vector processing module, and the output end is connected to the RAG retrieval generation module. It has a built-in strategy pool of five types of retrieval strategies and an adaptive decision module, which are used to determine the retrieval strategy and construct RAG prompt words by keyword matching and question length judgment.

[0011] The RAG retrieval and generation module is used to reconstruct the user's question and then call the retrieval module to input the obtained text segment into the large language model to generate an answer.

[0012] An implementation method for an adaptive retrieval enhancement generation system based on multidimensional question features, the method comprising:

[0013] The RAG initialization module loads the review system configuration and initializes the large model client, triggering the startup of the text processing module and the model initialization module. The model initialization module includes the embedded model and the large language model.

[0014] The text processing module detects the text format and segments it to generate a list of overlapping text segments, which is then transmitted to the vector processing module.

[0015] The vector processing module detects the compatibility of the local vector library, and the vectorized text segments are processed in batches based on the embedding model. The text vectors are then transmitted to the retrieval module, which selects a retrieval strategy based on keyword matching and question length. After constructing RAG prompt words based on the text vectors, the relevant text segments are transmitted to the RAG retrieval generation module.

[0016] The user's question is reconstructed by the RAG retrieval generation module, the text segment of the retrieval module is called and input into the large language model, the RAG retrieval chain is generated, and the RAG answer is output.

[0017] The aforementioned adaptive retrieval enhancement generation system and implementation method based on multi-dimensional question features firstly, encapsulates various retrieval algorithms into independent strategy components in the retrieval module, constructing an extensible retrieval strategy pool. When adding a new retrieval algorithm, only the new component needs to be registered in the strategy pool, without refactoring the core system code, thus achieving plug-in integration of the retrieval module. Simultaneously, the matching rules for retrieval strategies such as keyword matching and question length judgment are defined in a configurable manner (e.g., "defining high-precision retrieval corresponding to a certain type of question"). Modifying rules can be completed by simply adjusting the configuration file, significantly reducing development costs and shortening the cycle. Secondly, a decoupled modular architecture is adopted, treating the retrieval module as an independent functional unit that communicates with other modules. Modifying or optimizing the retrieval logic only involves the retrieval module and will not affect processes such as RAG initialization and text processing, further reducing the scope and risk of code refactoring. The system can quickly adapt to multiple domain scenarios. When faced with diverse queries such as "definition and explanation" and "summary and overview", the adaptive decision-making module can dynamically select matching strategies through configurable rules (such as selecting high-precision retrieval for short questions and multi-result retrieval for long questions), avoiding the limitations of a single strategy. At the same time, through a three-layer design of "strategy pool encapsulation + configurable routing + module decoupling", the pluggable capability can quickly integrate domain-adaptive retrieval algorithms, which not only ensures the retrieval accuracy in different scenarios, but also improves the system's robustness in dealing with uncertain queries. Finally, by using text segment input that fits the requirements, the system effectively improves the quality of answer generation and retrieval efficiency. Attached Figure Description

[0018] Figure 1 is a block diagram of an adaptive retrieval enhancement generation system based on multidimensional question features in one embodiment;

[0019] Figure 2 is a technical framework diagram of an adaptive retrieval enhancement generation system based on question features in one embodiment;

[0020] Figure 3 is a flowchart illustrating the implementation method of an adaptive retrieval enhancement generation system based on multidimensional question features in one embodiment;

[0021] Figure 4 is a functional flowchart of an adaptive retrieval enhancement generation system based on question features in one embodiment. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0023] In one embodiment, as shown in Figure 1, an adaptive retrieval enhancement generation system based on multidimensional question features is provided, including: a RAG initialization module 102, a text processing module 104, a model initialization module 106, a vector processing module 108, a retrieval module 110, and a RAG retrieval generation module 112.

[0024] The output of the RAG initialization module 102 is connected to the text processing module and the model initialization module respectively, and is used to load the review system configuration and initialize the large model client.

[0025] The output of the text processing module 104 is connected to the vector processing module, which is used to detect the text format and segment long text according to parameters to generate a list of overlapping text segments.

[0026] The output of the model initialization module 106 is connected to the vector processing module and the RAG retrieval and generation module respectively, and is used to configure model parameters to support vectorization and dialogue functions.

[0027] The output of the vector processing module 108 is connected to the retrieval module to detect the compatibility of the local vector library and process the text vectors based on the detection results.

[0028] The input end of the retrieval module 110 receives the text vector from the vector processing module, and the output end is connected to the RAG retrieval generation module. It has a built-in strategy pool of five types of retrieval strategies and an adaptive decision module, which are used to determine the retrieval strategy and construct RAG prompt words through keyword matching and question length judgment.

[0029] The RAG retrieval and generation module 112 is used to reconstruct the user's question and then call the retrieval module to input the obtained text segment into the large language model to generate an answer.

[0030] In one embodiment, the model initialization module includes an embedding model and a large language model. Five retrieval strategies are included: similarity threshold retrieval, maximum marginal relevance retrieval, standard similarity retrieval, maximum result similarity retrieval, and high-precision similarity retrieval.

[0031] In one embodiment, the similarity threshold retrieval is based on calculating the similarity score between the query vector and all document vectors using vector similarity, arranging the similarity scores in descending order, and taking the result corresponding to the highest similarity score according to the threshold.

[0032] In one embodiment, the maximum marginal relevance retrieval filters results by ensuring maximum relevance. It first finds the most relevant result, and when selecting the next result, it balances the relevance of the query result with the similarity of the selected result, repeating until a preset number of results are selected.

[0033] In one embodiment, the similarity threshold retrieval calculates the similarity between all text vectors and the query results by setting a similarity score threshold, filters out results with similarity scores lower than the similarity score threshold, and outputs all results.

[0034] In one embodiment, the three retrieval strategies—maximum result similarity retrieval, high-precision similarity retrieval, and similarity threshold retrieval—use different TOP-K threshold parameters and are applied to different retrieval environments. The TOP-K threshold parameter for maximum result similarity retrieval is greater than that for similarity threshold retrieval, and the TOP-K threshold parameter for similarity threshold retrieval is greater than that for high-precision similarity retrieval.

[0035] In one embodiment, the retrieval module is further configured to compare the text vectors and query results by keyword matching and question length comparison respectively, to obtain the type of retrieval strategy in the configuration file, and to distinguish between the maximum result similarity retrieval and the high-precision similarity retrieval strategy based on the question length and the magnitude of the TOP-K threshold parameter, thereby determining the retrieval strategy corresponding to each text vector. Based on the determined retrieval strategy, the retrieval module is invoked to input the obtained text segment into the large language model for question reconstruction, outputting a RAG retrieval generation chain, and incorporating system search suggestions into the RAG retrieval generation chain to generate a RAG answer.

[0036] The modules in the aforementioned adaptive retrieval enhancement generation system based on multidimensional question features can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0037] Those skilled in the art will understand that the structures shown in Figures 1 and 2 are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer device to which the present invention is applied. Specific computer devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.

[0038] The implementation method of the adaptive retrieval-augmented generation system based on multi-dimensional question features provided by this invention can be applied to the system shown in Figure 1 or Figure 2. The adaptive retrieval-augmented generation system based on question features shown in Figure 2 includes six modules: RAG initialization, text processing, model initialization, vector processing, retrieval unit, and RAG retrieval generation. RAG (Retrieval-Augmented Generation) is an artificial intelligence technique that combines information retrieval with generative large language models (LLM). It retrieves relevant information from external knowledge bases and inputs this information as context into the generative model, thereby generating more accurate, context-relevant, and fact-based content. The RAG initialization module provides system configuration parameter reading and format verification functions, and initializes the model client. The text processing module mainly provides text reading and text segmentation functions, processing large texts into text segments and generating a list of text segments. The model initialization module mainly configures the parameters of the large model in the RAG process, allowing the client to connect to the large model for dialogue. The vector processing module mainly provides text vectorization operations, converting text into local vectors for subsequent semantic comparison and vector retrieval. It optimizes the local vector library construction process by checking if the local vector library exists. The retrieval module mainly reads the retrieval configuration, builds the retrieval module, and constructs the retrieval module using RAG prompts. The retrieval module uses adaptive retrieval method selection based on question type, selecting text segments by calling appropriate retrieval modules, and then providing them to the LLM large model for answering. The RAG retrieval generation module is mainly used to create RAG generation chains. It reconstructs the question through retrieval understanding, then obtains the most relevant text segments through the retrieval module, and finally feeds them into the large model for answer generation.

[0039] It's worth noting that this system adopts a two-layer architecture of policy pool + intelligent routing. The bottom-layer policy pool encapsulates various heterogeneous search engines (such as similarity search, MMR deduplication search, high-precision threshold search, maximum result similarity search, etc.), forming an extensible search strategy toolbox. The upper-layer intelligent router innovatively designs an adaptive decision-making module as the routing core. This module receives the original user question, analyzes its characteristics, and dynamically determines which one or more underlying search strategies to invoke, rather than using a fixed single strategy.

[0040] Furthermore, by using a predefined set of keyword rules, specific patterns in the questions (such as "summary," "comparison," and "latest") are identified and directly mapped to targeted retrieval strategies, achieving semantic intent matching of multi-dimensional question features. Then, concise heuristic rules (such as question length) are employed to quickly classify question complexity. For example, short questions tend to use high_precision retrieval to avoid noise; long and complex questions use max_results retrieval to ensure information coverage, completing the heuristic judgment of complexity / length. In addition, the decision rules are externally configurable, allowing users to easily extend or adjust the matching modes and default strategies based on specific domain knowledge, giving the system strong domain adaptability and realizing a configurable decision pipeline. This results in a complete adaptive decision-making mechanism for multi-dimensional question features. Finally, the creation of the retrieval tool and the strategy selection logic are clearly separated, conforming to the principles of high cohesion and low coupling in software engineering. Adding a new retrieval strategy only requires registering it in the configuration file and updating the decision rules; no modification to the core routing logic is needed, resulting in extremely high system scalability. It provides a lightweight, intelligent retrieval enhancement scheme that requires no additional model training and is easy to integrate into existing RAG systems.

[0041] In one embodiment, as shown in Figure 3, an implementation method for an adaptive retrieval enhancement generation system based on multidimensional question features is provided. Taking the application of this method to the system in Figure 1 or Figure 2 as an example, the method includes the following steps:

[0042] Step 302: After loading the review system configuration through the RAG initialization module and initializing the large model client, the text processing module and the model initialization module are started. The model initialization module includes the embedded model and the large language model.

[0043] Specifically, the system first loads configuration information, including model configuration parameters, text segmentation parameters, vector library configuration parameters, retrieval configuration parameters, and text paths, which are used for subsequent model initialization, text segmentation, vector processing, retrieval, and other modules. The system also performs regular checks on the format of the configuration parameters. If the format does not conform to the check, an error message is returned with an explanation of the error type. If the error detection passes, the large model client is initialized and then used to connect the LLM and the embedding model for dialogue.

[0044] Step 304: The text processing module detects the text format and segments it to generate a list of overlapping text segments, and then transmits the list of text segments to the vector processing module.

[0045] Specifically, the program reads text segmentation parameters from the configuration file and segments long texts. First, it checks the document format to ensure it meets the requirements of doc, docx, txt, md, or pdf types; otherwise, it returns a text input error and terminates the program. Once the text format meets the requirements, it performs batch text segmentation. The default segmentation setting uses symbols for segmentation, including but not limited to carriage returns, spaces, and line breaks. A default overlap is set within the segmented text, meaning that two segmented texts will overlap in some content.

[0046] Step 306: The vector processing module detects the compatibility of the local vector library, processes vectorized text segments in batches based on the embedding model, and transmits the text vectors to the retrieval module so that the retrieval module selects a retrieval strategy based on keyword matching and question length judgment. After constructing RAG prompt words based on the text vectors, the relevant text segments are transmitted to the RAG retrieval generation module.

[0047] Specifically, during vector generator initialization, the local vector library is checked. Using the default address of the vector library in the configuration file, the types of embedding models in that library are detected. Different embedding models are found to be incompatible in their vectorization settings. Local adaptation is achieved by rebuilding the vector library beforehand to detect incompatibility. After successful adaptation, the vector generator performs batch processing. When there is a large amount of text, a batch size is set locally to perform secondary processing on the text content, adding vectors in batches.

[0048] Furthermore, by inputting the retrieval configuration information, the retrieval tool is selected; otherwise, the retrieval tool is configured with the default settings. Then, a retrieval RAG prompt is created for preliminary preparation, and finally, the question is input into the adaptive retrieval tool to initialize the retrieval tool.

[0049] Furthermore, the adaptive searcher includes five search strategies: similarity_threshold (similarity threshold search), mmr (maximum marginal relevance search), similarity (standard similarity search), max_results (maximum result similarity search), and high_precision (high precision similarity search).

[0050] Similarity (standard similarity retrieval) calculates the matching degree between the query vector and the document vector based on vector similarity (cosine similarity, dot product, etc.). Its main process is to calculate the similarity score between the query vector and all document vectors, sort them in descending order of score, and return the Top-K results, that is, the K results with the highest scores.

[0051] MMR (Maximum Marginal Relevance Retrieval) filters results by maximizing relevance, avoiding information redundancy. The main process is to first find the most relevant result, and when selecting the next result, balance the relevance of the query result with the similarity of the already selected results, repeating until the required number of results are selected.

[0052] The `similarity_threshold` function sets a similarity score threshold and returns only results that exceed that threshold. It calculates the similarity between all documents and the query, filters out results with scores below the threshold, and returns all results that meet the threshold, but the number of results returned is not fixed.

[0053] `max_results` (maximum result similarity search) and `high_precision` (high precision similarity search) are different parameters of `similarity` (standard similarity search), used in different environments. In `max_results`, the TOP-K parameter is chosen to be larger, used for searching large amounts of text for queries, while in `high_precision`, the TOP-K parameter is chosen to be smaller, used for high-precision searches for high-quality answers.

[0054] The strategy selection employs two methods: keyword retrieval and question length assessment. The configuration file sets the corresponding method type for each keyword, such as "What|What is|Definition|Explanation": "high_precision", "Summary|Overview|Main|Key Points": "max_results", "Comparison|Difference|Advantages and Disadvantages": "mmr", "Creativity|Suggestion|How to Do": "similarity_threshold", etc. The retrieval type is switched by comparing the question with the keywords; and the distinction between max_results (maximum result similarity retrieval) and high_precision (high-precision similarity retrieval) is determined by detecting the question length.

[0055] Step 308: Reconstruct the user question through the RAG retrieval generation module, call the text segment of the retrieval module and input it into the large language model to generate the RAG retrieval chain and output the RAG answer.

[0056] Specifically, the problem is re-examined and understood using a large model and system prompts. The question is then reconstructed to improve its quality and avoid word confusion and ambiguity. Subsequently, a new RAG retrieval generation chain is created, incorporating the search prompts, and finally, a RAG answer is generated.

[0057] In the aforementioned implementation method of the adaptive retrieval enhancement generation system based on multi-dimensional question features, firstly, the retrieval module encapsulates various retrieval algorithms into independent strategy components, constructing an extensible retrieval strategy pool. When adding a new retrieval algorithm, only the new component needs to be registered in the strategy pool, without refactoring the core system code, thus achieving plug-in integration of the retrieval module. Simultaneously, the matching rules for retrieval strategies such as keyword matching and question length judgment are defined in a configurable manner (e.g., "defining high-precision retrieval corresponding to a defined question category"). Modifying the rules only requires adjusting the configuration file to complete the iteration, significantly reducing development costs and shortening the cycle. Secondly, a decoupled modular architecture is adopted, treating the retrieval module as an independent functional unit that communicates with other modules. Modifying or optimizing the retrieval logic only involves the retrieval module and will not affect processes such as RAG initialization and text processing, further reducing the scope and risk of code refactoring. The system can quickly adapt to multiple domain scenarios. When faced with diverse queries such as "definition and explanation" and "summary and overview", the adaptive decision-making module can dynamically select matching strategies through configurable rules (such as selecting high-precision retrieval for short questions and multi-result retrieval for long questions), avoiding the limitations of a single strategy. At the same time, through a three-layer design of "strategy pool encapsulation + configurable routing + module decoupling", the pluggable capability can quickly integrate domain-adaptive retrieval algorithms, which not only ensures the retrieval accuracy in different scenarios, but also improves the system's robustness in dealing with uncertain queries. Finally, by using text segment input that fits the requirements, the system effectively improves the quality of answer generation and retrieval efficiency.

[0058] In one embodiment, as shown in Figure 4, a functional flow of an adaptive retrieval enhancement generation system based on question features is provided, with the specific steps as follows:

[0059] Input model configuration parameters, text segmentation parameters, vector configuration parameters, retrieval configuration parameters, and vector library.

[0060] All configuration parameters are subjected to rule-based checks. If the check results are abnormal, an input error message is returned, indicating the type of error. Otherwise, the configuration parameters are read in, the model client is initialized according to the configuration parameters, and the local storage address of the vector library is added.

[0061] The system reads in text, checks if the text format (e.g., doc, txt, md, pdf, etc.) is supported, and assesses format compatibility with the system. If the file format is not supported, an error is reported, or the user can convert the file format. If the format meets system requirements, the text is segmented and input into the embedding model and LLM model client for model initialization according to the configuration file. Otherwise, a file format error is returned.

[0062] After initialization, the model batch processes vectorized text segments, i.e., text vectors. It checks whether the embedding model used by the text vectors in the local vector library is consistent with the embedding model in the newly generated text vector library. If they do not match, the local vector library is deleted and the vector library is reinitialized. Otherwise, after batch processing and vectorizing the documents, an embedding model is added, and the processed vectorized documents are output to the retrieval machine, which then reads and initializes them.

[0063] The search engine uses keyword matching and question length judgment to determine the search strategy and simultaneously build RAG search suggestions. Adding a new search strategy only requires registering it in the configuration file and updating the decision rules, without modifying the core routing logic.

[0064] After determining the retrieval method, the question is re-examined and understood using a large model and system prompts. The question is then reconstructed to improve its quality and further avoid word confusion and ambiguity. Subsequently, a RAG retrieval generation chain is created, and RAG retrieval prompts are added to the chain. Finally, a RAG answer is generated by placing the reconstructed question into the RAG retrieval generation chain.

[0065] It should be understood that although the steps in the flowcharts of Figures 3 and 4 are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in Figures 3 and 4 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0066] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink, DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0067] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0068] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. An adaptive retrieval enhancement generation system based on multidimensional question features, characterized in that, The system includes: a RAG initialization module, a text processing module, a model initialization module, a vector processing module, a retrieval module, and a RAG retrieval and generation module. The output of the RAG initialization module is connected to both the text processing module and the model initialization module, used to load the review system configuration and initialize the large model client. The output of the text processing module is connected to the vector processing module, used to detect text format and segment long text according to parameters, generating a list of overlapping text segments. The output of the model initialization module is connected to both the vector processing module and the RAG retrieval and generation module, used to configure model parameters to support vectorization and dialogue functions. The output of the vector processing module is connected to the retrieval module, used to detect the compatibility of the local vector library and process text vectors based on the detection results. The input of the retrieval module receives text vectors from the vector processing module, and its output is connected to the RAG retrieval and generation module. A strategy pool with five retrieval strategies and an adaptive decision-making module are configured to determine the retrieval strategy and construct RAG prompts by judging keyword matching and question length. The RAG retrieval generation module is used to reconstruct the user question and then call the retrieval module to input the obtained text segment into the large language model to generate an answer. The retrieval module is used to compare the text vector with the query results by comparing keyword matching and question length to obtain the type of retrieval strategy in the configuration file, and to distinguish between maximum result similarity retrieval and high-precision similarity retrieval strategies based on the question length and the TOP-K threshold parameter, and to determine the retrieval strategy corresponding to each text vector. Based on the determined retrieval strategy, the retrieval module is called to input the obtained text segment into the large language model for question reconstruction, outputting a RAG retrieval generation chain, and the system retrieval prompts are put into the RAG retrieval generation chain to generate a RAG answer.

2. The system according to claim 1, characterized in that, The model initialization module includes an embedded model and a large language model; the five retrieval strategies include similarity threshold retrieval, maximum marginal relevance retrieval, standard similarity retrieval, maximum result similarity retrieval, and high-precision similarity retrieval.

3. The system according to claim 2, characterized in that, The similarity threshold retrieval is based on calculating the similarity score between the query vector and all document vectors using vector similarity. The similarity scores are then sorted in descending order, and the result corresponding to the highest similarity score is selected according to the threshold.

4. The system according to claim 3, characterized in that, The maximum marginal relevance retrieval filters results by ensuring maximum relevance. It first finds the most relevant result, and when selecting the next result, it balances the relevance of the query result with the similarity of the selected result, repeating until a preset number of results are selected.

5. The system according to claim 4, characterized in that, The similarity threshold retrieval calculates the similarity between all text vectors and the query results by setting a similarity score threshold, filters out results with similarity scores lower than the similarity score threshold, and outputs all results.

6. The system according to claim 5, characterized in that, The three retrieval strategies—maximum result similarity retrieval, high-precision similarity retrieval, and similarity threshold retrieval—use different TOP-K threshold parameters and are applied to different retrieval environments. The TOP-K threshold parameter for maximum result similarity retrieval is greater than that for similarity threshold retrieval, and the TOP-K threshold parameter for similarity threshold retrieval is greater than that for high-precision similarity retrieval.

7. A method for implementing an adaptive retrieval enhancement generation system based on multidimensional question features, characterized in that, The method includes: loading the review system configuration through the RAG initialization module, initializing the large model client, and triggering the startup of the text processing module and the model initialization module; the model initialization module includes an embedding model and a large language model; the text processing module detects the text format and segments it to generate a list of overlapping text segments, and transmits the text segment list to the vector processing module; the vector processing module detects the compatibility of the local vector library, processes the vectorized text segments in batches based on the embedding model, and transmits the text vectors to the retrieval module, so that the retrieval module selects a retrieval strategy based on keyword matching and question length judgment, and after constructing RAG prompt words based on the text vectors, transmits the relevant text segments to the RAG retrieval generation module; and the RAG retrieval module then performs the retrieval. The generation module reconstructs the user question, calls the text segment from the retrieval module and inputs it into the large language model to generate a RAG retrieval chain and output a RAG answer. The specific steps are as follows: The text vector and query results are compared using keyword matching and question length to obtain the type of retrieval strategy from the configuration file. Based on the question length and the TOP-K threshold parameter, two retrieval strategies are distinguished: maximum result similarity retrieval and high-precision similarity retrieval. The retrieval strategy corresponding to each text vector is determined. Based on the determined retrieval strategy, the retrieval module is called to input the obtained text segment into the large language model for question reconstruction, outputting a RAG retrieval generation chain. System search suggestions are added to the RAG retrieval generation chain to generate a RAG answer.

Citation Information

Patent Citations

  • Hybrid retrieval method and system for RAG question-answering system

    CN118656482A

  • AI agent construction system and method based on hybrid retrieval and father-child segmentation

    CN121279435A