RAG recall rate improving method
By optimizing the query expansion of the RAG system through multi-level processing and multi-dimensional query expansion of the knowledge base, combined with multi-path retrieval and dynamic weight fusion, the problem of low recall rate is solved, and deep semantic association with user intent and improved recall rate are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing RAG systems have coarse granularity and incomplete semantic coverage when expanding queries, resulting in long-tail problems and low recall rates for colloquial queries.
By processing knowledge base documents at multiple levels, generating multi-dimensional potential questions, constructing semantic and entity indexes, and combining multi-way retrieval and dynamic weight fusion, query expansion and result verification are optimized, and anomaly degradation strategies are designed.
It achieves deep semantic association with user intent, improves recall rate, solves the long-tail problem and recall rate bottleneck of conversational queries, and ensures the adaptability and stability of the system in different fields.
Smart Images

Figure CN121809481A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a method for improving RAG recall. Background Technology
[0002] Retrieval Augmentation (RAG) systems, through a two-stage "retrieval-generation" architecture, integrate knowledge base information into the generative model, effectively solving the "illusion" problem of Large Language Models (LLMs) and becoming a core technology for implementing intelligent question answering and document retrieval. However, traditional query expansion schemes (such as keyword synonym replacement and simple sentence transformation) can only achieve surface-level expansion and cannot capture the deep semantic connections of user intent, resulting in low recall rates for long-tail problems and colloquial queries. Summary of the Invention
[0003] Purpose of the invention: The purpose of this invention is to provide a method for improving RAG recall; it can solve the problems of coarse query expansion granularity and incomplete semantic coverage in existing methods.
[0004] Technical Solution: To solve the above-mentioned technical problems, according to one aspect of the present invention, more specifically, a method for improving RAG recall rate, which specifically includes the following steps:
[0005] S1. Multi-level processing of knowledge base documents: Classify and filter the target domain knowledge base, segment semantic paragraphs, annotate entities and encode multi-granularity vectors to obtain standardized semantic paragraphs containing "classification ID-paragraph ID-entity list-multi-granularity vector".
[0006] S2 and Q2Q semantic association generation and filtering: A domain-fine-tuned pre-trained language model is used to generate multi-dimensional potential questions for each standardized semantic paragraph. 3-5 high-quality potential questions are selected through "rule filtering + model scoring".
[0007] S3 and Q2Q Association Database Index Optimization and Quality Verification: Construct semantic indexes, keyword indexes, and entity indexes, and verify the quality of the Q2Q association database through manual annotation;
[0008] S4. Refined Preprocessing of Original User Queries: Perform basic cleaning, intent recognition, and entity extraction on the original queries to generate standardized original queries;
[0009] S5. Multi-dimensional query expansion and quality screening: Based on the domain fine-tuning model, standardized original query expansion questions are generated. 3-5 high expansion questions are retained through hierarchical screening and weights are initialized according to similarity.
[0010] S6. Multi-path search collaborative execution: Q2Q matching search, multi-vector search and BM25 enhanced search are executed in parallel to obtain Q2Q matching results, vector search results and BM25 search results respectively. Paragraphs with BM25 scores of not less than 1.8 and not covered by vector search are marked as complementary paragraphs.
[0011] S7. Dynamic weight fusion of search results: The weights of the three search paths are adjusted based on historical data and current recall rate fluctuations. After deduplication and anomaly filtering of search results, the final score is calculated by combining supplementary reward points.
[0012] S8. Verification of search result quality: Filter relevant paragraphs through a lightweight relevance classifier to establish a closed loop of "search-feedback-optimization";
[0013] S9. Abnormal Scenario Degradation Strategy: Design rule-based degradation schemes for scenarios such as expansion failure, insufficient matching, and excessive latency.
[0014] Furthermore, in step S1, the semantic paragraph segmentation adopts a hybrid segmentation algorithm of "5-sentence semantic window + inter-sentence cosine similarity", and the inter-sentence cosine similarity threshold is set to 0.6; the entity standard is implemented through a domain NER model based on BERT fine-tuning, and the labeled category at least includes the core entities of the domain; the multi-granularity vector encoding includes a 1024-dimensional sentence-level representative vector generated by RoBERTa-Large, and a 768-dimensional paragraph-level enhanced vector generated by SBERT fusion entity vector.
[0015] Furthermore, in step S2, the pre-trained language model for domain fine-tuning is a fine-tuned T5-XXL model, and the fine-tuning objective function is "question generation loss + semantic consistency comparison loss"; multi-dimensional potential questions cover expression style variants, scene supplement variants, and domain terminology adaptation variants; the model scoring adopts the domain fine-tuned perplexity model and semantic consistency model, wherein the perplexity model screening threshold is less than 60, and the semantic consistency model screening threshold is not less than 0.8.
[0016] Furthermore, in step S3, the semantic index adopts FAISS's HNSW index structure, the keyword index is an inverted index built based on Lucene, the entity index is a mapping index of "entity-paragraph ID", and the Q2Q association library adopts a version management mechanism of "weekly incremental + monthly full verification".
[0017] Furthermore, in step S5, the hierarchical screening includes: rule screening, model screening, and K-means clustering screening. Rule screening is used to identify issues related to missing entities and abnormal lengths. In K-means clustering screening, K=3, and 1-2 representative issues are selected from each cluster. The weights of the extended issues are initialized based on the cosine similarity of the standardized original query. A cosine similarity of 0.9 corresponds to a weight of 1.0, and the weight decreases by 0.1 for every 0.1 decrease in cosine similarity.
[0018] Furthermore, in step S6, Q2Q matching retrieval first filters paragraphs containing the query entity through the entity index, then sorts them by "average similarity × 0.7 + number of entity matches × 0.3", and takes the top 12 paragraphs; multi-vector retrieval adopts "FAISSIVF_PQ coarse retrieval + sentence-level vector retrieval", and BM25 enhanced retrieval weights the core entities in the domain with a weight coefficient of 1.5, while ordinary words maintain a weight of 1.0.
[0019] Furthermore, in step S7, the initial base weights are: Q2Q matching retrieval weight = 0.4, multi-vector retrieval weight = 0.5, and BM25 enhanced retrieval weight = 0.1. The dynamic correction rule is: when the recall rate fluctuates greater than 0.2, the corresponding branch weight increases by 0.1; when the recall rate fluctuates less than 0.2, the corresponding branch weight decreases by 0.1. At the same time, after correction, the sum of the Q2Q matching retrieval weight, multi-vector retrieval weight, and BM25 enhanced retrieval weight is ensured to be 1. The final score is the sum of the corrected Q2Q matching retrieval weight, multi-vector retrieval weight, BM25 enhanced retrieval weight, and supplementary reward points. The supplementary reward points are set to 0.1 for complementary paragraphs and 0.05 for entity matching paragraphs.
[0020] Furthermore, in step S9, the abnormal degradation strategy includes: when expansion fails, switching to rule-based expansion using synonyms and sentence transformations; when there are insufficient matches, closing the Q2Q branch and supplementing with a full database search; and when the delay reaches a set threshold, closing fine-grained search and reducing the accuracy of the FAISS index.
[0021] Beneficial Effects: By employing a "domain-fine-tuned T5-XXL model + multi-dimensional variant generation," the system accurately captures deep semantic connections of user intent, covering three types of variants: expression style, scenario supplementation, and domain terminology adaptation. This addresses the long-tail problem and the recall bottleneck of colloquial queries. The hybrid segmentation algorithm of "5-sentence semantic window + inter-sentence cosine similarity" combined with multi-granularity vector encoding ensures the integrity of semantic segmentation and the accuracy of encoding in the knowledge base, providing a high-quality data foundation for subsequent retrieval. The multi-parallel architecture of "Q2Q matching retrieval + multi-vector retrieval + BM25 enhanced retrieval," combined with optimization strategies such as entity index filtering, FAISS IVF_PQ coarse retrieval, and domain entity weighting, ensures the accuracy of semantic matching while compensating for the blind spots of a single retrieval mode through complementary paragraph tagging. The dynamic weight fusion mechanism can adaptively adjust the weight of each branch according to the actual retrieval results, while supplementing reward points to further improve the ranking priority of effective results, achieving a balance between "precision and recall."
[0022] A rule-based degradation scheme is designed to address abnormal scenarios such as expansion failures, insufficient matching, and excessive latency, preventing system performance crashes in extreme situations. A closed-loop "retrieval-feedback-lightweight relevance classifier" system and a version management mechanism of "weekly incremental updates + monthly full verification" ensure continuous iterative optimization to adapt to the dynamic knowledge base update needs of different domains. The index layer employs a combination of FAISS HNSW semantic index, Lucene keyword inverted index, and "entity-paragraph ID" mapping index, balancing retrieval speed and query flexibility. Layered filtering and weight initialization rules reduce interference from invalid expansion issues and improve engineering execution efficiency. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating the method. Detailed Implementation
[0024] To make the technical solution of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] Example
[0026] Implementation Scenarios
[0027] With "office equipment fault consultation" as the target scenario, the knowledge base contains 1,000 fault diagnosis and repair guidance documents for equipment such as printers, copiers, and projectors. The core user need is to obtain accurate fault solutions through natural language queries, and the low recall rate of "conversational queries" and "long-tail fault problems" needs to be solved.
[0028] Implementation steps
[0029] I. Multi-level processing of knowledge base documents
[0030] Categorization and filtering: 1,000 documents were categorized by "Equipment type (printer / copier / projector) - Fault type (paper jam / cannot power on / abnormal image quality)", 850 documents with valid fault solutions were filtered, and 150 documents containing advertisements or irrelevant instructions were removed;
[0031] Semantic paragraph segmentation: A hybrid algorithm of "5-sentence semantic window + inter-sentence cosine similarity" is used, with a similarity threshold of 0.6. For example, in a document, "Paper jams are a common problem in printers. Foreign objects in the paper feed path can cause paper jams. Wear and tear on the rollers can also cause paper jams. Cleaning foreign objects or replacing the rollers can solve the problem. It is recommended to check the paper feed path regularly." Because sentences 1-4 are semantically coherent (inter-sentence similarity ≥ 0.65), and sentence 5 is an independent suggestion (similarity with sentence 4 0.52 < 0.6), it is segmented into two paragraphs: Paragraph 1 (sentences 1-4) and Paragraph 2 (sentence 5).
[0032] Entity annotation: The domain NER model based on BERT fine-tuning is adopted. The annotation categories include "device name (printer), fault phenomenon (paper jam), fault cause (foreign object in paper feed channel, roller wear), solution (clean foreign object, replace roller)". The entity list of paragraph 1 is [printer, paper jam, foreign object in paper feed channel, roller wear, clean foreign object, replace roller];
[0033] Multi-granularity vector coding:
[0034] Use RoBERTa-Large to generate a 1024-dimensional sentence-level representative vector for paragraph 1 (taking the average of the 4 sentence vectors).
[0035] Use SBERT to fuse entity vectors (768-dimensional vectors for each entity) to generate a 768-dimensional paragraph-level augmented vector for paragraph 1;
[0036] Output standardized semantic paragraphs: The standardized format of paragraph 1 is "Category ID: Printer-Paper Jam; Paragraph ID: P001; Entity list: [Printer, Paper Jam, Foreign Object in Paper Feed Channel, Roller Wear, Clean Foreign Object, Replace Roller]; Sentence-level vector (1024 dimensions): [0.12, 0.35, ..., 0.28]; Paragraph-level augmented vector (768 dimensions): [0.21, 0.43, ..., 0.36]".
[0037] II. Q2Q Semantic Association Generation and Filtering
[0038] Model selection and fine-tuning: The domain-fine-tuned T5-XXL model was adopted, and the fine-tuning objective function was "question generation loss + semantic consistency comparison loss" (fine-tuned based on 5000 office equipment fault question and answer data).
[0039] Multi-dimensional potential problem generation: For paragraph 1 (printer paper jam solution), generate 3 types of variant problems:
[0040] Variations in expression style: "What should I do if my printer keeps jamming?" "What are the solutions for printer paper jams?";
[0041] Additional scenario variations: "My office printer is jammed; will cleaning out the foreign objects help?" "My home printer is jammed due to worn rollers; do I need to replace the rollers?"
[0042] Domain-specific terminology adaptation variations: "How to resolve paper jams caused by foreign objects in the printer's paper feed path?" "What are the repair solutions for paper jams caused by worn rollers?";
[0043] Screening process:
[0044] Rule filtering: Remove questions that lack a core entity (e.g., "What to do if the device jams paper" lacks "printer") or have abnormal length (≤5 characters or ≥30 characters), and retain 8 candidate questions;
[0045] Model scoring: A domain-fine-tuned perplexity model and a semantic consistency model were used, with a perplexity threshold of <60 and a semantic consistency threshold of ≥0.8;
[0046] Example candidate question "A foreign object in the printer's paper feed path is causing a paper jam, how to solve it?": Perplexity 52 (<60), semantic consistency 0.88 (≥0.8), meets the requirements;
[0047] Candidate question "If a printer jams, is the only solution to replace the rollers?": Perplexity 75 (≥60), semantic consistency 0.72 (<0.8), removed;
[0048] Final selection: 3 high-quality potential issues were retained and associated with paragraph IDP001.
[0049] III. Q2Q Related Library Index Optimization and Quality Verification
[0050] Index building:
[0051] Semantic Indexing: Employs FAISS's HNSW index structure, built upon paragraph-level augmented vectors, supporting fast semantic matching;
[0052] Keyword Index: An inverted index is built based on Lucene, with keywords including terms from the entity list and core fault terms (such as "paper jam", "cleaning", "replacement").
[0053] Entity Index: Construct an "entity-paragraph ID" mapping index, such as "printer-paper jam" corresponding to [P001, P002, ...];
[0054] Quality verification and version management:
[0055] Manual annotation: Randomly select 10% of Q2Q association pairs (potential problem-paragraph) to verify semantic relevance, requiring an accuracy of ≥95% (if the standard is not met, the pair will be re-selected).
[0056] Version management: adopts "weekly incremental updates" (adding new Q2Q association pairs generated from new documents to the database) + "monthly full verification" (re-verifying the validity of all association pairs).
[0057] IV. Refined Preprocessing of User Original Queries
[0058] Original user query: "My printer keeps jamming, is the roller broken?"
[0059] Basic cleaning: Remove the interjection "ya", correct the colloquial expression "always" to "frequently", resulting in "My printer often jams, is the roller broken?";
[0060] Intent recognition: The core intent was identified as "to find solutions for printer paper jams (suspected roller malfunction)";
[0061] Entity extraction: Extract entities [printer, paper jam, roller];
[0062] Generate a standardized raw query: "What are the solutions for frequent paper jams caused by printer roller malfunction?".
[0063] V. Multi-dimensional query expansion and quality filtering
[0064] Extended Question Generation: Based on the domain fine-tuning model (of the same origin as S2), eight extended questions for the standardized original query are generated, such as:
[0065] "My printer rollers are broken and causing paper jams, how can I fix them?" "My printer frequently jams, should I check if the rollers are working properly?" "My printer is jamming due to roller malfunction, is it okay to replace the rollers?" etc.
[0066] Layered filtering:
[0067] Rule filtering: Remove 2 questions with missing entities (e.g., "How to fix a paper jam" lacks "roller") and abnormal length, keeping 6;
[0068] Model selection: Using the semantic consistency model (threshold ≥ 0.75), one semantically biased question was removed ("Is the printer paper jam related to the roller?", consistency 0.72 < 0.75), and five questions were retained;
[0069] K-means clustering selection: K=3, the 5 problems are clustered into 3 categories (core solution category, fault verification category, component replacement category), 1-2 representative problems are selected from each category, and finally 3 highly scalable problems are retained;
[0070] Weight initialization: Weights are assigned based on the cosine similarity to the normalized original query.
[0071] Question 1 "The printer roller is broken, causing a paper jam. How can I fix it?": Similarity 0.92 → Weight 1.0;
[0072] Question 2 "A printer paper jam is caused by a malfunctioning roller. Is it feasible to replace the roller?": Similarity 0.83 → Weight 0.9;
[0073] Question 3 "The printer frequently jams. Is the roller working properly?": Similarity 0.75 → Weight 0.8.
[0074] VI. Multi-path retrieval and collaborative execution
[0075] Q2Q matching search:
[0076] Entity Index Filtering: Filter paragraphs containing the entities [printer, paper jam, roller] to obtain 20 candidate paragraphs;
[0077] The ranking formula is: "average similarity × 0.7 + number of entity matches × 0.3", where the average similarity is the mean semantic similarity between the three extended questions and the paragraph's potential questions;
[0078] Example paragraph P001: Average similarity 0.85, number of entity matches 3 (printer, paper jam, and roller all match), score = 0.85×0.7+3×0.3=0.595+0.9=1.495, ranked 1st;
[0079] Take the first 12 paragraphs as the Q2Q matching result.
[0080] Multi-vector retrieval:
[0081] Perform “FAISSIVF_PQ coarse search + sentence-level vector search”: First, perform coarse search (recall Top50) on paragraph-level enhanced vectors using FAISSIVF_PQ, and then perform fine matching using sentence-level vectors (1024 dimensions) to obtain 20 vector search results.
[0082] BM25 Enhanced Search:
[0083] Weighting settings: Core domain entities (printer, paper jam, roller) have a weighting coefficient of 1.5, while common terms (such as "solution" and "replacement") have a weighting of 1.0.
[0084] Calculate the BM25 score to obtain 15 BM25 search results;
[0085] Complementary paragraphs are marked as paragraphs with a BM25 score of ≥1.8 that are not covered by vector search, such as paragraph P089 ("When a printer jams, check the paper feed path first, then check for roller wear", BM25 score 1.85, not found in the vector search results).
[0086] VII. Dynamic Weighting of Search Results
[0087] Basic weights: Q2Q matching retrieval weight = 0.4, multi-vector retrieval weight = 0.5, BM25 enhanced retrieval weight = 0.1;
[0088] Dynamic correction:
[0089] The average recall rate of the 30 historical searches was 0.75, and the current search recall rate was 0.98. The fluctuation was 0.98 - 0.75 = 0.23 > 0.2. Therefore, the weight of Q2Q matching search was increased by 0.1. The adjusted weights are: Q2Q = 0.5, multi-vector = 0.4, BM25 = 0.1 (the sum of the three = 1).
[0090] Results processing and score calculation:
[0091] Deduplication: Merge the results from the three search paths, remove duplicate paragraphs, and retain 35 unique paragraphs;
[0092] Anomaly filtering: Remove paragraphs with excessively low scores (overall score < 0.3), retaining 28;
[0093] Final score = Adjusted weighted score + Supplementary bonus points:
[0094] Paragraph P001: Q2Q score 0.5×1.495 + multi-vector score 0.4×0.92 + BM25 score 0.1×1.9 = 0.7475 + 0.368 + 0.19 = 1.3055, entity matching bonus score 0.05, total score 1.3555;
[0095] Complementary paragraph P089: Q2Q score 0.5×0.8 + multi-vector score 0.4×0 + BM25 score 0.1×1.85 = 0.4 + 0 + 0.185 = 0.585, complementary bonus score 0.1, total score 0.685.
[0096] VIII. Verification of Search Result Quality
[0097] Lightweight relevance classifier: A fine-tuned BERT-base classifier (trained on 2000 relevant / irrelevant labeled data) is used to filter paragraphs with a relevance of ≥0.7;
[0098] Closed-loop establishment: Mark the effective paragraphs of user clicks and feedback (such as the user choosing P001 as the best answer) as "high-value paragraphs" for subsequent model fine-tuning (such as T5-XXL model, relevance classifier) and weight optimization.
[0099] IX. Degradation Strategies for Abnormal Scenarios
[0100] If the standardized original query "Printer roller malfunction causes frequent paper jams, what are the solutions?" fails to generate an expanded model due to overly specialized domain terminology ("roller malfunction"):
[0101] Switch to rule-based expansion: Generate expanded questions by using synonym replacement ("roller" → "spindle") + sentence transformation ("What is the solution?" → "How to handle it?"): "The printer spindle malfunction causes frequent paper jams, what should I do?" "The printer frequently jams, what should I do if the spindle is broken?"
[0102] The subsequent retrieval process remains unchanged to ensure that the system outputs results normally and avoids a sharp drop in recall due to expansion failure.
[0103] 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 present 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 this patent should be determined by the appended claims.
Claims
1. A method for improving RAG recall, characterized in that, Specifically, the following steps are included: S1. Multi-level processing of knowledge base documents: Classify and filter the target domain knowledge base, segment semantic paragraphs, annotate entities and encode multi-granularity vectors to obtain standardized semantic paragraphs containing "classification ID-paragraph ID-entity list-multi-granularity vector". S2 and Q2Q semantic association generation and filtering: A domain-fine-tuned pre-trained language model is used to generate multi-dimensional potential questions for each standardized semantic paragraph. 3-5 high-quality potential questions are selected through "rule filtering + model scoring". S3 and Q2Q Association Database Index Optimization and Quality Verification: Construct semantic indexes, keyword indexes, and entity indexes, and verify the quality of the Q2Q association database through manual annotation; S4. Refined Preprocessing of Original User Queries: Perform basic cleaning, intent recognition, and entity extraction on the original queries to generate standardized original queries; S5. Multi-dimensional query expansion and quality screening: Based on the domain fine-tuning model, standardized original query expansion questions are generated. 3-5 high expansion questions are retained through hierarchical screening and weights are initialized according to similarity. S6. Multi-path search collaborative execution: Q2Q matching search, multi-vector search and BM25 enhanced search are executed in parallel to obtain Q2Q matching results, vector search results and BM25 search results respectively. Paragraphs with BM25 scores of not less than 1.8 and not covered by vector search are marked as complementary paragraphs. S7. Dynamic weight fusion of search results: The weights of the three search paths are adjusted based on historical data and current recall rate fluctuations. After deduplication and anomaly filtering of search results, the final score is calculated by combining supplementary reward points. S8. Validation of search result quality: Filter relevant paragraphs using a lightweight relevance classifier to establish a closed loop of "search-feedback-optimization"; S9. Abnormal Scenario Degradation Strategy: Design rule-based degradation schemes for scenarios such as expansion failure, insufficient matching, and excessive latency.
2. The method for improving RAG recall according to claim 1, characterized in that: In step S1, semantic paragraph segmentation adopts a hybrid segmentation algorithm of "5-sentence semantic window + inter-sentence cosine similarity", with the inter-sentence cosine similarity threshold set to 0.6; entity standard is implemented through a domain NER model based on BERT fine-tuning, and the labeled category at least includes the core entities of the domain; multi-granularity vector encoding includes a 1024-dimensional sentence-level representative vector generated by RoBERTa-Large, and a 768-dimensional paragraph-level enhanced vector generated by SBERT fusion entity vector.
3. The method for improving RAG recall according to claim 1, characterized in that: In step S2, the pre-trained language model for domain fine-tuning is the fine-tuned T5-XXL model, and the fine-tuning objective function is "question generation loss + semantic consistency comparison loss"; Multidimensional potential issues cover variations in expression style, variations in scenario supplementation, and variations in domain terminology adaptation; the model scoring adopts a domain-fine-tuned perplexity model and a semantic consistency model, wherein the perplexity model screening threshold is less than 60, and the semantic consistency model screening threshold is not less than 0.
8.
4. The method for improving RAG recall according to claim 1, characterized in that: In step S3, the semantic index adopts the HNSW index structure of FAISS, the keyword index is based on the inverted index built by Lucene, the entity index is a mapping index of "entity-paragraph ID", and the Q2Q association library adopts a version management mechanism of "weekly incremental + monthly full verification".
5. The method for improving RAG recall according to claim 1, characterized in that: In step S5, the hierarchical screening includes: rule screening, model screening, and K-means clustering screening. Rule screening is used to identify issues related to missing entities and abnormal lengths. In K-means clustering screening, K=3, and 1-2 representative issues are selected from each cluster. The weight of the extended issues is initialized based on the cosine similarity of the standardized original query. A cosine similarity of 0.9 corresponds to a weight of 1.0, and the weight decreases by 0.1 for every 0.1 decrease in cosine similarity.
6. The method for improving RAG recall according to claim 1, characterized in that: In step S6, Q2Q matching retrieval first filters paragraphs containing the query entity through the entity index, and then sorts them according to "average similarity × 0.7 + number of entity matches × 0.3", taking the top 12 paragraphs; multi-vector retrieval adopts "FAISSIVF_PQ coarse retrieval + sentence-level vector retrieval", and BM25 enhanced retrieval weights the core entities in the domain with a weight coefficient of 1.5, while ordinary words maintain a weight of 1.
0.
7. The method for improving RAG recall according to claim 1, characterized in that: In step S7, the initial base weights are: Q2Q matching retrieval weight = 0.4, multi-vector retrieval weight = 0.5, and BM25 enhanced retrieval weight = 0.
1. The dynamic correction rule is: when the recall rate fluctuates more than 0.2, the corresponding branch weight increases by 0.1; when the recall rate fluctuates less than 0.2, the corresponding branch weight decreases by 0.
1. At the same time, after correction, the sum of the Q2Q matching retrieval weight, multi-vector retrieval weight, and BM25 enhanced retrieval weight is ensured to be 1. The final score is the sum of the corrected Q2Q matching retrieval weight, multi-vector retrieval weight, and BM25 enhanced retrieval weight, plus the supplementary reward score. The supplementary reward score is set to 0.1 for complementary paragraphs and 0.05 for entity matching paragraphs.
8. The method for improving RAG recall according to claim 1, characterized in that: In step S9, the abnormal degradation strategy includes: when expansion fails, switching to rule-based expansion using synonyms and sentence transformations; when there are insufficient matches, closing the Q2Q branch and supplementing the full database search; and when the delay reaches the set threshold, closing the fine search and reducing the accuracy of the FAISS index.