Multi-agent cooperation method, system and device based on shared memory data and medium
By employing a multi-agent collaborative method that shares memory data and utilizes a semantic signature similarity calculation mechanism, the problem of repetitive reasoning and cache not being shared across nodes in traditional systems is solved, achieving efficient resource utilization and response optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG INSPUR SCI RES INST CO LTD
- Filing Date
- 2025-11-28
- Publication Date
- 2026-04-17
AI Technical Summary
Traditional inference systems cannot recognize semantic similarities between different agents, leading to redundant inference calculations and wasted resources. Furthermore, cached results cannot be shared across nodes, and the problem is even more severe when deployed in a multi-node environment.
By introducing a multi-agent collaboration method with shared memory data, and utilizing a semantic signature similarity calculation mechanism to identify the correlation between requests, a unique semantic signature is generated, and the caching strategy is dynamically adjusted to achieve cross-node cache sharing and resource optimization.
It accurately identifies the semantic relationships between requests from intelligent agents, avoids redundant reasoning calculations, reduces computing resource consumption, improves system response efficiency, and enables intelligent matching of cached resources to improve overall utilization.
Smart Images

Figure CN121882153A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of multi-agent cooperation technology, and in particular to a multi-agent cooperation method, system, device and medium based on shared memory data. Background Technology
[0002] Against the backdrop of the rapid development of artificial intelligence, model reasoning tasks are gradually evolving from a single request-response model to a complex system of multi-agent collaborative decision-making and distributed reasoning. With the widespread application of Large Language Models (LLM) and multimodal models, the number of reasoning requests is exploding, and interactions between different agents are frequent and semantically overlapping.
[0003] Traditional inference systems typically employ static caching or key-value-based result reuse. However, these methods fail to recognize semantic similarities between requests or understand the contextual relationships within the agent's tasks, leading to extensive repetitive inference computations, significant waste of system resources, and high response latency. Furthermore, agent systems are often deployed across multiple nodes. In multi-node deployments, cached results cannot be shared across nodes, further exacerbating resource waste. Summary of the Invention
[0004] This application provides a multi-agent collaboration method, system, device, and medium based on shared memory data to solve the problems that traditional inference systems cannot recognize the semantic similarity between requests, nor can they perceive the contextual relationship of agent tasks, resulting in a large amount of repetitive inference calculations, and agent systems are often deployed on multiple nodes, with cached results unable to be shared across nodes.
[0005] Firstly, this application provides a multi-agent cooperation method based on shared memory data, the method comprising: The system receives inference requests from different agents through the agent request access layer; identifies the request semantic features, inference model, and semantic feature processing order corresponding to the inference request; vectorizes the inference request to generate a unique semantic signature; and calculates the similarity between the semantic signature and the processed semantic signatures of all agents. When no processed semantic signature with a similarity greater than a preset threshold exists, context information is extracted from the preset context cache layer. Based on the context information, request semantic features, inference model, and semantic feature processing order, the corresponding inference path and each path node corresponding to the inference model are determined, and the output result and intermediate results generated by each path node are obtained. The semantic signature and output result are cached in the preset result cache layer. The intermediate results generated by each path node are cached as context information in the preset context cache layer. When a processed semantic signature with a similarity greater than a preset threshold exists, the corresponding cached output result in the preset result cache layer is reused as the inference result corresponding to the current semantic signature. Based on a preset time window, the inference frequency of different semantic signatures generated by all agents is detected, and the storage time of the output results corresponding to the semantic signatures in the preset result cache layer is adjusted according to the inference frequency.
[0006] In one implementation of this application, identifying the request semantic features, inference model, and semantic feature processing order corresponding to the inference request specifically includes: The semantic parsing engine divides the inference request content into logical segments according to semantic boundaries, and each logical segment represents a complete semantic unit; Logical fragments are converted into embedded representations using vectorization techniques to obtain request semantic features; attention mechanisms are then used to analyze the semantic dependencies between request semantic features. Calculate the inference model corresponding to each request semantic feature based on the distance between the request semantic features and the descriptive features of the inference model; The pre-defined orchestration engine constructs a directed acyclic graph based on the semantic dependencies between semantic features, and determines the execution sequence corresponding to the semantic features in the directed acyclic graph through topological sorting, which serves as the request semantic processing order.
[0007] In one implementation of this application, the inference request is vectorized to generate a unique semantic signature; the semantic signature is then compared with the processed semantic signatures of all agents to calculate similarity, specifically including: Convert the inference request into an inference vector; Generate the hash value corresponding to the inference vector as a semantic signature; The similarity is determined by calculating the difference between the binary strings of the semantic signature and the processed semantic signature.
[0008] In one implementation of this application, when no processed semantic signature with a similarity greater than a preset threshold exists, context information is extracted from a preset context cache layer, specifically including: Retrieve the historical semantic signatures of the agent corresponding to the current semantic signature; Calculate the difference between the binary number strings of the current semantic signature and the historical semantic signature. When the minimum difference is less than or equal to the preset difference threshold, determine the context information corresponding to the historical semantic signature with the minimum difference in the preset context cache layer as the context information of the current semantic signature. If no historical semantic signature exists or the minimum difference is greater than the preset difference threshold, it is determined that the current semantic signature does not have context information in the preset context cache layer, and an empty value is returned.
[0009] In one implementation of this application, based on contextual information, request semantic features, inference model, and semantic feature processing order, the corresponding inference path and each path node corresponding to the inference model are determined, and the output result and intermediate results generated by each path node are obtained, specifically including: Based on the semantic features of each request in the semantic feature processing order and the inference model corresponding to the semantic features of the request, determine the inference path and each path node; The first requested semantic feature in the context information and semantic feature processing order is input into the corresponding inference model to obtain the first intermediate result. The next request semantic feature in the intermediate result and semantic feature processing sequence is input into the corresponding inference model to obtain the next intermediate result; this continues until the final output result is obtained.
[0010] In one implementation of this application, after caching the semantic signature and output results to a preset result cache layer, and caching the intermediate results generated by each path node as context information to a preset context cache layer, the method further includes: Retrieve all inference requests received within the historical time period; Cluster all reasoning requests to obtain a set of reasoning requests in a preset category; Determine the percentage of processed semantic signatures in each inference request set whose similarity exceeds a preset threshold. When there is a set of inference requests with a proportion greater than the preset proportion threshold, the lightweight distillation process is initiated. Use the inference requests, intermediate results, and output results corresponding to the inference request set as training data to train a preset low-complexity sub-model and obtain the trained preset low-complexity sub-model. Replace all subsequent inference models corresponding to the semantic feature processing order of the inference requests under the current inference request set with pre-trained preset low-complexity sub-models.
[0011] Secondly, this application provides a multi-agent cooperative system based on shared memory data, the system comprising: The similarity calculation module is used to receive reasoning requests from different agents through the agent request access layer; identify the request semantic features, reasoning model and semantic feature processing order corresponding to the reasoning request; vectorize the reasoning request to generate a unique semantic signature; and calculate the similarity between the semantic signature and the processed semantic signatures of all agents. The result acquisition module is used to extract context information from a preset context cache layer when there is no processed semantic signature with a similarity greater than a preset threshold; determine the corresponding inference path and the path nodes corresponding to the inference model based on the context information, request semantic features, inference model, and semantic feature processing order, and obtain the output result and the intermediate results generated by each path node; cache the semantic signature and output result to a preset result cache layer; cache the intermediate results generated by each path node as context information to a preset context cache layer; when there is a processed semantic signature with a similarity greater than a preset threshold, reuse the corresponding cached output result in the preset result cache layer as the inference result corresponding to the current semantic signature; The cache processing module is used to detect the inference frequency of different semantic signatures generated by all agents according to a preset time window, and adjust the storage time of the output result corresponding to the semantic signature in the preset result cache layer according to the inference frequency.
[0012] In one implementation of this application, the result acquisition module includes a sequential acquisition unit. This is used to divide the content of the reasoning request into logical segments according to semantic boundaries using a semantic parsing engine. Each logical segment represents a complete semantic unit. Logical fragments are converted into embedded representations using vectorization techniques to obtain request semantic features; attention mechanisms are then used to analyze the semantic dependencies between request semantic features. Calculate the inference model corresponding to each request semantic feature based on the distance between the request semantic features and the descriptive features of the inference model; The pre-defined orchestration engine constructs a directed acyclic graph based on the semantic dependencies between semantic features, and determines the execution sequence corresponding to the semantic features in the directed acyclic graph through topological sorting, which serves as the request semantic processing order.
[0013] Thirdly, this application provides a multi-agent cooperative device based on shared memory data, the device comprising: processor; And a memory containing executable code, which, when executed, causes the processor to perform a multi-agent cooperative method based on shared memory data, as described above.
[0014] Fourthly, this application provides a non-volatile computer storage medium storing computer instructions thereon, which, when executed, implement a multi-agent cooperative method based on shared memory data as described above.
[0015] As can be seen from the above technical solutions, this application has the following advantages: By receiving inference requests from different agents through the agent request access layer and introducing a semantic signature similarity calculation mechanism, the system can accurately identify the semantic relationships between requests from different agents. When a processed signature with a similarity exceeding a preset threshold is detected, pre-stored outputs can be directly retrieved from the result cache layer, avoiding repeated inference for the same semantic features. This design fundamentally eliminates the redundant computation problem caused by the inability to perceive semantic similarity in traditional systems. Especially in high-frequency, multi-node agent collaboration scenarios, it can significantly reduce computational resource consumption and improve the overall system response efficiency.
[0016] Based on the intelligent agent request access layer receiving inference requests from different intelligent agents, semantic signatures and output results are cached in a preset result cache layer; intermediate results generated by each path node are cached as context information in a preset context cache layer, which solves the problem that intelligent agent systems are often deployed on multiple nodes and cached results cannot be shared across nodes.
[0017] By continuously monitoring the inference frequency of different semantic signatures within a preset time window, the storage time of the result caching layer is dynamically adjusted accordingly. Outputs from high-frequency inference requests will receive longer cache retention periods, while caches for low-frequency requests may be released earlier. This on-demand allocation of cache resources ensures rapid response to frequently accessed data while preventing cache space from being occupied by low-frequency data for extended periods. This achieves intelligent matching of storage resources with business load, improving the overall utilization of the caching system. Attached Figure Description To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a multi-agent collaboration method based on shared memory data provided in an embodiment of this application.
[0019] Figure 2 This is a schematic diagram of the internal structure of a multi-agent cooperative system based on shared memory data, provided in an embodiment of this application.
[0020] Figure 3 This is a schematic diagram of the internal structure of a multi-agent collaborative device based on shared memory data, provided in an embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0022] Those skilled in the art should understand that the embodiments described below are merely preferred embodiments of this disclosure and do not imply that this disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely used to explain the technical principles of this disclosure and are not intended to limit the scope of protection of this disclosure. Based on the preferred embodiments provided by this disclosure, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of this disclosure.
[0023] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0024] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0025] The embodiment provides a multi-agent cooperation method based on shared memory data, such as Figure 1 As shown in the embodiments of this application, the method mainly includes the following steps: Step 110: Receive reasoning requests from different agents through the agent request access layer; identify the request semantic features, reasoning model, and semantic feature processing order corresponding to the reasoning request; vectorize the reasoning request to generate a unique semantic signature; calculate the similarity between the semantic signature and the processed semantic signatures of all agents.
[0026] It should be noted that "unique" refers to the reasoning request generating a semantic signature.
[0027] Specifically, identifying the request semantic features, inference model, and semantic feature processing order corresponding to the inference request includes: The semantic parsing engine divides the inference request content into logical segments according to semantic boundaries, and each logical segment represents a complete semantic unit; Logical fragments are converted into embedded representations using vectorization techniques to obtain request semantic features; attention mechanisms are then used to analyze the semantic dependencies between request semantic features. Calculate the inference model corresponding to each request semantic feature based on the distance between the request semantic features and the descriptive features of the inference model; The pre-defined orchestration engine constructs a directed acyclic graph based on the semantic dependencies between semantic features, and determines the execution sequence corresponding to the semantic features in the directed acyclic graph through topological sorting, which serves as the request semantic processing order.
[0028] It should be further explained that the semantic parsing engine employs a dual segmentation strategy based on syntactic trees and semantic role labeling. First, it determines the core subject-verb-object structure through dependency parsing, and then divides the logical segments by combining semantic role labeling (such as agent, patient, time, and location). Each logical segment generates a 768-dimensional embedding vector using a BERT pre-trained model, serving as the basic representation of the requested semantic features. The attention mechanism uses a multi-head self-attention structure, dynamically adjusting the strength of semantic dependencies by calculating the cosine similarity weights between segments to ensure accurate capture of complex semantic associations.
[0029] Furthermore, the inference model's descriptive features are vectorized by extracting the input and output interfaces of the pre-trained model, forming fixed-dimensional feature vectors. The distance between the requested semantic features and the inference model's features is calculated using a weighted combination of Euclidean distance and cosine similarity. Euclidean distance reflects the distance in the feature space, while cosine similarity characterizes the semantic alignment. By setting dynamic weight thresholds, a balance is achieved between model interface compatibility (Euclidean distance) and semantic fit (cosine similarity), avoiding mismatches caused by a single metric.
[0030] In this system, the pre-defined orchestration engine constructs a directed acyclic graph (DAG) by using semantic dependencies as edges and semantic features as nodes. Topological sorting employs a hybrid strategy of depth-first search (DFS) and breadth-first search (BFS), prioritizing nodes with strong dependencies (such as causal or temporal relationships) while dynamically adjusting the execution order of nodes with weak dependencies (such as parallel relationships) using a priority queue. For segments with circular dependencies, the system automatically triggers a conflict detection mechanism, eliminating the loop through semantic rewriting or logical splitting to ensure the legality and efficiency of the execution sequence.
[0031] In some embodiments, the inference request is vectorized to generate a unique semantic signature; the semantic signature is then compared with the processed semantic signatures of all agents to calculate similarity, specifically including: Convert the inference request into an inference vector; Generate the hash value corresponding to the inference vector as a semantic signature; The similarity is determined by calculating the difference between the binary strings of the semantic signature and the processed semantic signature.
[0032] It should be noted that when converting the inference vector to a hash value, the MurmurHash3 algorithm is used to generate a 128-bit hash value, and multi-dimensional semantic representation is achieved by setting different hash seeds. Similarity calculation is based on Hamming distance (the difference in the number of bits between binary strings), and similarity is divided into three levels—high similarity (Hamming distance ≤ 3), medium similarity (4 ≤ Hamming distance ≤ 6), and low similarity (Hamming distance ≥ 7)—using predefined thresholds. High-similarity requests directly trigger the cache hit mechanism, medium-similarity requests enter contextual analysis, and low-similarity requests initiate a completely new inference process, achieving precise control over request tiering. Step 120: When there is no processed semantic signature with a similarity greater than a preset threshold, extract context information from the preset context cache layer; determine the corresponding inference path and the path nodes corresponding to the inference model based on the context information, request semantic features, inference model, and semantic feature processing order, and obtain the output result and the intermediate results generated by each path node; cache the semantic signature and output result to the preset result cache layer; cache the intermediate results generated by each path node as context information to the preset context cache layer; when there is a processed semantic signature with a similarity greater than a preset threshold, reuse the corresponding cached output result in the preset result cache layer as the inference result corresponding to the current semantic signature.
[0033] Specifically, when there is no processed semantic signature with a similarity greater than a preset threshold, context information is extracted from a preset context cache layer, including: Retrieve the historical semantic signatures of the agent corresponding to the current semantic signature; Calculate the difference between the binary number strings of the current semantic signature and the historical semantic signature. When the minimum difference is less than or equal to the preset difference threshold, determine the context information corresponding to the historical semantic signature with the minimum difference in the preset context cache layer as the context information of the current semantic signature. If no historical semantic signature exists or the minimum difference is greater than the preset difference threshold, it is determined that the current semantic signature does not have context information in the preset context cache layer, and an empty value is returned.
[0034] It should be further explained that when no processed semantic signature with a similarity greater than a preset threshold exists, the system first obtains the list of historical semantic signatures of the agent corresponding to the current semantic signature. By calculating the difference between the binary strings of the current semantic signature and each historical semantic signature (using the Hamming distance algorithm), the historical semantic signature with the smallest difference is selected as a candidate. If the minimum difference is lower than a preset difference threshold (e.g., ≤3), the context information (including intermediate results, path node states, etc.) corresponding to that candidate historical semantic signature is used as the context information of the current semantic signature; if no historical semantic signature exists or the minimum difference exceeds the threshold, a null value is returned. This design ensures accurate matching of context information and avoids inference errors caused by semantic drift.
[0035] Specifically, based on contextual information, request semantic features, inference model, and the order of semantic feature processing, the corresponding inference path and the corresponding path nodes of the inference model are determined, and the output results and intermediate results generated by each path node are obtained, including: Based on the semantic features of each request in the semantic feature processing order and the inference model corresponding to the semantic features of the request, determine the inference path and each path node; The first requested semantic feature in the context information and semantic feature processing order is input into the corresponding inference model to obtain the first intermediate result. The next request semantic feature in the intermediate result and semantic feature processing sequence is input into the corresponding inference model to obtain the next intermediate result; this continues until the final output result is obtained.
[0036] It should be further explained that, based on contextual information, request semantic features, inference models, and the order of semantic feature processing, the system dynamically constructs inference paths through a preset orchestration engine. Specifically, each request semantic feature in the semantic feature processing order and its corresponding inference model are used as path nodes, forming a directed acyclic graph. During execution, the contextual information and the first request semantic feature are input into its corresponding inference model to obtain the first intermediate result; subsequently, this intermediate result and the next request semantic feature are input into the corresponding inference model, iterating until the final output result is obtained. This process, through the dynamic injection of contextual information, enables adaptive adjustment of the inference path, ensuring the coherence of the processing logic.
[0037] The method further includes, after caching the semantic signature and output results to a preset result cache layer and caching the intermediate results generated by each path node as context information to a preset context cache layer: Retrieve all inference requests received within the historical time period; Cluster all reasoning requests to obtain a set of reasoning requests in a preset category; Determine the percentage of processed semantic signatures in each inference request set whose similarity exceeds a preset threshold. When there is a set of inference requests with a proportion greater than the preset proportion threshold, the lightweight distillation process is initiated. Use the inference requests, intermediate results, and output results corresponding to the inference request set as training data to train a preset low-complexity sub-model and obtain the trained preset low-complexity sub-model. Replace all subsequent inference models corresponding to the semantic feature processing order of the inference requests under the current inference request set with pre-trained preset low-complexity sub-models.
[0038] It should be further explained that after caching semantic signatures and output results in a preset result cache layer, and caching intermediate results generated by each path node as context information in a preset context cache layer, the system implements a hierarchical management strategy. The result cache layer uses the LRU (Least Recently Used) algorithm to dynamically adjust storage priority based on the access frequency of semantic signatures; the context cache layer uses a semantic relevance index to achieve fast retrieval of intermediate results. Simultaneously, cache expiration periods are set, and expired data is periodically cleaned up to avoid storage resource redundancy.
[0039] High-frequency request patterns are identified through historical inference request clustering analysis. Specifically, all inference requests received within a historical time period are acquired and divided into preset categories based on semantic features using the K-means clustering algorithm. The proportion of processed semantic signatures with a similarity greater than a preset threshold in each set is calculated. If the proportion of a set exceeds a preset threshold (e.g., 80%), a lightweight distillation process is triggered. Using the inference requests, intermediate results, and output results of this set as training data, a preset low-complexity sub-model is trained using knowledge distillation techniques. Subsequently, the inference model of the inference requests corresponding to this set is replaced with the trained sub-model, achieving optimized allocation of computing resources.
[0040] During cache updates, the system establishes a bidirectional mapping between semantic signatures and cached data. Each semantic signature is associated with its corresponding output, intermediate results, and context information, and a hash table is used for fast indexing. Simultaneously, timestamp information for the semantic signatures is maintained, supporting the retrieval of historical cached data by time range. This design ensures accurate location of relevant cached content in subsequent request processing, improving system response speed.
[0041] In addition, a built-in error detection and recovery mechanism is implemented during inference path construction and cache updates. If a model error or data inconsistency occurs during inference, the system automatically rolls back to the most recent valid intermediate result and triggers a retry process; if a cache write fails, an error log is recorded and the operations and maintenance personnel are notified. Through multi-level verification and redundant storage, the system's stable operation is ensured under abnormal conditions.
[0042] Step 130: According to the preset time window, detect the inference frequency of different semantic signatures generated by all agents, and adjust the storage time of the output result corresponding to the semantic signature in the preset result cache layer according to the inference frequency.
[0043] It should be further explained that the inference frequency of different semantic signatures generated by all agents is continuously monitored through preset time windows (such as fixed periods of 1 hour or 24 hours). Specifically, the system maintains a semantic signature-frequency mapping table, recording the number of times each semantic signature is requested within the time window. When the time window ends, the semantic signatures are classified according to the frequency values in the mapping table: the storage time of the output results corresponding to high-frequency semantic signatures (such as frequency ≥ 10 times / window) in the preset result cache layer is extended to the preset maximum value (such as 72 hours), the storage time of mid-frequency semantic signatures (such as 5 times ≤ frequency < 10 times / window) is set to the intermediate value (such as 24 hours), and the storage time of low-frequency semantic signatures (such as frequency < 5 times / window) is shortened to the minimum value (such as 1 hour). This adjustment is achieved by updating the metadata of the result cache layer, ensuring fast access to high-frequency data and timely release of low-frequency data, realizing dynamic matching between storage resources and business load.
[0044] In addition, this application Figure 2 This application provides an embodiment of a multi-agent cooperative system based on shared memory data. For example... Figure 2 As shown in the embodiments of this application, the system mainly includes: The similarity calculation module 210 is used to receive reasoning requests from different agents through the agent request access layer; identify the request semantic features, reasoning model and semantic feature processing order corresponding to the reasoning request; perform vectorization representation on the reasoning request to generate a unique semantic signature; and perform similarity calculation between the semantic signature and the processed semantic signatures of all agents.
[0045] The result acquisition module 220 is used to extract context information from the preset context cache layer when there is no processed semantic signature with a similarity greater than a preset threshold; determine the corresponding inference path and the path nodes corresponding to the inference model according to the context information, request semantic features, inference model and semantic feature processing order, and obtain the output result and the intermediate results generated by each path node; cache the semantic signature and output result to the preset result cache layer; cache the intermediate results generated by each path node as context information to the preset context cache layer; when there is a processed semantic signature with a similarity greater than a preset threshold, reuse the corresponding cached output result in the preset result cache layer as the inference result corresponding to the current semantic signature.
[0046] The result acquisition module 220 includes a sequential acquisition unit. This is used to divide the content of the reasoning request into logical segments according to semantic boundaries using a semantic parsing engine. Each logical segment represents a complete semantic unit. Logical fragments are converted into embedded representations using vectorization techniques to obtain request semantic features; attention mechanisms are then used to analyze the semantic dependencies between request semantic features. Calculate the inference model corresponding to each request semantic feature based on the distance between the request semantic features and the descriptive features of the inference model; The pre-defined orchestration engine constructs a directed acyclic graph based on the semantic dependencies between semantic features, and determines the execution sequence corresponding to the semantic features in the directed acyclic graph through topological sorting, which serves as the request semantic processing order.
[0047] The cache processing module 230 is used to detect the inference frequency of different semantic signatures generated by all intelligent agents according to a preset time window, and adjust the storage time of the output result corresponding to the semantic signature in the preset result cache layer according to the inference frequency.
[0048] The above are method embodiments of this application. Based on the same inventive concept, this application also provides a multi-agent collaborative device based on shared memory data. Figure 3 As shown, the device includes: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to perform a multi-agent cooperation method based on shared memory data as described in the above embodiments.
[0049] Specifically, the server receives inference requests from different agents through the agent request access layer; identifies the request semantic features, inference model, and semantic feature processing order corresponding to the inference request; vectorizes the inference request to generate a unique semantic signature; calculates the similarity between the semantic signature and the processed semantic signatures of all agents; when there is no processed semantic signature with a similarity greater than a preset threshold, extracts context information from the preset context cache layer; determines the corresponding inference path and the path nodes corresponding to the inference model based on the context information, request semantic features, inference model, and semantic feature processing order, and obtains the output result and the intermediate results generated by each path node; caches the semantic signature and output result in the preset result cache layer; caches the intermediate results generated by each path node as context information in the preset context cache layer; when there is a processed semantic signature with a similarity greater than a preset threshold, reuses the corresponding cached output result in the preset result cache layer as the inference result corresponding to the current semantic signature; detects the inference frequency of different semantic signatures generated by all agents according to a preset time window, and adjusts the storage time of the output result corresponding to the semantic signature in the preset result cache layer according to the inference frequency.
[0050] In addition, embodiments of this application also provide a non-volatile computer storage medium storing executable instructions, which, when executed, implement the multi-agent cooperation method based on shared memory data as described above.
[0051] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-agent cooperation method based on shared memory data, characterized in that, The method includes: The system receives inference requests from different agents through the agent request access layer; identifies the request semantic features, inference model, and semantic feature processing order corresponding to the inference request; vectorizes the inference request to generate a unique semantic signature; and calculates the similarity between the semantic signature and the processed semantic signatures of all agents. When no processed semantic signature with a similarity greater than a preset threshold exists, context information is extracted from the preset context cache layer. Based on the context information, request semantic features, inference model, and semantic feature processing order, the corresponding inference path and each path node corresponding to the inference model are determined, and the output result and intermediate results generated by each path node are obtained. The semantic signature and output result are cached in the preset result cache layer. The intermediate results generated by each path node are cached as context information in the preset context cache layer. When a processed semantic signature with a similarity greater than a preset threshold exists, the corresponding cached output result in the preset result cache layer is reused as the inference result corresponding to the current semantic signature. Based on a preset time window, the inference frequency of different semantic signatures generated by all agents is detected, and the storage time of the output results corresponding to the semantic signatures in the preset result cache layer is adjusted according to the inference frequency.
2. The multi-agent cooperation method based on shared memory data according to claim 1, characterized in that, Identifying the request semantic features, inference model, and semantic feature processing order corresponding to the inference request specifically includes: The semantic parsing engine divides the inference request content into logical segments according to semantic boundaries, and each logical segment represents a complete semantic unit; Logical fragments are converted into embedded representations using vectorization techniques to obtain request semantic features; attention mechanisms are then used to analyze the semantic dependencies between request semantic features. Calculate the inference model corresponding to each request semantic feature based on the distance between the request semantic features and the description features of the inference model; The pre-defined orchestration engine constructs a directed acyclic graph based on the semantic dependencies between semantic features, and determines the execution sequence corresponding to the semantic features in the directed acyclic graph through topological sorting, which serves as the request semantic processing order.
3. The multi-agent cooperation method based on shared memory data according to claim 1, characterized in that, The inference request is vectorized to generate a unique semantic signature; The semantic signature is compared with the processed semantic signatures of all agents, specifically including: Convert the inference request into an inference vector; Generate the hash value corresponding to the inference vector as a semantic signature; The similarity is determined by calculating the difference between the binary strings of the semantic signature and the processed semantic signature.
4. The multi-agent cooperation method based on shared memory data according to claim 1, characterized in that, When no processed semantic signature with a similarity greater than a preset threshold exists, context information is extracted from the preset context cache layer, specifically including: Retrieve the historical semantic signatures of the agent corresponding to the current semantic signature; Calculate the difference between the binary number strings of the current semantic signature and the historical semantic signature. When the minimum difference is less than or equal to the preset difference threshold, determine the context information corresponding to the historical semantic signature with the minimum difference in the preset context cache layer as the context information of the current semantic signature. If no historical semantic signature exists or the minimum difference is greater than the preset difference threshold, it is determined that the current semantic signature does not have context information in the preset context cache layer, and an empty value is returned.
5. The multi-agent cooperation method based on shared memory data according to claim 1 or 2, characterized in that, Based on contextual information, request semantic features, inference model, and semantic feature processing order, determine the corresponding inference path, the path nodes corresponding to the inference model, and obtain the output results and intermediate results generated by each path node, specifically including: Based on the semantic features of each request in the semantic feature processing order and the inference model corresponding to the semantic features of the request, determine the inference path and each path node; The first requested semantic feature in the context information and semantic feature processing order is input into the corresponding inference model to obtain the first intermediate result. The next request semantic feature in the intermediate result and semantic feature processing sequence is input into the corresponding inference model to obtain the next intermediate result; this continues until the final output result is obtained.
6. The multi-agent cooperation method based on shared memory data according to claim 1, characterized in that, The semantic signature and output results are cached in a preset result cache layer; After caching the intermediate results generated by each path node as context information in a preset context cache layer, the method further includes: Retrieve all inference requests received within the historical time period; Cluster all reasoning requests to obtain a set of reasoning requests in a preset category; Determine the percentage of processed semantic signatures in each inference request set whose similarity exceeds a preset threshold. When there is a set of inference requests with a proportion greater than the preset proportion threshold, the lightweight distillation process is initiated. Use the inference requests, intermediate results, and output results corresponding to the inference request set as training data to train a preset low-complexity sub-model and obtain the trained preset low-complexity sub-model. Replace all subsequent inference models corresponding to the semantic feature processing order of the inference requests under the current inference request set with pre-trained preset low-complexity sub-models.
7. A multi-agent cooperative system based on shared memory data, characterized in that, The system includes: The similarity calculation module is used to receive reasoning requests from different agents through the agent request access layer; identify the request semantic features, reasoning model and semantic feature processing order corresponding to the reasoning request; vectorize the reasoning request to generate a unique semantic signature; and calculate the similarity between the semantic signature and the processed semantic signatures of all agents. The result acquisition module is used to extract context information from a preset context cache layer when there is no processed semantic signature with a similarity greater than a preset threshold; determine the corresponding inference path and the path nodes corresponding to the inference model based on the context information, request semantic features, inference model, and semantic feature processing order, and obtain the output result and the intermediate results generated by each path node; cache the semantic signature and output result to a preset result cache layer; cache the intermediate results generated by each path node as context information to a preset context cache layer; when there is a processed semantic signature with a similarity greater than a preset threshold, reuse the corresponding cached output result in the preset result cache layer as the inference result corresponding to the current semantic signature; The cache processing module is used to detect the inference frequency of different semantic signatures generated by all agents according to a preset time window, and adjust the storage time of the output result corresponding to the semantic signature in the preset result cache layer according to the inference frequency.
8. The multi-agent cooperative system based on shared memory data according to claim 7, characterized in that, The result acquisition module includes a sequential acquisition unit. This is used to divide the content of the reasoning request into logical segments according to semantic boundaries using a semantic parsing engine. Each logical segment represents a complete semantic unit. By using vectorization techniques, logical fragments are converted into embedded representations to obtain request semantic features; Utilize attention mechanisms to analyze semantic dependencies between request semantic features; Calculate the inference model corresponding to each request semantic feature based on the distance between the request semantic features and the description features of the inference model; The pre-defined orchestration engine constructs a directed acyclic graph based on the semantic dependencies between semantic features, and determines the execution sequence corresponding to the semantic features in the directed acyclic graph through topological sorting, which serves as the request semantic processing order.
9. A multi-agent collaborative device based on shared memory data, characterized in that, The device includes: processor; And a memory having executable code stored thereon, which, when executed, causes the processor to perform a multi-agent cooperative method based on shared memory data as described in any one of claims 1-6.
10. A non-volatile computer storage medium, characterized in that, It stores computer instructions, which, when executed, implement a multi-agent cooperation method based on shared memory data as described in any one of claims 1-6.
Citation Information
Cited By
A multi-agent thinking optimization method and system based on dynamic adjustment and a medium
CN122133818A