External plug-in system based on retrieval enhancement

By constructing an external plug-in system based on retrieval enhancement, the problems of unreliable generated content, delayed information updates, and uninterpretable reasoning of large language models in mission-critical environments are solved, realizing the credibility and timeliness of model output, and making it suitable for multi-domain decision-making tasks.

CN120950503APending Publication Date: 2025-11-14杭州智元研究院有限公司
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510988384.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Large-scale language models are prone to problems such as unreliable generated content, delayed information updates, and uninterpretable reasoning in mission-critical environments.

Method used

An external plug-in system based on retrieval enhancement is constructed, including an indexing module, a retrieval module, and a generation module. Through technologies such as dynamic data management, strategy decision case library management, recursive segmentation of Chinese characters, tree-like index structure construction, vectorized storage, dual-tower coarse ranking, cross-ranking, real-time update awareness, and credibility assessment, the reliability and timeliness of the model output are improved.

Benefits of technology

It achieves credibility, timeliness, and interpretability of model output, improves the accuracy and logical coherence of generated content, and is suitable for decision-making tasks in multiple fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950503A_ABST
    Figure CN120950503A_ABST
Patent Text Reader

Abstract

The invention provides an external plug-in system based on retrieval enhancement. The external plug-in system comprises an indexing module, a retrieval module and a generation module, the index module is used for performing cleaning, segmentation, organization, semantic coding and storage tasks of text data; the index module comprises a dynamic data management sub-module, a strategy decision case library management sub-module, a Chinese character recursive segmentation sub-module, a tree index structure construction sub-module and a vectorization storage sub-module; the retrieval module is used for completing semantic matching and sorting on the basis of the structured index; the retrieval module comprises a double-tower rough arrangement sub-module, a cross fine arrangement sub-module, a real-time update sensing sub-module and a cache management sub-module; the generation module is used for carrying out integration and semantic modeling on the high-quality intelligence information provided by the retrieval module; the generation module comprises an information integration and reasoning sub-module and a credibility evaluation and feedback sub-module; the method supports fact alignment, real-time updating, logic interpretability and output evaluability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing technology, and in particular relates to an external plug-in system based on retrieval enhancement. Background Technology

[0002] Current research indicates that with the development of deep learning, especially the introduction of the Transformer architecture, large-scale language models (such as the GPT series, BERT, T5, etc.) have become the mainstream technology in the field of natural language processing. These models, through pre-training on large-scale corpora, have gained powerful expressive capabilities for language structure, semantic relationships, and common sense knowledge, and are widely used in tasks such as open-domain question answering, text generation, and summary extraction.

[0003] Many studies have attempted to improve model performance by increasing model parameters, extending training time, and expanding training datasets. Meanwhile, to address the issue of factual accuracy, the industry has also tried to enhance the reliability of model outputs through fine-tuning, incorporating knowledge graphs, or rule templates. Retrieval-enhanced generation (RAG) is one of the most widely researched directions in recent years. Its basic idea is to retrieve relevant knowledge as contextual support before the language model generates text, thereby improving the accuracy of the generated content.

[0004] Despite the achievements of these technologies, three main problems remain: 1. Unreliable generated content: Language models may still generate false or logically contradictory information without supporting evidence, especially in fact-intensive or critical decision-making scenarios where the risk is high; 2. Lagging information updates: Most mainstream models rely on pre-trained knowledge, making it difficult to dynamically acquire and integrate the latest information, and thus unsuitable for tasks requiring real-time responses; 3. Unexplainable reasoning process: The output of the model is difficult to trace its reasoning path or source, lacking transparency and verifiability, which limits its application in scenarios with high reliability requirements. Summary of the Invention

[0005] The purpose of this invention is to address the problems of "illusion" issues, delayed response, insufficient knowledge updates, and uninterpretable reasoning that large language models are prone to in mission-critical environments, and to propose an external plug-in system based on retrieval enhancement.

[0006] To achieve the objectives of this invention, this invention provides an external plug-in system based on retrieval enhancement, the system comprising: an index module, a retrieval module, and a generation module;

[0007] I. The index module includes a dynamic data management submodule, a strategy decision case library management submodule, a Chinese character recursive segmentation submodule, a tree-like index structure construction submodule, and a vectorized storage submodule;

[0008] The index module is the basic module for realizing the structuring, vectorization, and efficient semantic retrieval of multi-source heterogeneous data in this invention. It is used for tasks such as cleaning, segmenting, organizing, semantically encoding, and storing text data, and is a core prerequisite for the high-quality operation of subsequent retrieval and generation modules.

[0009] Dynamic Data Management Submodule

[0010] This system is used to collect, manage, and continuously update real-time information from multiple sources, including announcements, user feedback, market analysis reports, sensor data streams, and platform logs. Various data types are categorized according to format and semantic attributes, and metadata tags are attached. These metadata tags include time, location, document type, and source identifier, laying the foundation for subsequent semantic organization and multi-dimensional retrieval.

[0011] The dynamic data management submodule supports unified metadata modeling for heterogeneous data and dynamic incremental updates across sources, ensuring that the knowledge system has real-time performance and structural consistency.

[0012] Strategy Decision Case Library Management Submodule

[0013] It is used for systematically archiving and managing historical decision-making scenarios, industry cases, and typical event descriptions, covering the background of the problem, the solution, and the evaluation of the results; through tagging and structured storage, it can be quickly retrieved and called by topic category, time range, and domain characteristics, assisting reasoning tasks in obtaining reference data.

[0014] The strategic decision-making case library management submodule's semantic reconstruction capability for case data enables multi-dimensional decision path analysis and cross-case collaborative generation, enhancing the background relevance and interpretability of model output.

[0015] Chinese character recursive splitting submodule:

[0016] A semantically driven recursive segmentation mechanism is adopted to decompose paragraph content layer by layer into short text units that are semantically complete and have clear context; the processing method is as follows:

[0017] Step 11, Preliminary Segmentation: Based on Chinese punctuation, use common Chinese punctuation marks including period, comma, semicolon, colon, question mark, exclamation mark, quotation mark, and parentheses to perform preliminary segmentation at the paragraph level;

[0018] Punctuation marks divide text into relatively natural semantic segments, reducing the risk of semantic damage caused by sentence fragmentation.

[0019] Step 12, Recursive segmentation of lengthy paragraphs

[0020] Lengthy paragraphs refer to situations where, even after initial segmentation, individual text segments remain excessively long, contain multiple parallel or progressive levels, or have excessively high information density. For example, a sentence may contain multiple clauses or nested modifying structures; or, although the paragraph has been segmented by periods, the length of individual sentences may still be too large (such as legal provisions, technical specifications, or policy documents).

[0021] At this point, the module will not simply rely on fixed-length segments or sliding windows, but will further refine the segmentation by identifying semantic boundaries, including logical connectors between phrases, list structures, and parallel relationships. The segmentation process follows these principles: maintaining semantic independence and not truncating within core semantic units; and preserving necessary contextual information to avoid context loss or ambiguity due to segmentation.

[0022] Step 13, Vector length constraints and context backtrackability;

[0023] The module needs to take into account the vector length limit, that is, to ensure that when the text fragment is subsequently input into the vectorization model (such as BERT, Transformer, etc.), it does not exceed the maximum number of tokens that the model can process (such as 512 tokens or less).

[0024] If the segments are too long, the following problems may occur: they may be truncated due to exceeding the model input limit, resulting in the loss of important information; and they may affect the accuracy of vector retrieval or generation.

[0025] Therefore, the module will impose secondary constraints on the length of text segments based on semantic boundaries to ensure that each segment is within a safe token range.

[0026] The Chinese character recursive segmentation submodule, through a combination of semantic boundary recognition and length control, outperforms traditional fixed-length or sliding window segmentation methods, improving generation quality and logical clarity while maintaining retrieval granularity.

[0027] Tree-based index structure construction submodule

[0028] A semantic hierarchical index tree is constructed based on the segmentation units and their metadata, supporting semantic navigation and information tracing; the construction rules are as follows:

[0029] The hierarchical structure of an index tree includes leaf nodes, intermediate nodes, and a root node;

[0030] Each leaf node corresponds to a minimum semantic unit, which is a short text fragment obtained after recursive segmentation. The content stored in the node includes: text content; metadata such as the document, start and end positions, segmentation level, text length, timestamp, tags, and topic category; vector representation is used for similarity retrieval or semantic matching; the leaf node is the smallest recallable unit in the retrieval system.

[0031] Intermediate nodes are used to aggregate multiple semantically related leaf nodes or lower-level intermediate nodes; aggregation rules are flexibly defined based on the following dimensions: document structure, including chapters, paragraphs, and heading levels (e.g., "Introduction", "Methods", "Discussion"); time periods, including date, quarter, and year aggregations, used to process time-series data (e.g., news, reports, transaction records); task objectives, including problems, scenarios, and business process steps under the same theme;

[0032] Intermediate nodes grasp semantic relationships at a higher level, making it easier to quickly locate the context or summarize multiple segments;

[0033] The root node represents the top-level semantic concept of the entire index tree, which is a knowledge domain, business topic, or task scenario. Examples include medical treatment suggestions, customer problem classification, and market dynamic interpretation. The root node serves as the global entry point, facilitating high-level semantic navigation across documents and topics.

[0034] The tree-structured index building submodule supports multiple retrieval and tracing methods, including leaf-level recall, upward expansion, and multi-path traversal.

[0035] Leaf-level Retrieval: When a user enters a query, vector retrieval is performed directly at the leaf node level to accurately locate the most relevant semantic fragments; it is used to answer fine-grained questions and provide precise evidence fragments.

[0036] Upward expansion starts from the recalled leaf node and traces upward along the tree structure to obtain larger contextual units (such as corresponding paragraphs, chapters, or topics); it is used in scenarios that require contextual integrity or to summarize multiple fragments to generate comprehensive answers; it is used to improve semantic coherence in generation tasks and avoid fragmented answers.

[0037] Multi-path traversal: Supports quick switching between different levels, such as directly retrieving relevant intermediate nodes from the topic level and then drilling down to the leaf nodes; suitable for tasks such as multi-turn dialogues and chain-of-thought.

[0038] The tree-structured index building submodule organizes distributed knowledge in a structured way, enabling information tracking and tracing, and providing structural support for tasks such as multi-round question answering and chain generation.

[0039] Vectorized storage submodule:

[0040] All segmented data will be semantically encoded using pre-trained language models (such as BERT, RoBERTa, etc.), transformed into high-dimensional vector representations, and stored in a vector database (such as FAISS). The vectorized storage submodule is used to build multi-type index structures, supporting Euclidean distance, inner product, and cosine similarity measures; as well as batch updates and partitioned storage management for large-scale embeddings; and to build logical partitions by topic or time dimension to improve query efficiency and data isolation.

[0041] The vectorized storage submodule integrates semantic embedding expression and structured partitioning mechanism, realizing high concurrency, low latency, and controllable accuracy semantic-level information scheduling capabilities, which is a key guarantee for the system to achieve high-quality semantic retrieval.

[0042] II. Search Module

[0043] The retrieval module is the core component of this invention, used for efficient and accurate extraction of information highly relevant to user query tasks. It performs semantic matching and sorting based on a structured index, directly impacting the credibility of the generated content and response efficiency. The retrieval module includes a dual-tower coarse-sorting submodule, a cross-sorting submodule, a real-time update awareness submodule, and a cache management submodule.

[0044] Dual-tower coarse-row sub-module:

[0045] This module performs initial semantic screening and matching between user queries and vectorized text in the database using a dual-encoder structure. The dual-tower coarse-ranking submodule generates vector representations using independent query encoders and text encoders, and selects Top-K candidate segments using inner product or cosine similarity metrics. It supports offline vector pre-computation and batch recall mechanisms, enabling this stage to complete matching tasks in milliseconds, significantly improving the system's response speed and concurrency. Compared to traditional keyword-based or sparse vector-based retrieval methods, the semantic vectors generated by this module through a pre-trained model can more accurately capture query intent, especially advantageous when dealing with unstructured or colloquial expressions, significantly improving the semantic relevance and coverage of the retrieved data.

[0046] The dual-tower coarse-sorting submodule integrates tag matching of structured metadata, including document time and domain tags, before the initial vector screening; it can achieve recall control under both semantic and structural constraints, improving the system's targeting and accuracy in multi-task retrieval.

[0047] In the dual-tower coarse-sorting, the query vector q and the database text vector d... i The similarity is calculated in the following way:

[0048] sim(q,d i )=cos(q,d i )

[0049] After considering structural prior filtering, the final score is:

[0050]

[0051] Wherein, δ(m) q ,m i )∈{0,1} indicates whether the structure metadata tags match.

[0052] Cross-sorting module:

[0053] This module is used to perform fine semantic matching between candidate fragments obtained in the coarse ranking stage and the query; it concatenates the query and candidate content and inputs them into a cross encoder (such as a pre-trained model like BERT), and mines deep semantic relationships through a self-attention mechanism and outputs a ranking score, thereby retaining the fragments with the best contextual fit for the generation stage; this module has a significant improvement in inference accuracy and contextual continuity compared to traditional semantic matching strategies.

[0054] Furthermore, this invention innovates further through a "semantic conflict point identification mechanism," namely, the cross-ranking submodule identifies information conflicts or contradictory sentence structures in candidate content during the cross-ranking stage, automatically annotates them for use in the generation stage, and significantly enhances the consistency and credibility of the generated results.

[0055] In cross-sorting, the concatenated input is as follows:

[0056] INPUT = [CLS]q1,q2,…q n [SEP]d1,d2,…d m [SEP]

[0057] Extract the [CLS] representation vector h using Transformer. CLS The score is calculated as follows:

[0058] score = w T h CLS +b

[0059] The score after considering the semantic conflict suppression mechanism is:

[0060] score′=score·(1-Ω(q,d i ))

[0061] Where, Ω(q,d) i ) is a semantic conflict identification function with a value range of [0,1], used to quantize candidate fragment d. i The degree of semantic contradiction with query q; the semantic conflict identification function is defined as follows:

[0062]

[0063] Where: q j This represents the j-th sentence or keyword in the query; conflict(q j ,d i ) is a measure of q j With d i The scoring function contains logical negation, factual conflict, or semantic reversal; σ(·) is the Sigmoid normalization function, which makes the conflict score between [0,1].

[0064] For example, if q includes "company profit growth", and d i If it is explicitly stated that "the company has incurred losses", then Ω(q,d) i If the score is close to 1, it indicates a strong conflict, and the system will automatically reduce the ranking score of the candidate.

[0065] This function can be trained by combining an antonym dictionary, fact database (such as financial or medical knowledge graphs), and language model to generate comparative samples. It is one of the key modules of this invention to improve the consistency and accuracy of generated content.

[0066] Real-time updates to the perception submodule:

[0067] The system continuously monitors database updates, including new documents, content modifications, and data deletions, and automatically triggers vector recalculation and cache update mechanisms based on these updates to ensure that retrieved content remains consistent with the latest data. The real-time update awareness submodule is based on an event-triggered architecture, avoiding the performance waste caused by traditional timed polling. This is one of the important technological innovations of this invention in improving the real-time performance of system information and the sensitivity of index response.

[0068] To further improve efficiency, this invention introduces a "minimum differential recoding mechanism" in this module. That is, the real-time update perception submodule only performs local vector updates for changed content or newly inserted data, avoiding full recoding, thereby greatly improving the system's online processing performance and computing resource utilization.

[0069] The cache management submodule is used to optimize the retrieval process by combining multiple caching strategies, thereby improving the overall system throughput and access stability. It adopts a hierarchical caching mechanism to handle different types of data: persistent cache (such as Redis) is used to manage static and highly reusable information, which is suitable for typical cases and standard templates; lightweight cache (such as Memcached) is used in conjunction with the LRU algorithm for fast response to dynamic and time-sensitive content.

[0070] III. Generation Module:

[0071] The generation module is the core execution unit in this invention used to generate final decision-making support content based on the retrieval results. It integrates and semantically models the high-quality intelligence information provided by the retrieval module, and further enhances the intelligent generation, logical control, and quantifiable output of the content by introducing logical reasoning capabilities and a credibility assessment mechanism. This ensures that the final text possesses high factual consistency, contextual relevance, and logical plausibility.

[0072] The generation module includes an information integration and reasoning submodule and a credibility assessment and feedback submodule;

[0073] Information Integration and Reasoning Submodule:

[0074] The system performs unified semantic representation and fusion of multi-source and multi-segment intelligence content to construct a complete decision context. Then, it invokes large-scale language models (such as LLM-Chat, RoBERTa, T5, etc.) to perform task-oriented text generation, incorporating a multi-step chain-of-thought strategy to enhance the output's logical coherence and strategic analysis depth. Specific operations include:

[0075] The sorted information fragments are concatenated into a unified context input and then rearranged according to time order, source priority, or topic classification.

[0076] Introducing a prompt template mechanism provides a fixed contextual input structure (such as "background + key points + problem description" format) for large language models, improving the model's ability to model the logical coherence between information fragments;

[0077] Automatically identify redundant paragraphs and conflicting information, and use a confidence scoring mechanism to perform semantic denoising or content weight adjustment;

[0078] Introducing a chain-of-thought prompting mechanism guides the model to generate data step by step, from factual statements to impact judgments, reasoning analysis, and decision recommendations, thereby improving the structure and interpretability of the output.

[0079] The model is guided to prioritize the use of retrieved fragments as supporting facts, avoiding the generation of logically jumpy or context-detached content;

[0080] For instructions that require computational derivation, the system can schedule plug-ins (such as computation modules) to assist in generating structured results (such as tables, lists, etc.).

[0081] Credibility assessment and feedback submodule

[0082] To address the issue of unquantifiable credibility of generated content in traditional LLM when no reference answer is available, a no-reference credibility assessment mechanism is adopted. This mechanism combines the retrieved content with the generated text, scoring the results across three dimensions: fidelity score, answer relevance score, and contextual relevance score. The scoring methods for these three dimensions are as follows:

[0083] Faithfulness Score: Used to measure whether generated content is truly based on retrieved information; the scoring method is as follows:

[0084] The generated content is segmented into multiple semantic assertions; a model is used to determine whether each assertion can be supported by context.

[0085]

[0086] Where V is the assertion that the large language model considers to be consistent with the context, and S is the total number of assertions decomposed by the large model;

[0087] Answer Relevance Score: This score measures the semantic consistency between the generated text and the original question. The scoring method is as follows: questions are generated in reverse based on the answers to obtain a question set; each reverse question and the original question are vectorized using an embedding model (such as SimCSE).

[0088]

[0089] Where, n represents the number of questions generated by the large language model, and sim() is the cosine similarity function;

[0090] Context Alignment Score: This score measures the closeness between the generated content and the retrieved fragment. The scoring method is as follows: Extract the number of context sentences directly referenced or dependent on the generated content, compare this to the total number of context sentences, and calculate the context alignment ratio.

[0091]

[0092] Where, N realtive N represents the number of sentences in the answer that the large language model considers directly relevant or important to the context. all Indicates the total number of sentences in the context.

[0093] Furthermore, compared with traditional evaluation modules, this invention proposes innovative improvements in the following aspects:

[0094] A three-dimensional feedback closed-loop control mechanism is introduced: the system not only scores the generated results, but also sends the scores back to the generation entry point to dynamically adjust the Prompt template, input structure, and even retrieval strategy. This "output-driven input optimization" mechanism is rare in similar systems and can significantly improve the self-correction ability of low-scoring tasks.

[0095] Compared with the prior art, the significant advancement of this invention lies in the fact that the retrieval enhancement external plug-in system proposed in this invention improves the credibility, timeliness, and interpretability of its output content without altering the ontological structure of the language model by constructing a structured index system, an efficient semantic retrieval mechanism, and a quantifiable credibility evaluation framework.

[0096] The innovation of this system is as follows: (1) It manages external knowledge sources in a tree structure, realizing hierarchical organization and traceability retrieval of information; (2) It adopts a two-stage recall strategy, taking into account both retrieval efficiency and semantic matching quality; (3) It introduces a three-dimensional credibility evaluation index without reference, providing users with visual and quantifiable output quality feedback; (4) It has a plug-in architecture, which can be seamlessly integrated into mainstream language model platforms and adapted to decision-making tasks in multiple fields.

[0097] In summary, the present invention not only makes up for the shortcomings of current retrieval enhancement generation technology at the application layer, but also provides new ideas and engineering implementation paths for the application of language models in high-reliability scenarios.

[0098] To more clearly illustrate the functional characteristics and structural parameters of the present invention, further explanation is provided below in conjunction with the accompanying drawings and specific embodiments. Attached Figure Description

[0099] Figure 1 This application provides a framework diagram of an external plug-in system based on search enhancement generation, as shown in the embodiments of this application.

[0100] Figure 2 A simplified example diagram of Chinese character segmentation provided for embodiments of this application;

[0101] Figure 3 A rough layout diagram provided for an embodiment of this application;

[0102] Figure 4 A flowchart of the fine-sorting process provided for embodiments of this application. Detailed Implementation

[0103] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0104] The execution flow of this system is as follows:

[0105] Indexing phase:

[0106] In the initial stage of system operation, the index module is executed first to perform structured and semantic processing on the raw data, establishing a foundation for efficient semantic retrieval.

[0107] 11. Data Acquisition and Management: The system supports access to multi-source data (such as policy texts, medical records, financial reports, business documents, etc.) and automatically adds metadata such as timestamps, source tags, and semantic classifications to the input data through the dynamic data management submodule, and uniformly formats and archives the data.

[0108] 12. Recursive segmentation of Chinese text: For long texts and complex sentences in the original data, the system adopts a recursive segmentation strategy based on Chinese semantic boundaries, segmenting from paragraph level, sentence level to phrase level, to ensure that each segment unit has semantic integrity and is suitable for subsequent semantic vector embedding.

[0109] 13. Tree structure construction: The segmented text fragments will be organized into a hierarchical tree index structure according to their semantic category, time sequence, information source and other tags, supporting a bidirectional query strategy of "leaf node retrieval and ancestor node completion", thereby improving the completeness of the recall context.

[0110] 14. Text Vectorization and Storage: Each segment of text is input into a pre-trained model (such as BERT or RoBERTa) for vector embedding, and then uniformly stored in a database that supports high-dimensional retrieval (such as FAISS). This module also supports incremental updates and partition management to ensure that the vector indexing system has high availability and data isolation capabilities.

[0111] Search phase:

[0112] After a user submits a query, the system activates the retrieval module to retrieve content related to the query semantics.

[0113] 21. Dual-Tower Coarse-Ranking Mechanism: The system employs a dual-encoder structure to encode the query and the document separately. Through inner product or cosine similarity calculation, it quickly filters out the Top-K candidate texts. Compared to keyword search, this method has stronger semantic matching capabilities.

[0114] 22. Cross-ranking mechanism: The candidate fragments and the query are concatenated and input into the cross-encoder to perform deep semantic interactive ranking; a "semantic conflict identification function" is introduced to automatically mark potentially semantically contradictory texts and reduce their ranking priority, thereby improving the consistency of results.

[0115] 23. Real-time update support: If the index is updated during retrieval, the system will automatically detect the changes and trigger local vector recoding and index updates to ensure that the latest information is available for the current query.

[0116] 24. Cache Management Strategy: The system distinguishes between long-term static information and short-term dynamic information, adopts a hybrid caching strategy to improve response speed, and builds a cache eviction mechanism based on semantic weight and access frequency to improve the system's load handling capacity.

[0117] Generation phase:

[0118] After the search results are returned, the generation module uses them as context input to guide the large language model to generate the target text, and ensures that the output quality is controllable through credibility evaluation.

[0119] 31. Information Integration and Reasoning Submodule: The system sorts Top-K search fragments by time, source, semantic similarity, etc., and then concatenates them into a standard input structure. It introduces a task-adaptive Prompt template to organize the input format and integrates a chain-like reasoning strategy to guide the model to generate answers step-by-step from facts to reasoning to conclusion. The integration stage innovatively introduces a "semantic conflict perception mechanism" and a "structure-guided concatenation strategy," significantly improving contextual consistency and content logic.

[0120] 32. Credibility Assessment Submodule: The system uses a three-dimensional index system to evaluate the generated content without reference. Based on the scoring results, the system performs "result-driven generation control" and automatically optimizes parameters such as the Prompt template, context scope, and generation length, thus constructing a closed-loop path from generation to feedback and then to correction.

[0121] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. An external plug-in system based on enhanced retrieval, characterized in that: The system includes: an indexing module, a retrieval module, and a generation module; The indexing module is used for tasks such as cleaning, segmenting, organizing, semantically encoding, and storing text data; The index module includes a dynamic data management submodule, a strategy decision case library management submodule, a Chinese character recursive segmentation submodule, a tree-like index structure construction submodule, and a vectorized storage submodule; The retrieval module is used to perform semantic matching and sorting based on the structured index; The retrieval module includes a dual-tower coarse-sorting submodule, a cross-sorting submodule, a real-time update awareness submodule, and a cache management submodule; The generation module is used to integrate and semantically model the high-quality intelligence information provided by the retrieval module. The generation module includes an information integration and reasoning submodule and a credibility assessment and feedback submodule; The dynamic data management submodule is used to collect, manage, and continuously update real-time information from multiple sources. The dynamic data management submodule is used to collect, manage, and continuously update real-time information from multiple sources; The vectorized storage submodule is used to build multi-type index structures.

2. The system according to claim 1, characterized in that, Chinese character recursive splitting submodule: A semantically driven recursive segmentation mechanism is adopted to decompose paragraph content layer by layer into short text units that are semantically complete and have clear context; the processing method is as follows: Step 11, Preliminary Segmentation: Based on Chinese punctuation, use common Chinese punctuation marks including period, comma, semicolon, colon, question mark, exclamation mark, quotation mark, and parentheses to perform preliminary segmentation at the paragraph level; Step 12, recursively segmenting long paragraphs: Further fine-grained segmentation is performed by identifying semantic boundaries, including logical connectors between phrases, list structures, and parallel relationships. The segmentation process follows these principles: maintaining semantic independence, avoiding truncation within core semantic units, and preserving necessary contextual information. Step 13, Vector length constraints and context backtrackability; The Chinese character recursive segmentation submodule, through a combination of semantic boundary recognition and length control, outperforms traditional fixed-length or sliding window segmentation methods, improving generation quality and logical clarity while maintaining retrieval granularity.

3. The system according to claim 1, characterized in that, The tree-structured index building submodule constructs a semantic hierarchical index tree based on the segmentation units and their metadata, supporting semantic navigation and information tracing; the construction rules are as follows: The hierarchical structure of an index tree includes leaf nodes, intermediate nodes, and a root node; Each leaf node corresponds to a minimum semantic unit, which is a short text fragment obtained after recursive segmentation. The content stored in the node includes: text content; metadata such as the document, start and end positions, segmentation level, text length, timestamp, tags, and topic category; vector representation is used for similarity retrieval or semantic matching; the leaf node is the smallest recallable unit in the retrieval system. Intermediate nodes are used to aggregate multiple semantically related leaf nodes or lower-level intermediate nodes; aggregation rules are flexibly defined based on the following dimensions: document structure includes chapters, paragraphs, and heading levels; time periods include date, quarter, and year aggregations, used to process time-series data; task objectives include problems, scenarios, and business process steps under the same theme; Intermediate nodes grasp semantic relationships at a higher level, making it easier to quickly locate the context or summarize multiple segments; The root node represents the top-level semantic concept of the entire index tree, which is a knowledge domain, business theme, or task scenario; the root node serves as the global entry point, facilitating high-level semantic navigation across documents and themes.

4. The system according to claim 3, characterized in that, The tree-structured index building submodule supports multiple retrieval and tracing methods, including leaf-level recall, upward expansion, and multi-path traversal. Leaf-level recall: When a user enters a query, vector retrieval is performed directly at the leaf node level to accurately locate the most relevant semantic fragments; this is used to answer fine-grained questions. The upward extension starts from the recalled leaf node and traces upward along the tree structure to obtain larger context units; it is used in scenarios that require contextual integrity or to summarize multiple fragments and generate comprehensive answers; it is used to improve semantic coherence in generation tasks and avoid fragmented answers. Multi-path traversal: Supports quick switching between different levels; suitable for multi-turn dialogues and chain-like thinking.

5. The system according to claim 1, characterized in that, The dual-tower coarse-ranking submodule is used to perform semantic screening and matching between user queries and vectorized text in the database through a dual-encoder structure. The dual-tower coarse-ranking submodule uses independent query encoders and text encoders to generate vector representations and uses inner product or cosine similarity metrics to select Top-K candidate segments. It supports offline vector pre-computation and batch recall mechanisms. The dual-tower coarse ranking submodule integrates tag matching of structured metadata, including document time and domain tags, before the initial vector screening. In the dual-tower coarse ranking, the query vector q is compared with the database text vector d. i The similarity is calculated in the following way: sim(q,d i )=cos(q,d i ) After considering structural prior filtering, the final score is: Wherein, δ(m) q ,m i )∈{0,1} indicates whether the structure metadata tags match.

6. The system according to claim 1, characterized in that, The cross-ranking submodule is used to perform fine semantic matching between the candidate fragments obtained in the coarse ranking stage and the query; the query and candidate content are concatenated and input into the cross encoder, and the deep semantic relationship is mined through the self-attention mechanism and the ranking score is output, so as to retain the fragment with the best context fit for the generation stage; The cross-ranking submodule identifies information conflicts or contradictory sentence structures in candidate content during the cross-ranking stage and automatically marks them for avoidance during the generation stage. In cross-sorting, the concatenated input is as follows: INPUT=[CLS]1,q2,…q n [SEP]d1,d2,…d m [SEP] Extract the [CLS] representation vector h using Transformer. CLS The score is calculated as follows: score=w T h CLS +b The score after considering the semantic conflict suppression mechanism is: score’=score·(1-Ω(q,d i )) Where, Ω(q,d) i ) is a semantic conflict identification function with a value range of [0,1], used to quantize candidate fragment d. i The degree of semantic contradiction with query q; the semantic conflict identification function is defined as follows: Where: q j This represents the j-th sentence or keyword in the query; conflict(q j ,d i ) is a measure of q j With d i The scoring function contains logical negation, factual conflict, or semantic reversal; σ(·) is the Sigmoid normalization function, which makes the conflict score between [0,1].

7. The system according to claim 1, characterized in that, The real-time update awareness submodule continuously monitors update behaviors in the database, including adding documents, modifying content, and deleting data. Based on the update situation, it automatically triggers vector recalculation and cache update mechanisms to ensure that the retrieved content is consistent with the latest data. The real-time update perception submodule is based on an event-triggered architecture; The real-time update perception submodule only performs local vector updates for changed content or newly inserted data, avoiding full recoding.

8. The system according to claim 1, characterized in that, The cache management submodule is used to optimize the retrieval process by combining multiple caching strategies, thereby improving the overall system throughput and access stability. It adopts a hierarchical caching mechanism to handle different types of data: persistent cache management is used for static and highly reusable information, which is suitable for typical cases and standard templates; lightweight caching combined with the LRU algorithm is used for dynamic and time-sensitive content for fast response.

9. The system according to claim 1, characterized in that, The information integration and reasoning submodule performs unified semantic representation and fusion of multi-source and multi-segment intelligence content to construct a complete decision context. It then calls upon a large-scale language model to perform task-oriented text generation, incorporating a multi-step reasoning chain strategy workflow, including: The sorted information fragments are concatenated into a unified context input and then rearranged according to time order, source priority, or topic classification. Introducing a prompt template mechanism provides a fixed contextual input structure for large language models, improving the model's ability to model the logical coherence between information fragments; Automatically identify redundant paragraphs and conflicting information, and use a confidence scoring mechanism to perform semantic denoising or content weight adjustment; A thought chain reasoning mechanism is introduced to guide the model to be generated step by step, from factual statement → impact judgment → reasoning analysis → decision-making suggestions; The model is guided to prioritize the use of retrieved fragments as supporting facts, avoiding the generation of logically jumpy or context-detached content; For instructions that require computational derivation, the system can schedule plugins to assist in generating structured results.

10. The system according to claim 1, characterized in that, The credibility assessment and feedback submodule employs a no-reference credibility assessment mechanism, combining the search content and generated text to score the generated results across three dimensions: fidelity score, answer relevance score, and context relevance score. The scoring methods for these three dimensions are as follows: Loyalty score: Used to measure whether generated content is truly based on retrieved information; the scoring method is as follows: The generated content is segmented into multiple semantic assertions; a model is used to determine whether each assertion can be supported by context. Where V is the assertion that the large language model considers to be consistent with the context, and S is the total number of assertions decomposed by the large model; Answer relevance scoring: This measure is used to assess the semantic consistency between the generated text and the original question. The scoring method is as follows: questions are generated in reverse based on the answers to obtain a question set; each reverse question is vectorized with the original question using an embedding model. Where, n represents the number of questions generated by the large language model, and sim() is the cosine similarity function; Contextual relevance score: used to measure the closeness between generated content and retrieved fragments; the scoring method is as follows: extract the number of context sentences that are directly referenced or depended on in the generated content, compare with the total number of context sentences; calculate the contextual relevance ratio: Where, N relative N represents the number of sentences in the answer that the large language model considers directly relevant or important to the context. all Indicates the total number of sentences in the context.

Citation Information

Cited By

  • Maintenance case-oriented cross-modal retrieval and intelligent recommendation system

    CN121456185A

  • Content credit collection probability evaluation and structure optimization system oriented to generative search engine

    CN121764954A

  • Credit report generation method and device based on multi-index context bus

    CN122115099A