Retrieval generation method and system based on multi-agent collaboration, terminal and medium

Through a multi-agent collaborative retrieval generation method, query analysis agents and strategy construction agents are used to perform semantic analysis and reinforcement learning, combined with knowledge graph node embedding, the problem of inaccurate semantic matching in existing technologies is solved, and more efficient cross-modal data fusion and noise resistance are achieved.

CN120723880AActive Publication Date: 2025-09-30CHINA TELECOM CO LTD SHENZHEN BRANCH

Patent Information

Application Number
CN202511242726.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-09-30
Estimated Expiration
2045-09-02

AI Technical Summary

Technical Problem

Existing technologies rely on fixed retrieval strategies and have limitations when facing complex queries, multi-round interactions, and cross-modal data fusion. They are easily affected by noise and their semantic matching is not accurate enough.

Method used

Through a multi-agent collaborative retrieval generation method, including query analysis agents for semantic analysis, strategy construction agents for reinforcement learning and meta-learning, combined with knowledge graph node embedding for semantic enhancement, and an adaptive reflection feedback mechanism to generate target answers.

Benefits of technology

It effectively solves the limitations of existing technologies in complex queries and cross-modal data fusion, and improves the accuracy and noise resistance of semantic matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723880A_ABST
    Figure CN120723880A_ABST
Patent Text Reader

Abstract

The invention discloses a retrieval generation method and system based on multi-agent collaboration, a terminal and a medium, and relates to the field of artificial intelligence. Performing semantic analysis on the input word embedding converted by the natural language query instruction through a query analysis agent, and determining a semantic intention vector; performing reinforcement learning and meta learning on the semantic intention vector through a strategy construction agent, and determining a retrieval strategy; performing semantic enhancement on the semantic intention vector according to knowledge graph node embedding to obtain a semantic enhancement vector; determining a data channel according to the semantic enhancement vector, a retrieval strategy and a real-time system load, and calling the data channel for retrieval to obtain candidate documents; and generating a target answer according to each candidate document based on an adaptive reflection feedback mechanism in combination with an auto-encoder and a generative adversarial network. The problems that the prior art depends on a fixed retrieval strategy, has limitation when facing complex query, multi-round interaction and cross-modal data fusion, is easily interfered by noise and is not accurate enough in semantic matching are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a retrieval generation method, system, terminal and medium based on multi-agent collaboration. Background Art

[0002] With the rapid development of artificial intelligence and deep learning technologies, various information retrieval and generation systems have been widely used in scenarios such as intelligent question answering, knowledge management, and automatic summarization. However, traditional retrieval-augmented generation (RAG) technology primarily relies on a fixed retrieval strategy, directly generating answers after retrieving relevant data from an external document repository. This approach has significant limitations when dealing with complex queries, multi-round interactions, and cross-modal data fusion. It is susceptible to noise interference and lacks precise semantic matching.

[0003] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a retrieval generation method, system, terminal and medium based on multi-agent collaboration in response to the above-mentioned defects of the existing technology, aiming to solve the problem that the existing technology relies on fixed retrieval strategies, has limitations when facing complex queries, multi-round interactions and cross-modal data fusion, is easily affected by noise interference and has inaccurate semantic matching.

[0005] The technical solutions adopted by the present invention to solve the problem are as follows: In a first aspect, an embodiment of the present invention provides a retrieval generation method based on multi-agent collaboration, wherein the method includes: Preprocess the natural language query instructions entered by the user to determine the input word embedding; Performing semantic analysis based on the input word embedding by a query analysis agent to determine a semantic intent vector; Performing reinforcement learning and meta-learning on the semantic intent vector through a strategy-building intelligent agent to determine a retrieval strategy; Acquire a real-time system load, and determine a data channel according to the semantic enhancement vector, the retrieval strategy, and the real-time system load; Calling the data channel, searching the semantic enhancement vector according to the retrieval strategy, and determining candidate documents; Based on the adaptive reflection feedback mechanism combined with the autoencoder and the generative adversarial network, the target answer is generated according to each of the candidate documents.

[0006] In one implementation method, the query analysis agent is implemented based on a modified Transformer encoder, which includes several layers, each layer including: an adaptive multi-scale content encoding module for dynamically adjusting weights of content information and position information in an input feature vector to determine a first module vector, wherein the input feature vector is one of the input word embedding or a third module vector; A unified attention module with accelerated reuse, which is used to perform high-frequency texture enhancement and global semantic enhancement on the first module vector, and accelerate attention calculation through a reuse strategy to determine the second module vector; A multi-scale dynamic subspace feedforward neural network is used to perform cross-subspace high-order interaction and multi-scale local enhancement on the second module vector to determine the third module vector.

[0007] In one implementation method, an adaptive multi-scale content encoding module is configured to dynamically adjust the weights of content information and position information in an input feature vector to determine a first module vector, including: Adaptively weighting the standard content attention and relative position attention of each attention head based on the input feature vector through an adaptive content and position balancing operator, and determining a first attention weight corresponding to each attention head according to the weighted standard content attention and the weighted relative position attention; Obtain the historical attention weights of each attention head, and calculate the scaling factor corresponding to each attention head according to each of the historical attention weights through the multi-scale position scaling operator within the head; The first module vector is determined according to the value of the input feature vector, each of the first attention weights, and each of the scaling factors.

[0008] In one implementation method, a unified attention module with accelerated reuse is used to perform high-frequency texture enhancement and global semantic enhancement on the first module vector, and accelerate attention calculation through a reuse strategy to determine the second module vector, including: Mapping the first module vector to the frequency domain, performing spectrum enhancement on the first module vector in the frequency domain using a multi-layer perceptron, and determining a spectrum enhancement feature vector; Calculate the local window attention weight and the global multi-head self-attention weight corresponding to each attention head based on the spectrum enhancement feature vector; A reuse strategy is adopted to determine a fusion feature vector according to the local window attention weight corresponding to each attention head and the global multi-head self-attention weight; The second module vector is determined according to the fused feature vector and the first module vector.

[0009] In one implementation method, a multi-scale dynamic subspace feedforward neural network is used to perform cross-subspace high-order interaction and multi-scale local enhancement on the second module vector to determine the third module vector, including: Dynamically divide the subspace and determine the subspace corresponding to each attention head; Projecting the second module vector to each of the subspaces and performing high-dimensional mapping to determine each high-dimensional feature vector; Performing second-order crossover and multi-scale convolution based on each of the high-dimensional feature vectors to determine each multi-scale feature vector; Performing concatenation, dimensionality reduction, and global linear mapping on the multi-scale feature vectors to determine a global feature vector; The third module vector is determined according to the second module vector and the global feature vector through a lightweight gating network.

[0010] In one implementation method, semantic enhancement is performed on the semantic intent vector according to the knowledge graph node embedding to determine the semantic enhancement vector, including: Calculating the similarity between the semantic intent vector and the embedding of each knowledge graph node; When the similarity is greater than a preset threshold, domain prior information is acquired according to the knowledge graph node embedding corresponding to the similarity; The semantic intention vector is semantically enhanced according to the domain prior information to determine the semantic enhancement vector.

[0011] In one implementation method, the data channel includes a pre-built vector database, and the method for building the vector database includes: Acquiring multimodal data, preprocessing and segmenting the multimodal data, and determining data for each slice; Performing feature extraction on each slice data through quantum feature mapping and graph convolution to determine each graph convolution feature vector; Performing high-frequency texture enhancement and global semantic enhancement on each of the graph convolution feature vectors through the unified attention module with accelerated multiplexing to determine each enhanced feature vector; Each of the enhanced feature vectors is stored in a database to determine the vector database.

[0012] In a second aspect, an embodiment of the present invention further provides a retrieval generation system based on multi-agent collaboration, wherein the retrieval generation system based on multi-agent collaboration includes: The query instruction preprocessing module is used to preprocess the natural language query instructions input by the user and determine the input word embedding; A semantic analysis module, configured to perform semantic analysis based on the input word embeddings through a query analysis agent to determine a semantic intent vector; A retrieval strategy determination module is used to perform reinforcement learning and meta-learning on the semantic intent vector through a strategy construction agent to determine a retrieval strategy; A semantic enhancement module is used to obtain knowledge graph node embeddings, perform semantic enhancement on the semantic intent vector according to the knowledge graph node embeddings, and determine the semantic enhancement vector; a data channel determination module, configured to obtain a real-time system load and determine a data channel according to the semantic enhancement vector, the retrieval strategy, and the real-time system load; A retrieval module, configured to call the data channel, search the semantic enhancement vector according to the retrieval strategy, and determine candidate documents; The target answer generation module is used to generate a target answer based on each of the candidate documents based on an adaptive reflection feedback mechanism combined with an autoencoder and a generative adversarial network.

[0013] In a third aspect, an embodiment of the present invention also provides a terminal comprising a memory and one or more processors; the memory stores one or more programs; the program includes instructions for executing any of the multi-agent collaboration-based retrieval generation methods described above; and the processor is used to execute the program.

[0014] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a plurality of instructions are stored, wherein the instructions are loaded and executed by a processor to implement any of the above-mentioned retrieval generation methods based on multi-agent collaboration.

[0015] Beneficial effects of the present invention: The embodiment of the present invention converts natural language query instructions into word-unit sequences; performs semantic analysis based on the word-unit sequences by a query analysis agent to determine a semantic intent vector; performs reinforcement learning and meta-learning on the semantic intent vector by a strategy construction agent to determine a retrieval strategy; semantically enhances the semantic intent vector based on knowledge graph node embedding to obtain a semantic enhancement vector; determines a data channel based on the semantic enhancement vector, the retrieval strategy, and the real-time system load, and calls the data channel to retrieve and obtain each candidate document; generates a target answer based on each candidate document based on an adaptive reflection feedback mechanism combined with an autoencoder and a generative adversarial network. This effectively solves the problem that the existing technology relies on a fixed retrieval strategy, has limitations when facing complex queries, multi-round interactions, and cross-modal data fusion, is easily affected by noise, and has inaccurate semantic matching. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 It is a flow chart of the retrieval generation method based on multi-agent collaboration provided by an embodiment of the present invention.

[0018] Figure 2 It is a flowchart of the query processing and strategy building module provided by an embodiment of the present invention.

[0019] Figure 3 It is a flowchart of the knowledge graph alignment, data channel selection and deep retrieval module provided by an embodiment of the present invention.

[0020] Figure 4 It is a flowchart of the document preprocessing and segmentation module provided by an embodiment of the present invention.

[0021] Figure 5 It is a flowchart of the semantic extraction and modeling module provided by an embodiment of the present invention.

[0022] Figure 6 It is a flowchart of the vectorization and storage module provided by an embodiment of the present invention.

[0023] Figure 7 It is a flowchart of the answer generation and feedback module provided in an embodiment of the present invention.

[0024] Figure 8 It is a flow chart of the knowledge migration and update module provided by an embodiment of the present invention.

[0025] Figure 9 It is a flow chart of the final output and feedback display module provided by an embodiment of the present invention.

[0026] Figure 10 It is a schematic diagram of the internal modules of the retrieval generation system based on multi-agent collaboration provided by an embodiment of the present invention.

[0027] Figure 11 This is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The present invention discloses a retrieval generation method, system, terminal, and medium based on multi-agent collaboration. To make the objectives, technical solutions, and effects of the present invention more clear and explicit, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only intended to illustrate the present invention and are not intended to limit the present invention.

[0029] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the description of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.

[0030] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0031] With the rapid development of artificial intelligence and deep learning technologies, various information retrieval and generation systems have been widely used in scenarios such as intelligent question answering, knowledge management, and automatic summarization. However, traditional retrieval-augmented generation (RAG) technology primarily relies on a fixed retrieval strategy, directly generating answers after retrieving relevant data from an external document repository. This approach has significant limitations when dealing with complex queries, multi-round interactions, and cross-modal data fusion. It is susceptible to noise interference and lacks precise semantic matching.

[0032] To address the above-mentioned shortcomings of the prior art, the present invention provides a retrieval generation method based on multi-agent collaboration. A query analysis agent performs semantic analysis on the input word embeddings converted from natural language query instructions to determine a semantic intent vector. A strategy construction agent performs reinforcement learning and meta-learning on the semantic intent vector to determine a retrieval strategy. The semantic intent vector is semantically enhanced based on the knowledge graph node embedding to obtain a semantic enhancement vector. Based on the semantic enhancement vector, the retrieval strategy, and the real-time system load, a data channel is determined and invoked to retrieve candidate documents. A target answer is generated based on each candidate document using an adaptive reflective feedback mechanism combined with an autoencoder and a generative adversarial network. This method effectively addresses the problems of the prior art, which rely on fixed retrieval strategies, have limitations when facing complex queries, multi-round interactions, and cross-modal data fusion, are susceptible to noise interference, and have inaccurate semantic matching.

[0033] Exemplary methods: like Figure 1 As shown, the method includes: Step S100: Preprocess the natural language query instruction input by the user to determine the input word embedding.

[0034] Simply put, a user query input unit on a terminal device captures the user's natural language query and performs preprocessing (segmentation, stop word removal, and normalization) to produce a word-gram sequence. Each discrete word in the word-gram sequence is mapped to a low-dimensional, dense continuous numeric vector using an embedding algorithm (such as Word2Vec (a word embedding model that converts words into low-dimensional dense vectors), GloVe (a word embedding model based on global word frequency statistics), or the BERT (Bidirectional Encoder Representation Model, a pre-trained language model based on the Transformer architecture) embedding layer). This results in an input word embedding, which serves as the input for the subsequent query analysis agent.

[0035] Step S200: Perform semantic analysis based on the input word embedding through the query analysis agent to determine the semantic intent vector.

[0036] like Figure 2As shown, the query analysis agent receives the input word embeddings generated by the user query input unit and performs semantic analysis to obtain a semantic intent vector. The core of the query analysis agent is an improved deep Transformer encoder, which consists of several layers. Each layer includes an adaptive multi-scale content encoding module (AMS CPEM), a unified attention module with accelerated reuse (UniFormer-A), and a multi-scale dynamic subspace feedforward neural network (MSDS-FFN). The adaptive multi-scale content encoding module dynamically adjusts the weights between content and position information in the input feature vector to determine a first module vector, where the input feature vector is either the input word embedding or a third module vector. The unified attention module with accelerated reuse performs high-frequency texture enhancement and global semantic enhancement on the first module vector, and accelerates attention computation through a reuse strategy to determine a second module vector. The multi-scale dynamic subspace feedforward neural network performs high-order cross-subspace interactions and multi-scale local enhancement on the second module vector to determine the third module vector. The three modules of adaptive multi-scale content encoding module, unified attention module with accelerated reuse and multi-scale dynamic subspace feedforward neural network are integrated to build a high-precision semantic intent recognition engine. This engine is located inside the query analysis agent and is used to map user natural language query instructions to vector representations with more fine-grained semantics and location information sensitivity, thereby improving the feature expression ability and operating efficiency in multi-agent information fusion and cross-modal semantic alignment scenarios.

[0037] In one implementation, the adaptive multi-scale content encoding module is configured to dynamically adjust the weights of content information and position information in the input feature vector to determine the first module vector, including: Adaptively weighting the standard content attention and relative position attention of each attention head based on the input feature vector through an adaptive content and position balancing operator, and determining a first attention weight corresponding to each attention head according to the weighted standard content attention and the weighted relative position attention; Obtain the historical attention weights of each attention head, and calculate the scaling factor corresponding to each attention head according to each of the historical attention weights through the multi-scale position scaling operator within the head; The first module vector is determined according to the value of the input feature vector, each of the first attention weights, and each of the scaling factors.

[0038] Specifically, the adaptive multi-scale content position encoding module builds a bridge between the long-range dependency capability of Transformer self-attention and the local convolution perception bias of CNN (convolutional neural network). For task scenarios such as small samples, hyperspectral tracking and long document retrieval, through the "adaptive content and position balance operator" and "intra-head multi-scale position scaling" operator, each layer and each head can dynamically adjust the weights of content information and position information (the importance of context and position information) to take into account fine-grained semantics and global dependencies, and build a bridge between the long-range dependency capability of Transformer self-attention and the local convolution perception bias of CNN, effectively alleviating the problem of long-distance information attenuation and significantly improving the model's feature representation capability and position information sensitivity.

[0039] The implementation process of the adaptive multi-scale content position encoding module includes: When the adaptive multi-scale content position encoding module is located in the first layer of the query analysis agent, the input word embedding is obtained ,in, is the length of the word sequence (that is, the number of words contained in the sequence), The dimension of the word embedding vector corresponding to each word unit (i.e., the feature dimension). The input word embedding is divided into patches, which are flattened to obtain the input feature vector , each block is flattened into a vector , The projection dimension of each attention head ensures sufficient representation for downstream computations.

[0040] When the adaptive multi-scale content position encoding module is not located in the first layer of the query analysis agent, the third module vector is obtained as the input feature vector.

[0041] Generate the first Tier Header Query ,key ,value : .

[0042] in, is a learnable parameter, Indicates the vector corresponding to each block or the index of the current query position), Indicates the The vector corresponding to each block or the index of the matched key-value pair position.

[0043] An adaptive content and position balance operator is introduced to dynamically weight the "standard content attention" and "relative position attention". Let: , in, is the trainable position projection vector, Indicates the current query position (index ) and the matched key-value pair position (index ), is the weighted standard content attention, is the weighted relative position attention, Indicates content, Indicates location.

[0044] In order to allow each layer and each head to balance the importance of the two, this operator defines a balance function : , in, is a trainable bias term, is the regularization hyperparameter, Used to suppress extreme bias; when When focusing on content branches ,when When , the focus is on the position branch . middle Bias weight function representing content-position attention.

[0045] According to the above balance function, the fusion form of attention corresponding to the attention head (first attention weight) is: .

[0046] In order to solve the problems of intermediate information attenuation and long-distance attention attenuation in Rotational Position Encoding (RoPE), the module uses a multi-scale position scaling operator within the head to calculate the scaling factor corresponding to each attention head for the historical attention weight corresponding to each attention head in the prefill phase (Prefill phase), including: calculating the position awareness score based on the historical attention weight corresponding to each attention head : , in, For the The historical attention weight corresponding to the query, Indicates that all queries for The historical attention weights of key-value pairs, is the indicator function, It is a learning scalar used to count the number of positions greater than the first threshold and to calculate the average of all historical attention weights. exist Descending ranking of attention heads , linearly mapping it to the preset scaling interval : .

[0047] In order to take into account the consistency between layers and the difference between heads, the first Layer smoothing factor , get the scaling factor (effective scaling ratio): .

[0048] Then in the position attention branch, the relative position Replace with , and then according to the rotation position encoding formula Encode and dynamically adjust the head's attention to near and far dependencies, where is the rotation angle, used for rotation encoding in different dimensions, is the imaginary unit, representing complex number operations, Represents the input feature vector or the token vector at a certain position.

[0049] Finally, according to the first attention weight after fusion With value projection After multiplying and merging the multi-head outputs, the first step is completed by passing through the feed-forward neural network (Feed-Forward Network), residual connection and layer normalization (LayerNorm). After completing the feature update of all layers of the adaptive multi-scale content position coding module, the first module vector is output. ,in, is the number of feature vectors (equivalent to the number of blocks corresponding to the input word embedding), is the feature dimension.

[0050] Through the aforementioned "adaptive balancing" and "multi-scale scaling", the adaptive multi-scale content coding module outperforms traditional rotational position coding or fixed position coding schemes in the following aspects: Dynamic adaptation: each layer and each head and All can be learned online without manual parameter adjustment, and can quickly switch between fine-grained semantics and global dependencies.

[0051] Mid-segment information preservation: The position scaling operator linearly compresses mid-range and long-range semantic tokens into a more clustered interval, effectively reducing long-range attenuation and enhancing attention to key information in the mid-segment of the context.

[0052] Improved sample efficiency: By integrating CNN bias and Transformer self-attention, it can maintain excellent performance even in scenarios with small sample sizes and scarce hyperspectral data.

[0053] Plug-and-play: It seamlessly replaces standard rotational position encoding and self-attention modules, and is compatible with various vision and language Transformers without requiring additional computational overhead.

[0054] In one implementation, a unified attention module with accelerated reuse is used to perform high-frequency texture enhancement and global semantic enhancement on the first module vector, and accelerate attention calculation through a reuse strategy to determine the second module vector, including: Mapping the first module vector to the frequency domain, performing spectrum enhancement on the first module vector in the frequency domain using a multi-layer perceptron, and determining a spectrum enhancement feature vector; Calculate the local window attention weight and the global multi-head self-attention weight corresponding to each attention head based on the spectrum enhancement feature vector; A reuse strategy is adopted to determine a fusion feature vector according to the local window attention weight corresponding to each attention head and the global multi-head self-attention weight; The second module vector is determined according to the fused feature vector and the first module vector.

[0055] Specifically, the unified attention module with accelerated reuse (UniFormer-A attention module) integrates "spectral gating + multi-level (local + global) attention + reasoning reuse" in a single Transformer layer to simultaneously enhance local high-frequency information while taking into account global long-range dependencies, and significantly accelerates calculations through redundant reuse during the reasoning phase. , output enhanced representation, that is, the second module vector , which can seamlessly replace the standard self-attention layer.

[0056] Spectral Gate: Input vector to the first module Perform layer normalization and then map the spatial domain signal to the spectral domain through fast Fourier transform (FFT): .

[0057] In the spectral domain, a learnable spectral weighting matrix is ​​introduced , weighting each frequency component and then performing inverse fast Fourier transform (IFFT) to highlight high-frequency components such as edges and textures of the image or feature map: .

[0058] in, is element-wise multiplication. Do layer normalization again , and a channel multilayer perceptron composed of two fully connected layers (first layer upsampling, second layer downsampling with Gaussian error linear unit (GELU) activation), realize cross-channel information fusion and nonlinear transformation, and obtain spectrum enhancement feature vector : .

[0059] This step adds trainable gating to more flexibly adapt the frequency response of each layer.

[0060] Multi-level (local + global) attention: Enhanced feature vector in the spectrum Learn about query, key and value mapping: , in, is the projection matrix, Indicates the feature dimension corresponding to each block, The representation dimensions of the query, key, and value after projection are used to construct the attention mechanism. Two types of attention are then calculated in parallel: Local window attention weight Through sliding window mask Only keep the distance from the center not exceeding the radius Dependencies between tokens: .

[0061] radius is a hyperparameter and can be set to Or adaptively adjust according to the feature map size to minimize the amount of computation while retaining sufficient local context.

[0062] The global multi-head self-attention weight (MHSA) is consistent with the traditional Transformer: .

[0063] This branch captures long-range dependencies and is suitable for semantic-level full-graph or full-sentence context understanding.

[0064] In order to achieve the optimal balance between local and global information, a learnable scalar is introduced , perform element-by-element weighted fusion of the two to obtain the second attention weight : .

[0065] Automatically updated during training, different layers can dynamically focus on local or global aspects. is the intermediate fusion feature vector.

[0066] Inference acceleration reuse: During the inference phase of generation or classification, since attention outputs are highly redundant in time steps or conditional branches, this method proposes three reuse strategies to balance acceleration and accuracy: Windowed residual reuse (WA-RS): At a certain time step Calculate the "global attention output" and "local window output" at the same time, and cache the residual: .

[0067] in, represents the global attention output, is the local window output, is the residual, They are The corresponding query, key, and value.

[0068] For subsequent time steps in the same layer , only calculate , and superimpose the cached residuals to obtain the fused feature vector: , Greatly reduce expensive global self-attention computations.

[0069] Temporal Sequential Adaptation (AST): Aiming at the gradual change characteristics of attention in multi-step reasoning, when the time step and The output cosine similarity is higher than the second threshold When , directly reuse the result of the previous step: .

[0070] in, Represents the time step According to the local window attention weight and global multi-head self-attention weights The complete attention weight matrix obtained by weighted fusion, is the time step This strategy is particularly suitable for smoothly improving the overall speed in the second half of the diffusion model.

[0071] Control flow graph branch reuse (ASC, CFG branch reuse): For network scenarios where "conditional" and "unconditional" need to be calculated separately in conditional generation, if the attention output similarity between the two Exceeding the third threshold , the unconditional branch is replaced with the conditional branch result, thereby approximately maintaining the effect of the control flow graph while almost halving the amount of calculation. The conditional branch result replaces the unconditional branch as shown below: .

[0072] in, represents the attention weight of the unconditional network, represents the attention weight in the conditional network, is the intermediate fusion feature vector in the unconditional network.

[0073] Channel mixing and residual connection: the fused feature vector obtained after multiplexing Perform the final channel multi-layer perceptron transformation and combine it with the first module vector Add the residuals to form the second module vector: .

[0074] Here, the multi-layer perceptron Two layers of linear mapping and Gaussian error linear unit activation are also used to ensure sufficient interaction between channels.

[0075] Through the above four steps, the unified attention module with accelerated reuse can: Preserve and enhance local high-frequency features: Spectral gating specifically amplifies texture and edge information; Taking into account global long-range dependencies: multi-level attention captures semantics and structure in parallel; Reusing inference redundancy: The triple reuse strategy significantly reduces computational overhead without significantly losing accuracy.

[0076] Comprehensive experiments show that on benchmark vision and text classification tasks, replacing the standard Transformer self-attention with a unified attention module with accelerated reuse can accelerate inference by 20%-40% while maintaining or improving accuracy.

[0077] In one implementation, a multi-scale dynamic subspace feedforward neural network is used to perform cross-subspace high-order interaction and multi-scale local enhancement on the second module vector to determine the third module vector, including: Dynamically divide the subspace and determine the subspace corresponding to each attention head; Projecting the second module vector to each subspace and performing high-dimensional mapping to determine each high-dimensional feature vector; Performing second-order crossover and multi-scale convolution based on each of the high-dimensional feature vectors to determine each multi-scale feature vector; Performing concatenation, dimensionality reduction, and global linear mapping on the multi-scale feature vectors to determine a global feature vector; The third module vector is determined according to the second module vector and the global feature vector through a lightweight gating network.

[0078] Specifically, the multi-scale dynamic subspace feedforward neural network passes the input feature vector through a series of "dynamic subspace partitioning + cross-subspace high-order interaction + multi-scale convolution enhancement + adaptive gated residual" mechanisms, so that the feedforward network can retain global expression capabilities while taking into account local sequence dependencies and dynamically allocate computing resources according to the context. The overall process is: Assume that the second module vector is represented as , is the sequence length, is the feature dimension. The second module vector Projected into a new space with the same dimension as the original space through a learnable linear mapping, and then divided into equal parts according to the channel direction Subspaces: .

[0079] in, represents the weight matrix, represents the bias vector, is a set of subspaces, This operator not only introduces a global linear transformation, but also ensures the flexibility of subsequent subspace parallel computing through segmentation.

[0080] High-dimensional mapping: for each subspace Use independent linear mapping to expand the dimension , and obtain the high-dimensional feature vector , to improve expressive ability: .

[0081] The coefficient It can be flexibly set to 4, 6 or larger, making the subspace network deeper and wider.

[0082] Cross-subspace high-order cross fusion: All high-dimensional feature vectors Paired with adjacent pairs, half of the pairs are activated with a rectified linear unit (ReLU) and multiplied element-wise with the other half to generate second-order interaction features. : .

[0083] This crossover mechanism not only retains the distinguishable expression of subspaces, but also introduces high-order feature combinations, which helps to capture more complex semantic associations.

[0084] Multi-scale convolution enhancement: To make up for the deficiency of full connection in modeling the dependency of neighboring tags, for each second-order interaction feature Apply one-dimensional convolution with different sizes of convolution kernels to obtain multi-scale feature vectors Among them, the convolution kernel width Can be set to 3 or 5, and symmetrical padding is performed to maintain the sequence length: .

[0085] This step smoothes, filters, and enhances the local context while keeping the number of feature channels unchanged.

[0086] Dimensionality reduction splicing and global linear fusion: multi-scale feature vectors of convolution output First, map back to the original number of channels in the subspace through linear dimensionality reduction , then splice by channel and do a global linear mapping: , , .

[0087] in, is a low-dimensional feature vector, 、 is the weight matrix, 、 is the bias vector, is the concatenated feature vector of each low-dimensional feature vector, A global linear mapping is performed on the concatenated feature vector to obtain a global feature vector. This mapping combines all features after multi-subspace and multi-scale convolution, and introduces global weights again to ensure the integrity of the overall representation.

[0088] Adaptive gated residual fusion: Introducing a lightweight gated network to dynamically calculate the gating weights for each position and each channel based on the context , and balance the original input with the new features in the residual connection: , .

[0089] in, is the S-type function (Sigmoid function), is the weight matrix, is the bias vector, is layer normalization, is the third module vector. This mechanism automatically retains the original features when the importance of certain positions or channels is low, suppresses noise, and improves robustness and interpretability.

[0090] From input mapping, subspace dimension expansion, cross-subspace interaction, multi-scale convolution to adaptive residual fusion, the multi-scale dynamic subspace feedforward neural network maintains efficient computing at each step while continuously strengthening the model's balance between global representation and local modeling.

[0091] Step S300: Construct an intelligent agent through strategy to perform reinforcement learning and meta-learning on the semantic intent vector to determine the retrieval strategy.

[0092] Specifically, the strategy building agent uses reinforcement learning and meta-learning methods to build the optimal retrieval strategy based on the semantic intent vector , let the strategy space be , the goal is to maximize the utility function: , in, represents the expected value operator, Indicates that in the strategy The weighted benefits of retrieval accuracy and efficiency, is the semantic intent vector. The initialization strategy is obtained through meta-learning pre-training, and then fine-tuned online using reinforcement learning to adapt to domain changes and user personalized needs.

[0093] Step S400: Obtain knowledge graph node embedding, perform semantic enhancement on the semantic intent vector based on the knowledge graph node embedding, and determine the semantic enhancement vector.

[0094] Simply put, the ontology and knowledge graph alignment module is used to perform domain ontology and cross-language mapping on the semantic intent vector and the knowledge graph node embedding, so as to obtain the corresponding domain knowledge to semantically enhance the semantic intent vector and obtain a semantically enhanced vector.

[0095] In one implementation, semantically enhancing the semantic intent vector according to the knowledge graph node embedding to determine the semantic enhancement vector includes: Calculating the similarity between the semantic intent vector and the embedding of each knowledge graph node; When the similarity is greater than a preset threshold, domain prior information is acquired according to the knowledge graph node embedding corresponding to the similarity; The semantic intention vector is semantically enhanced according to the domain prior information to determine the semantic enhancement vector.

[0096] Specifically, if Figure 3 As shown, the semantic intent vector is aligned with the ontology and knowledge graph module Embedded with domain ontology or knowledge graph nodes Perform mapping (i.e. semantic alignment), Embed the number of knowledge graph nodes. Use cross-language or cross-domain alignment functions : , in, is the alignment parameter, is the semantic alignment vector.

[0097] Calculate the similarity between the semantic alignment vector and the embedding of each knowledge graph node, and calculate the similarity score ,in, : .

[0098] Filter similarity greater than the preset threshold (fourth threshold) When the similarity is greater than the preset threshold, the knowledge graph node corresponding to the similarity is embedded as the domain prior information, and the semantic intent vector is semantically enhanced to form a cross-language or cross-domain semantic enhancement vector. .

[0099] Step S500: Acquire the real-time system load, and determine the data channel according to the semantic enhancement vector, the retrieval strategy, and the real-time system load.

[0100] Real-time system load reflects the usage pressure and task processing status of system resources (CPU, memory, disk I / O, network, etc.). Data channels include internal vector databases and external application programming interfaces (APIs). Selecting the appropriate data channel is based on the current system's real-time system load and the system resources required for searching based on the semantic intent vector and search strategy to avoid slow search speeds caused by excessive real-time system load.

[0101] According to the retrieval strategy, semantic enhancement vector and real-time system load, dynamically decides to call the internal vector database or the external application programming interface. Set the channel selection function : , in, The data channel includes internal data channel and external data channel. The internal data channel is the internal vector database, etc., and the external data channel is the external application programming interface. For channel Current throughput and latency metrics (real-time system load), is the utility function of comprehensive matching degree and cost.

[0102] In one implementation, the data channel includes a pre-built vector database, and a method for building the vector database includes: Acquiring multimodal data, preprocessing and segmenting the multimodal data, and determining data for each slice; Performing feature extraction on each slice data through quantum feature mapping and graph convolution to determine each graph convolution feature vector; Performing high-frequency texture enhancement and global semantic enhancement on each of the graph convolution feature vectors through the unified attention module with accelerated multiplexing to determine each enhanced feature vector; Each of the enhanced feature vectors is stored in a database to determine the vector database.

[0103] Specifically, such as Figure 4 As shown in the figure, the document preprocessing and segmentation module receives documents in multiple formats (PDF, DOCX, HTML, etc.) as multimodal data, and preprocesses and segments the multimodal data according to preset parameters to form a set of sliced ​​data required for subsequent processing. It mainly includes the following units: Input module: accepts documents in multiple formats such as PDF, DOCX, HTML, etc. Parameter setting unit: set slice length , overlap rate , associated window and semantic boundary parameters; Adaptive segmentation engine: calls the adaptive segmentation algorithm, adjusts the segmentation strategy according to the preset parameters, and generates a set of sliced ​​data The module process can be expressed by the following formula: Assume that the total length of documents in multimodal data is , then when setting the slice length and overlap rate The number of slices obtained by cutting It can be expressed as: , Among them, each slice data satisfy: , in, This formula ensures that there is a reasonable overlap between slices, thus guaranteeing the continuity of semantic boundaries.

[0104] like Figure 5As shown in the figure, the semantic extraction and modeling module uses quantum feature mapping and graph convolution to preliminarily extract the implicit semantics in the slice data, and inputs the obtained graph convolution features into an enhanced Transformer based on a unified attention module with accelerated reuse to further capture the fine-grained and global correlations inside and outside the slice data. Specifically, for a length of A collection of slice data (lexical sequence) , embed it as input word embedding , and construct a normalized adjacency matrix in the graph convolution layer : .

[0105] in, . Introducing quantum eigenmapping function , embed the input word Mapping to quantum states, and then reducing high-dimensional quantum information to features through measurement operators .

[0106] Under graph theory optimization, Perform multi-layer graph convolution: , in, is the degree matrix, For the Layer trainable weights, is the activation function, is the number of graph convolution layers, For the The graph convolution feature vector of the layer, For the The graph convolution feature vector of the layer is obtained. Finally, the graph convolution feature vector is obtained. .

[0107] Next, the graph convolution feature vector The unified attention module with accelerated reuse is sent to complete the parallel calculation of spectrum gating, local window attention and global multi-head self-attention in turn, and the dual sensitivity to high-frequency texture and long-range dependency is improved through adaptive weighted fusion. Perform layer normalization and fast Fourier mapping to the spectral domain: , in, is a learnable spectral weighting matrix, Represents element-wise multiplication. The spectrum enhancement feature vector is then processed by a channel multilayer perceptron: .

[0108] On this basis, multi-level attention calculation is performed to obtain the query ,key ,value : .

[0109] are weight matrices respectively. The local window attention weight uses a sliding window mask Only keep distance less than radius Dependencies between tokens: .

[0110] The global attention branch maintains the standard multi-head self-attention form: .

[0111] Using learnable scalars Weighted fusion of the two: .

[0112] The final output is channel mixed and residual connected as the enhanced feature vector : .

[0113] Finally, after stacking several layers of unified attention modules with accelerated reuse, the enhanced feature vector output by the top layer is taken. The attention pooling vector or classification (CLS) tag vector of the document fragment is obtained This representation combines the implicit semantics captured by quantum graph convolution, the high-frequency features amplified by spectral gating, and the global association of multi-level attention integration, and can be directly input into the vectorization and storage modules for downstream retrieval indexing.

[0114] like Figure 6 As shown in the figure, the high-dimensional vectors generated by the semantic extraction and modeling module are encrypted, synchronized in real time, and integrity verified through the vectorization and storage module before being stored in the vector database to ensure data security and efficient retrieval. The main steps include: Vector database access layer: High-dimensional vectors are encrypted, synchronized in real time, and stored after security verification to ensure data integrity. This can be expressed as follows: For high-dimensional vectors Perform encryption processing, and set the encryption function to be : , Using hash functions Perform integrity check on the encrypted vector: , When data is stored in the vector database, it is saved at the same time and checksum .

[0115] In one implementation, an adaptive position scaling mechanism of a multi-scale dynamic subspace feedforward neural network can be introduced in the process of calculating the enhanced feature vector: the position score is calculated for each attention head. , and mapped to a scaling factor , encode the relative position Replace with Then participate in the attention scoring, thereby dynamically enhancing the sensitivity of mid- and long-range position information across slices.

[0116] Step S600: calling the data channel, searching the semantic enhancement vector according to the search strategy, and determining candidate documents.

[0117] Specifically, the selected data channel is called and the semantic enhancement vector or semantic alignment vector is queried according to the retrieval strategy. Execute an approximate nearest neighbor (ANN) or cross-lingual retrieval algorithm to aggregate all candidate documents , and sorted by matching degree. For vector retrieval, a multi-layer hierarchical index structure is usually used, such as Hierarchical Navigable Small World Network (HNSW) or Inverted File Index (IVF): , in, , For document embedding, is the fifth threshold. The candidate documents and their retrieval scores are fed back to the "Answer Generation and Feedback Module" for comprehensive answer generation.

[0118] Step S700: Generate a target answer based on each of the candidate documents based on an adaptive reflection feedback mechanism combined with an autoencoder and a generative adversarial network.

[0119] Specifically, such as Figure 7 As shown in the figure, a preliminary answer is generated based on the retrieval results and the large language model, and an adaptive reflection feedback mechanism (combining variational autoencoders and generative adversarial networks) is used to perform multiple rounds of iterative corrections until the final answer meets the global accuracy requirements. This module mainly includes the following steps: Preliminary answer generation unit: Integrates the retrieval data with the candidate documents output by the large language model to generate preliminary answers.

[0120] Adaptive reflective feedback mechanism: The preliminary answer is encoded using a variational autoencoder (VAE), corrected using a generative adversarial network (GAN), and multiple rounds of iterative feedback loops are used to perform error correction and semantic consistency verification until the global accuracy standard is achieved; Final answer confirmation unit: Outputs the target answer confirmed after reflection and feedback. It can be expressed as follows: The sorted candidate document set retrieved in the previous step Input a large language model and use its generative capabilities to generate a preliminary answer that is semantically complete and initially meets the user's query intent. : .

[0121] , Generative functions for large language models such as mT5 (multilingual text-to-text Transformer model), multilingual BERT, etc.

[0122] Objective function of VAE for: , For the current answer (such as or intermediate version), is a latent semantic variable, is the encoder network that learns to extract latent variables from the answer, is the decoder network, generating answers from latent variables, The Kullback–Leibler divergence measures the variance in generated semantics. This objective function is used to semantically compress and reconstruct the answer, allowing the model to automatically correct potential biases or generation errors while maintaining semantic consistency.

[0123] The adversarial goal of the Generative Adversarial Network (GAN) is: , As the generator, with latent semantic variables Generate the corrected answer, is the discriminator, which determines whether the input is a real (retrieval + LLM generation) answer, is the true distribution of answers (i.e., real user Q&A samples or high-quality generated data), is the prior distribution of the latent space, Represents the true distribution of the answers expectations, Represents the prior distribution of the latent space (or the expectation of the noise distribution).

[0124] Through the generator Correct the preliminary answer, the discriminator Evaluate the output quality. The GAN module further improves the naturalness and plausibility of the answer. The generator attempts to "correct" the answer to make it more credible, while the discriminator guides its optimization direction.

[0125] Define the iterative update function , combining the variational autoencoder, the generative adversarial network output and the previous answer, performs correction so that the answer is updated in each iteration: , When satisfied When , the iteration is terminated and the target answer is output .

[0126] in, For the The answer generated by the iteration, The sixth threshold for terminating the iteration.

[0127] In one implementation, Figure 8 As shown, the method also includes a dynamic knowledge migration and update module, which realizes real-time monitoring, screening and automatic update of new data and cross-modal information flows, and ensures that the system has the ability of continuous learning and optimization. It mainly includes: continuous monitoring unit: real-time monitoring of network data updates and cross-modal information flows (such as videos, images, text, etc.). High-credibility information screening module: uses trust evaluation algorithms to extract and verify information from new data. Knowledge graph automatic update unit: automatically integrates new semantic information into the knowledge graph and synchronizes the vector database in real time. This module can be expressed by the following formula: Define the trust evaluation function , for new data Calculate the trust score: , New data for candidates (such as user new question feedback, image segment annotations, text extracted from videos, etc.), It is a trust evaluation function, which is constructed based on indicators such as credibility, semantic consistency score, and expert rule matching. For data The trust score of , the data is considered to have high credibility, is the trust threshold (the seventh threshold).

[0128] For a new information set that meets the conditions , the updated knowledge graph is expressed as: , is the original knowledge graph, is the entity-relationship triple extracted from the data, , are knowledge graph node embeddings, for , The entity relationship between This is the updated knowledge graph.

[0129] When the trust score of a new data Exceeding the threshold When a word is found, its corresponding semantic triple will be integrated into the graph to achieve real-time updating of knowledge.

[0130] In one implementation, Figure 9 As shown, the method also includes a final output and feedback display module, which is responsible for presenting the target answer after multiple rounds of feedback correction to the user and recording the interaction log and system performance indicators to provide data support for subsequent system optimization. The main functions include: Output display unit: present the target answer Presented to users in a friendly interface; User feedback collection module: records interaction logs for subsequent system optimization; System performance monitoring and reporting module: monitors system operation indicators in real time and provides performance reports.

[0131] Based on the above embodiments, the present invention also provides a retrieval generation system based on multi-agent collaboration, such as Figure 10 As shown, the system includes: Query instruction preprocessing module 01 is used to preprocess the natural language query instruction input by the user and determine the input word embedding; Semantic analysis module 02, configured to perform semantic analysis based on the input word embedding through a query analysis agent to determine a semantic intent vector; A retrieval strategy determination module 03 is configured to perform reinforcement learning and meta-learning on the semantic intent vector through a strategy building agent to determine a retrieval strategy; Semantic enhancement module 04, used to obtain knowledge graph node embedding, perform semantic enhancement on the semantic intent vector according to the knowledge graph node embedding, and determine the semantic enhancement vector; A data channel determination module 05 is configured to obtain a real-time system load and determine a data channel according to the semantic enhancement vector, the retrieval strategy, and the real-time system load; Retrieval module 06, used to call the data channel, search the semantic enhancement vector according to the retrieval strategy, and determine candidate documents; The target answer generation module 07 is used to generate a target answer according to each of the candidate documents based on an adaptive reflection feedback mechanism combined with an autoencoder and a generative adversarial network.

[0132] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be shown as follows: Figure 11 As shown. The terminal includes a processor, a memory, a network interface, and a display screen connected via a system bus. The processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a retrieval generation method based on multi-agent collaboration is implemented. The display screen of the terminal can be a liquid crystal display or an electronic ink display.

[0133] Those skilled in the art will understand that Figure 11 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0134] In one implementation, the terminal stores one or more programs in its memory, and is configured to be executed by one or more processors, wherein the one or more programs include instructions for performing a retrieval generation method based on multi-agent collaboration.

[0135] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware using a computer program. 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 above-described method embodiments. Any reference to memory, storage, database, or other media used in the various embodiments provided herein may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may 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), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0136] In summary, the present invention discloses a retrieval generation method, system, terminal and medium based on multi-agent collaboration, wherein a query analysis agent performs semantic analysis on the input word embedding converted from a natural language query instruction to determine a semantic intent vector; a strategy construction agent performs reinforcement learning and meta-learning on the semantic intent vector to determine a retrieval strategy; semantic enhancement is performed on the semantic intent vector based on the knowledge graph node embedding to obtain a semantic enhancement vector; a data channel is determined based on the semantic enhancement vector, the retrieval strategy and the real-time system load, and the data channel is called to retrieve each candidate document; a target answer is generated based on each candidate document based on an adaptive reflective feedback mechanism combined with an autoencoder and a generative adversarial network. This method effectively solves the problem that the existing technology relies on a fixed retrieval strategy, has limitations when facing complex queries, multi-round interactions and cross-modal data fusion, is easily affected by noise interference and has inaccurate semantic matching.

[0137] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A retrieval generation method based on multi-agent collaboration, characterized in that: The method comprises: Preprocess the natural language query instructions entered by the user to determine the input word embedding; Performing semantic analysis based on the input word embedding by a query analysis agent to determine a semantic intent vector; Performing reinforcement learning and meta-learning on the semantic intent vector through a strategy-building intelligent agent to determine a retrieval strategy; Obtaining knowledge graph node embedding, performing semantic enhancement on the semantic intent vector according to the knowledge graph node embedding, and determining the semantic enhancement vector; Acquire a real-time system load, and determine a data channel according to the semantic enhancement vector, the retrieval strategy, and the real-time system load; Calling the data channel, searching the semantic enhancement vector according to the retrieval strategy, and determining candidate documents; Based on the adaptive reflection feedback mechanism combined with the autoencoder and the generative adversarial network, the target answer is generated according to each of the candidate documents.

2. The retrieval generation method based on multi-agent collaboration according to claim 1 is characterized in that: The query analysis agent is implemented based on an improved Transformer encoder, which includes several layers, each of which includes: an adaptive multi-scale content encoding module for dynamically adjusting weights of content information and position information in an input feature vector to determine a first module vector, wherein the input feature vector is one of the input word embedding or a third module vector; A unified attention module with accelerated reuse, which is used to perform high-frequency texture enhancement and global semantic enhancement on the first module vector, and accelerate attention calculation through a reuse strategy to determine the second module vector; A multi-scale dynamic subspace feedforward neural network is used to perform cross-subspace high-order interaction and multi-scale local enhancement on the second module vector to determine the third module vector.

3. The retrieval generation method based on multi-agent collaboration according to claim 2 is characterized in that: The adaptive multi-scale content encoding module is used to dynamically adjust the weights of content information and position information in the input feature vector to determine the first module vector, including: Adaptively weighting the standard content attention and relative position attention of each attention head based on the input feature vector through an adaptive content and position balancing operator, and determining a first attention weight corresponding to each attention head according to the weighted standard content attention and the weighted relative position attention; Obtain the historical attention weights of each attention head, and calculate the scaling factor corresponding to each attention head according to each of the historical attention weights through the multi-scale position scaling operator within the head; The first module vector is determined according to the value of the input feature vector, each of the first attention weights, and each of the scaling factors.

4. The retrieval generation method based on multi-agent collaboration according to claim 2 is characterized in that: A unified attention module with accelerated reuse is used to perform high-frequency texture enhancement and global semantic enhancement on the first module vector, and accelerate attention calculation through a reuse strategy to determine the second module vector, including: Mapping the first module vector to the frequency domain, performing spectrum enhancement on the first module vector in the frequency domain using a multi-layer perceptron, and determining a spectrum enhancement feature vector; Calculate the local window attention weight and the global multi-head self-attention weight corresponding to each attention head based on the spectrum enhancement feature vector; A reuse strategy is adopted to determine a fusion feature vector according to the local window attention weight corresponding to each attention head and the global multi-head self-attention weight; The second module vector is determined according to the fused feature vector and the first module vector.

5. The retrieval generation method based on multi-agent collaboration according to claim 2 is characterized in that: A multi-scale dynamic subspace feedforward neural network is used to perform cross-subspace high-order interaction and multi-scale local enhancement on the second module vector to determine the third module vector, including: Dynamically divide the subspace and determine the subspace corresponding to each attention head; Projecting the second module vector to each of the subspaces and performing high-dimensional mapping to determine each high-dimensional feature vector; Performing second-order crossover and multi-scale convolution based on each of the high-dimensional feature vectors to determine each multi-scale feature vector; Performing concatenation, dimensionality reduction, and global linear mapping on the multi-scale feature vectors to determine a global feature vector; The third module vector is determined according to the second module vector and the global feature vector through a lightweight gating network.

6. The retrieval generation method based on multi-agent collaboration according to claim 1 is characterized in that: Performing semantic enhancement on the semantic intent vector according to the knowledge graph node embedding to determine the semantic enhancement vector includes: Calculating the similarity between the semantic intent vector and the embedding of each knowledge graph node; When the similarity is greater than a preset threshold, domain prior information is acquired according to the knowledge graph node embedding corresponding to the similarity; The semantic intention vector is semantically enhanced according to the domain prior information to determine the semantic enhancement vector.

7. The retrieval generation method based on multi-agent collaboration according to claim 2 is characterized in that: The data channel includes a pre-built vector database, and the method for building the vector database includes: Acquiring multimodal data, preprocessing and segmenting the multimodal data, and determining data for each slice; Performing feature extraction on each slice data through quantum feature mapping and graph convolution to determine each graph convolution feature vector; Performing high-frequency texture enhancement and global semantic enhancement on each of the graph convolution feature vectors through the unified attention module with accelerated multiplexing to determine each enhanced feature vector; Each of the enhanced feature vectors is stored in a database to determine the vector database.

8. A retrieval generation system based on multi-agent collaboration, characterized in that: The system comprises: The query instruction preprocessing module is used to preprocess the natural language query instructions input by the user and determine the input word embedding; A semantic analysis module, configured to perform semantic analysis based on the input word embeddings through a query analysis agent to determine a semantic intent vector; A retrieval strategy determination module is used to perform reinforcement learning and meta-learning on the semantic intent vector through a strategy construction agent to determine a retrieval strategy; A semantic enhancement module is used to obtain knowledge graph node embeddings, perform semantic enhancement on the semantic intent vector according to the knowledge graph node embeddings, and determine the semantic enhancement vector; a data channel determination module, configured to obtain a real-time system load and determine a data channel according to the semantic enhancement vector, the retrieval strategy, and the real-time system load; A retrieval module, configured to call the data channel, search the semantic enhancement vector according to the retrieval strategy, and determine candidate documents; The target answer generation module is used to generate a target answer based on each of the candidate documents based on an adaptive reflection feedback mechanism combined with an autoencoder and a generative adversarial network.

9. A terminal, characterized in that: The terminal includes a memory and one or more processors; the memory stores one or more programs; the program contains instructions for executing the retrieval generation method based on multi-agent collaboration as described in any one of claims 1-7; and the processor is used to execute the program.

10. A computer-readable storage medium having a plurality of instructions stored thereon, characterized in that: The instructions are loaded and executed by the processor to implement the steps of the retrieval generation method based on multi-agent collaboration as described in any one of claims 1-7 above.

Citation Information

Patent Citations

  • Document retrieval method based on multistage index and feature clustering

    CN120492611A

  • Method and apparatus

    EP4416678A1

  • Multi-modal feedback integration type knowledge-search enhanced robot control system

    JP2025108598A

Cited By

  • Multi-agent interaction TOKEN compression strategy method and system based on LLMLINGUA

    CN120930657A

  • Reliability scheme generation method fusing knowledge graph and large model

    CN120951808A

  • Reliability scheme generation method fusing knowledge graph and large model

    CN120951808B

  • General text intelligent retrieval method and system based on rule analysis

    CN121210649A

  • Big model training-oriented double-agent collaborative code synthesis data generation method

    CN121597181A