Multi-agent question-answer interaction efficiency and performance optimization method based on large model
By analyzing historical data of multi-agent question answering using a large model, agent roles are identified and appropriate interaction protocols are generated. This solves the problems of resource waste and static interaction strategies in multi-agent question answering systems, and achieves efficient utilization of agent resources and stable optimization of system performance.
Patent Information
- Application Number
- CN202511577499.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2025-12-12
AI Technical Summary
Multi-agent question-answering systems suffer from problems such as unscientific division of agent roles, waste of resources and load imbalance, lack of suitable interaction and collaboration mechanisms, and difficulty in dynamically optimizing interaction strategies, leading to decreased system performance and poor user experience.
By analyzing historical data of multi-agent question-and-answer sessions using a large model, the response time and accuracy indicators of agents are identified, and agents are classified into different role types. Interaction protocols adapted to these role types are generated, message priority rules and communication triggering conditions are defined, and the protocols are adjusted in real time to optimize the interaction process.
It achieves efficient utilization of intelligent agent resources, reduces response lag and resource idleness, ensures timely response to critical needs, enables the system to adapt to changes in scenarios, and improves system performance and user experience.
Smart Images

Figure CN121125676A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multi-agent question and answer optimization, in particular to a multi-agent question and answer interaction efficiency and performance optimization method based on a large model. BACKGROUND
[0002] With the evolution of artificial intelligence technology, multi-agent systems have been widely used in complex scenarios such as intelligent customer service, scientific research assistance, and autonomous driving due to their distributed collaboration advantages. These systems divide and collaborate through multiple agents specialized in different fields, theoretically breaking through the capability bottleneck of single agents and achieving more efficient task processing. However, in actual multi-agent question and answer interaction scenarios, system performance often fails to meet expectations, and various problems gradually emerge.
[0003] Agent role division and task allocation lack scientificity. In existing systems, agents often have "ambiguous responsibilities", and some agents may handle tasks that are not matched with their performance, such as assigning professional questions that require deep reasoning to agents with fast response speed but insufficient accuracy, while agents good at complex analysis are assigned a large number of basic consultations, leading to coexistence of resource waste and load imbalance. This unreasonable task allocation directly triggers a chain reaction, with some agents experiencing response delays due to overloading, and some agents being idle for a long time, unable to perform their due value.
[0004] Agents lack adaptive interaction and collaboration mechanisms. The core of multi-agent collaboration is efficient communication, but existing systems mostly use generalized communication modes without designing dedicated protocols for question and answer scenarios. In the message transmission process, there is a lack of clear priority division, and urgent or high-value question and answer requests may be mixed with ordinary requests, leading to delayed processing of critical needs; at the same time, the communication trigger condition is rigid, often causing "ineffective communication" or "communication deficiency", with some agents frequently sending repeated state information to occupy computing power, while in the case of cross-agent collaborative response, the trigger condition is not met and timely linkage is not achieved, forming an "information island".
[0005] Existing systems cannot dynamically optimize interaction strategies. Traditional methods mostly rely on manually preset interaction rules, which cannot accurately capture agent performance characteristics and interaction patterns through historical data, nor can they adjust strategies based on real-time running data. In scenarios where question and answer task types dynamically change and the number of agents increases or decreases, fixed rules are easily ineffective, leading to rising system delays, declining throughput, and even the "internal consumption" phenomenon of multiple agents responding to the same question repeatedly. For example, in the intelligent customer service scenario, reception agents and after-sales agents often lack dynamic collaboration, resulting in broken transmission of user intent information and repeated inquiries for key information by after-sales agents, which not only reduces response efficiency but also affects user experience. SUMMARY
[0006] The present application aims to provide a large model-based multi-agent question and answer interaction efficiency and performance optimization method to solve the problems raised in the background art.
[0007] To achieve the above-mentioned purpose, the present application provides a large model-based multi-agent question and answer interaction efficiency and performance optimization method, which comprises: analyze the multi-agent question and answer historical data through a large model, extract the response time indicators and accuracy indicators of the agents, and identify the interaction frequency patterns between the agents; According to the extracted response time indicators, accuracy indicators and interaction frequency patterns, the agents are classified into different role types, and each role type is assigned a specific type of question and answer task; Generate an interaction protocol that adapts to the role type, define the message priority rules and communication trigger conditions when the agents communicate; Perform the multi-agent question and answer interaction process, and the agents exchange messages and query responses according to the interaction protocol; Collect the delay data and throughput data generated during the question and answer interaction process, and modify the message priority rules and communication trigger conditions of the interaction protocol based on the delay data and throughput data.
[0008] Preferably, the step of analyzing the multi-agent question and answer historical data through a large model comprises: Construct a historical data analysis process to separate query texts and response texts from multi-agent question and answer historical data; Use a large model to process query texts and response texts, calculate the average response time value and accuracy value of each agent; Analyze the message sequence between the agents, count the interaction frequency and generate an interaction pattern map.
[0009] Preferably, the step of classifying the agents into different role types according to the extracted response time indicators, accuracy indicators and interaction frequency patterns comprises: Based on the average response time value and accuracy value, the agents are divided into high-priority responders and low-priority responders role types; Use the interaction pattern map to identify core communication nodes, and assign the core communication node agents to the coordinator role type; Assign direct answer tasks to high-priority responder role types, assign auxiliary verification tasks to low-priority responder role types, and assign message routing tasks to coordinator role types.
[0010] Preferably, the step of generating an interaction protocol that adapts to the role type comprises: Set high message priority rules for high-priority responder role types to allow them to respond directly to queries; Set low message priority rules for low-priority responder role types, requiring them to wait for confirmation from high-priority responders before participating; Define communication trigger conditions for the coordinator role type, and trigger the coordinator's intervention when the query complexity exceeds the threshold.
[0011] Preferably, the steps of performing the multi-agent question-and-answer interaction process include: The intelligent agent receives query requests and determines the message sending order based on role type and interaction protocol; High-priority responder role types generate response messages first and forward them to low-priority responder role types through the coordinator role type; The low-priority responder role type supplements or corrects the received response message and returns the final result to the query source.
[0012] Preferably, the step of collecting latency data and throughput data generated during the question-and-answer interaction includes: Monitor the time interval between each agent receiving a query and sending a response, and record it as latency data; The number of queries successfully processed by the agent per unit time is recorded as throughput data. Latency and throughput data are stored as a time-series dataset.
[0013] Preferably, the step of modifying the message priority rules and communication triggering conditions of the interaction protocol based on latency data and throughput data includes: When the delayed data exceeds the preset threshold, the message priority rule for high-priority responder roles is reduced, and the communication triggering condition frequency for coordinator roles is increased. When throughput data is below a preset threshold, increase the message priority rules for low-priority responder roles and reduce the intervention conditions for coordinator roles. Analyze time series datasets using large models, generate adjustment suggestions, and automatically update interaction protocol parameters.
[0014] Preferably, the method further includes the step of optimizing the interaction protocol parameters: Establish a mapping relationship between performance metrics and protocol parameters, and dynamically adjust the weight values in message priority rules based on latency and throughput data; By simulating interaction scenarios under different parameter settings using a large model, the optimal combination of weight values is selected for application in actual question-and-answer interactions.
[0015] Preferably, the method further includes an agent update step, specifically: Regularly collect newly generated question-and-answer interaction data, and recalculate the agent's average response time and accuracy using a large model; The role type assignments are updated based on the recalculation results, and the interaction protocols are adjusted synchronously to reflect changes in agent capabilities.
[0016] Preferably, the step of generating the interaction protocol adapted to the role type further includes a step of setting a message caching mechanism. This step specifically includes: configuring a short-term message cache for the coordinator role type to store response messages recently sent by high-priority responder role types; when a low-priority responder role type needs to perform auxiliary verification, the coordinator role type first retrieves historical response messages from the message cache for comparison, reducing redundant calculation requests.
[0017] Compared with the prior art, the beneficial effects of the present invention are: Leveraging the analytical capabilities of large-scale models on historical data, we can overcome the limitations of traditional manual analysis and accurately capture the performance differences and interaction patterns of various agents from massive amounts of question-and-answer data. Large-scale models can automatically identify the characteristics of agents with stable response speeds but strong performance in basic question-and-answer, as well as the characteristics of specialized agents with high accuracy but longer processing cycles. Simultaneously, they can uncover high-frequency collaborative patterns between agents, providing a comprehensive and accurate basis for subsequent role classification and avoiding biases caused by human experience-based judgment.
[0018] Based on the analysis results, agent roles are categorized and tasks are assigned, enabling each agent to undertake question-and-answer tasks tailored to its performance. Agents skilled in rapid response can focus on basic common-sense questions, while agents specializing in domain analysis handle complex professional questions. This adaptive allocation model avoids resource misallocation, reduces response delays caused by task overload in some agents, and lowers the probability of idle resources, allowing for more efficient use of system resources. In scenarios with a large number of agents, this division of labor model can also reduce repetitive work caused by overlapping roles, making the overall question-and-answer process more orderly.
[0019] The interaction protocol design, adapted to different role types, specifically addresses the chaos in agent communication. Clearly defined message priority rules ensure that urgent or core-domain question-and-answer requests are prioritized for processing, preventing low-value messages from consuming resources and ensuring timely responses to critical needs. Furthermore, the setting of communication trigger conditions controls communication timing based on role assignments and task relevance. When a problem handled by one agent requires collaboration from other agents, the trigger condition automatically activates the communication process; conversely, it reduces unnecessary message passing, effectively minimizing computational overhead and information noise associated with communication.
[0020] The dynamic adjustment mechanism introduced during the interaction process enables the system to adapt to changing scenarios. By collecting latency and throughput data in real time, the system can promptly perceive the compatibility of the protocol with the current interaction state. When the latency of a certain type of task continues to increase, the priority of corresponding messages can be adjusted or the communication trigger threshold can be optimized to ensure that the protocol always meets actual operational needs. This dynamic optimization mode breaks free from the constraints of traditional fixed rules and can cope with dynamic scenarios such as changes in question-and-answer task types and adjustments in the number of agents, maintaining stable system performance. Attached Figure Description
[0021] Figure 1 This is a schematic diagram illustrating the working principle of the multi-agent question-answering interaction efficiency and performance optimization method based on a large model described in this invention. Figure 2 A flowchart of the historical data analysis steps; Figure 3 A flowchart of the steps to generate the interaction protocol. Detailed Implementation
[0022] 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.
[0023] Please see Figure 1 This invention provides a method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model. The method includes: deploying a large model to process historical multi-agent question-answering data; extracting key indicators such as response time and accuracy from this data; and identifying interaction frequency patterns between agents. The extracted indicators and patterns are used to classify agents into different role types, and each role type is assigned a specific type of question-answering task to suit its characteristics. An interaction protocol adapted to each role type is generated, explicitly defining message priority rules and communication triggering conditions to regulate communication behavior between agents. During multi-agent question-answering interaction, agents exchange messages and respond to queries according to the interaction protocol, ensuring orderly interaction. Latency and throughput data generated during the interaction are collected in real time, and this data is used to dynamically modify the message priority rules and communication triggering conditions of the interaction protocol to achieve continuous performance optimization.
[0024] Example 1: See Figure 2Historical data for multi-agent question-and-answer systems typically exists in the form of structured log files or database records, containing fields such as timestamps, agent identifiers, query text, and response text. The historical data parsing process first cleans and preprocesses the raw data, removing duplicate records and invalid entries to ensure data quality. The parsing process uses regular expressions and word segmentation techniques to separate the query text and response text from the raw data. The query text represents the user's question, and the response text corresponds to the agent's answer. The separated text data is converted to a unified encoding format, such as UTF-8, to avoid character set inconsistencies. The parsing process outputs a structured dataset, where each record clearly correlates with the query text and response text. When processing the query and response text using a large model, the large model loads pre-trained language model weights, built on the Transformer architecture. The large model vectorizes the query and response text in each record, converting the text into numerical vectors in a high-dimensional space. Based on these vector representations, the large model calculates the average response time for each agent, obtained by averaging the time intervals from receiving the query to generating a response. The large model simultaneously calculates the accuracy score for each agent. Accuracy is determined by comparing the semantic similarity between the agent's response text and the standard answer text, using a cosine similarity algorithm. The large model outputs the average response time and accuracy scores as a structured list of metrics, with each agent corresponding to a set of metrics. The calculation process employs a batch processing mode, handling multiple historical records at once to improve computational efficiency. The large model's calculation results are written to an intermediate storage system, which uses a key-value database to store the metric values using the agent's identifier as the key.
[0025] Analyzing message sequences between agents involves reconstructing historical interaction scenarios. The message sequences are arranged chronologically, showing messages sent and received between agents. A large model analyzes the senders, receivers, and message content within the message sequences to identify interaction pairs between agents. Interaction frequency is calculated by counting the number of message exchanges between each agent pair within a specific time window, the size of which is configurable. An interaction pattern graph is generated, abstracting agents as nodes and message interactions as edges, with edge weights representing interaction frequency. The interaction pattern graph is stored using a graph database, which supports efficient graph traversal and querying. The large model applies a community detection algorithm to perform cluster analysis on the interaction pattern graph, identifying closely interacting agent groups. The interaction pattern graph is visualized, showing the structure and connection strength of agent groups using a force-directed graph layout algorithm. The graph analysis results are output as an adjacency matrix or edge list for use by the role classification module. Agents are categorized into high-priority and low-priority responder roles based on average response time and accuracy values, using a threshold classification method. An average response time threshold and an accuracy threshold are set. The average response time threshold is determined based on the percentile of the historical response time distribution. An agent with an average response time below the threshold and an accuracy above the threshold is classified as a high-priority responder. An agent with an average response time above the threshold or an accuracy below the threshold is classified as a low-priority responder. The classification rules support multiple condition combinations, such as considering weighted scores for response time and accuracy. The classification results are recorded as an agent role mapping table, which associates agent identifiers with role types. The classification process is implemented as an automated script, which runs periodically to process new data. Agents with a high-priority responder role exhibit fast response and high accuracy, while agents with a low-priority responder role perform relatively slowly.
[0026] Core communication nodes are identified using an interaction pattern graph by calculating graph theory metrics, including degree centrality, betweenness centrality, and proximity centrality. Core communication nodes correspond to agent nodes with high centrality scores in the graph, indicating that the agent is in a pivotal position within the network. The large model calculates the centrality metric for each agent node and selects the top-K nodes as core communication nodes. Core communication node agents are assigned to the coordinator role type, responsible for managing message flow and coordinating interactions. The identification algorithm supports dynamic adjustments, such as adaptively selecting the number of core nodes based on network density. The allocation of coordinator role types considers the agent's historical coordination ability, measured by the proportion of successfully coordinated interactions. The core communication node list is updated when the agent network topology changes, ensuring that the coordinator role type always corresponds to the current network center. High-priority responder role types are assigned direct response tasks, requiring agents to directly respond to user queries without waiting for input from other agents. The task description is defined as generating a response immediately upon receiving a query, and the response generation invokes the large model's inference interface. Auxiliary verification tasks are assigned to low-priority responder role types. These tasks involve verifying and supplementing responses generated by high-priority responder role types. The verification process includes checking response accuracy, supplementing missing information, and correcting errors. Message routing tasks are assigned to coordinator role types. These tasks specify that the coordinator role type is responsible for routing messages from senders to receivers. The routing strategy is dynamically determined based on agent roles and load conditions, for example, prioritizing routing to idle agents. Task assignment is implemented as configuration rules, and the rule engine automatically selects a task template based on the role type. The task template includes input / output specifications and execution constraints to ensure consistency in task execution.
[0027] The large model employs Natural Language Processing (NLP) techniques to process text data during analysis, including word embedding, sequence labeling, and semantic parsing. Word embedding maps query and response texts to distributed representations, capturing semantic information. Sequence labeling identifies key entities and relationships within the text; these key entities are used for accurate metric calculation. Semantic parsing transforms the text into a logical form, facilitating comparison and reasoning. The large model uses an attention mechanism to focus on important parts of the text, with attention weights influencing metric calculation. The processing flow is optimized into a pipeline model, executing multiple NLP tasks in parallel. The large model's output includes rich semantic features, enhancing the accuracy of metric calculation. The generation of the interaction pattern graph relies on graph computation algorithms, executed within a distributed graph processing framework. This framework partitions and stores graph data across multiple computation nodes, which execute graph algorithms in parallel. These algorithms include PageRank calculation, shortest path search, and connected component analysis. The PageRank algorithm evaluates the importance of agent nodes, with importance scores identifying core nodes. Shortest path search determines the communication distance between agents, impacting interaction efficiency. Connectivity component analysis identifies isolated populations within the network, which may require special handling. Graph computation results are persistently stored in a graph database, which supports complex graph queries. The graph generation cycle is synchronized with the data update cycle to ensure that the graph reflects the latest interaction state.
[0028] Role type segmentation groups agents based on clustering algorithms, employing either K-means or hierarchical clustering. Cluster feature vectors contain average response time and accuracy values, and are standardized to eliminate the influence of dimensions. The K-means algorithm randomly initializes cluster centers and iteratively optimizes center positions until convergence. Hierarchical clustering constructs a tree structure, which is then divided into a predetermined number of clusters. Clustering results are evaluated using the silhouette coefficient, which measures clustering quality. The partitioning threshold is dynamically adjusted based on the clustering results to avoid over- or under-classification. The role type segmentation module outputs an agent grouping list, which is used for subsequent task allocation. The task allocation logic integrates a rule engine and an optimization model. The rule engine executes rule-based allocation strategies. Rules include condition-action pairs, with conditions checking agent role type and querying attributes. The optimization model uses linear programming or constraint satisfaction to solve for the optimal task allocation scheme. The allocation scheme satisfies constraints such as load balancing and response time targets. Task allocation results are published to a task queue, which is then consumed and executed by agents. Task execution status is monitored via a heartbeat mechanism, which detects task completion status. The task allocation module supports real-time adjustments in response to changes in system status.
[0029] Example 2: See Figure 3The system generates an interaction protocol adapted to different role types, starting with setting high message priority rules for high-priority responder role types. These rules grant high-priority responder role types priority processing rights in the message queue. Specifically, high message priority rules are defined by setting message priority values; messages sent by high-priority responder role types are marked with the highest priority value. The message queue system sorts pending messages according to priority values, with high-priority messages always at the front of the queue. High message priority rules allow high-priority responder role types to directly respond to queries, bypassing the conventional coordination process. Rule configurations are written to the interaction protocol's strategy file, which uses machine-readable YAML format. The implementation of high message priority rules relies on the underlying message middleware's priority support, which provides multiple priority channels. Messages from high-priority responder role types carry special header information indicating their priority processing attributes. Low message priority rules are set for low-priority responder role types, setting their message priority values to a lower level. These rules require low-priority responder role types to wait for confirmation from high-priority responders before participating; this waiting mechanism is implemented through message blocking. Messages from low-priority responder roles are queued and await acknowledgment from high-priority responder roles. Acknowledgment is broadcast in a specific message format, including the original query identifier and an initial response. The low-priority rule reduces unnecessary participation by low-priority responder roles, avoiding resource waste. The rule design incorporates a timeout mechanism to prevent low-priority responder roles from waiting indefinitely. The parameters of the low-priority rule can be dynamically adjusted based on system load and performance metrics.
[0030] Communication trigger conditions are defined for the coordinator role type, explicitly specifying the circumstances under which the coordinator role type intervenes in the interaction. The communication trigger condition is set to trigger coordinator intervention when query complexity exceeds a threshold; query complexity is quantified using natural language processing techniques. A complexity calculation model analyzes the syntactic structure and semantic depth of the query text, outputting a complexity score. The threshold is set based on historical query complexity distribution and is periodically recalibrated. Other scenarios include the detection of agent conflict or query timeout. After intervention, the coordinator role type assumes the responsibility of message routing and conflict mediation; the routing algorithm is based on the agent's load state. Communication trigger conditions are encoded in rule form, and the rule engine evaluates condition satisfaction in real time. The condition evaluation result triggers the coordinator role type activation process, which includes resource allocation and state switching. The interaction protocol is stored in a structured document containing complete definitions of message specifications, priority rules, and trigger conditions. The protocol document is deployed locally to each agent, and the protocol configuration is loaded upon agent startup. Protocol version management ensures that the multi-agent system uses a consistent protocol version; a synchronization mechanism is triggered when versions are inconsistent. The protocol includes detailed message format specifications, defining required and optional fields. The message header contains priority markers and role type identifiers, while the message body carries the query content and response data. The protocol also defines an error handling mechanism to address message loss or formatting errors. The protocol document is digitally signed to ensure its integrity and prevent unauthorized modification.
[0031] The multi-agent question-answering interaction process begins with an agent receiving a query request, which may originate from a user interface or other system components. Agents determine the message sending order based on their role type and the interaction protocol, following a priority rule defined by the protocol. High-priority responder roles generate response messages first, leveraging the reasoning capabilities of a large language model. The generation process considers query semantics and contextual information, including dialogue history and domain knowledge. Response messages are forwarded to low-priority responder roles via a coordinator role, preserving the original priority markers. The coordinator role performs message routing decisions based on receiver load and domain relevance. Low-priority responder roles supplement or correct the received response messages, adding missing details or additional information, and correcting factual errors or logical inconsistencies. Low-priority responder roles return the final result to the query source, potentially via the coordinator role or directly. The final result integrates the contributions of multiple agents, using a weighted voting or consensus mechanism. Detailed logs are recorded throughout the interaction process for performance monitoring and troubleshooting. An interaction timeout mechanism prevents indefinite waiting and triggers a backup processing flow after the timeout.
[0032] The interaction protocol is deeply integrated into the agent communication framework, which provides a message passing application programming interface (API). This API encapsulates the underlying network communication details and provides role-oriented message sending and receiving functions. Before sending a message, an agent queries the protocol configuration, which determines message priority and routing paths. Message sequence numbering ensures sequential delivery and handles out-of-order arrivals. The communication framework implements message persistence to prevent message loss due to system failures. The framework also supports message encryption and authentication; encryption ensures communication security, and authentication prevents malicious agents from accessing the system. The specific implementation of high-priority message rules relies on a priority queue data structure, which uses a heap structure for efficient insertion and retrieval operations. Messages marked as high priority are directly inserted at the head of the queue to ensure priority processing. Low-priority messages are inserted at the tail of the queue, waiting for previous messages to be processed. The queue management algorithm prevents high-priority messages from starving low-priority messages, and the algorithm sets a fairness threshold. The message priority value range is configurable, adapting to different application scenarios. The priority queue is implemented in a distributed structure, supporting concurrent access by multiple agents. Queue status monitoring tracks message backlog in real time, triggering alarms when backlog exceeds a threshold.
[0033] The evaluation of communication trigger conditions employs complex event processing (CEP) technology, with the CEP engine continuously monitoring system status and input queries. Event patterns define conditions exceeding complexity limits; pattern matching triggers coordinator intervention. Event processing rules support logical combinations, such as complex conditions with low system load. The evaluation process is efficient and low-latency, avoiding becoming a system performance bottleneck. Event results are immediately notified to the coordinator role type using a publish-subscribe mechanism. The condition evaluation module supports dynamic rule updates without interrupting existing interactions. The message forwarding mechanism is implemented as a message router within the coordinator role type, maintaining an agent registry. The registry records each agent's role type, capability description, and current load status. The router selects the optimal forwarding path based on the message type and target role, with the path selection algorithm considering network latency and agent capability matching. Message priority markers are preserved during forwarding to ensure subsequent processing adheres to protocol rules. The router implements load balancing to prevent overloading of individual agents. A message acknowledgment mechanism guarantees reliable delivery; acknowledgment timeout triggers a retransmission process. Supplementation and correction operations for low-priority responder role types use a difference detection algorithm, comparing the initial response with the knowledge base. The suggested corrections are based on authoritative data sources, ensuring accuracy. Supplementary content undergoes relevance filtering to remove irrelevant information. The corrected version and the original response are displayed in parallel, with the changes highlighted. The final result merges the valid contributions of all agents, and a merging algorithm resolves conflicting opinions. Results are standardized before being returned to ensure output consistency.
[0034] Example 3: This example collects latency and throughput data generated during multi-agent question-and-answer interactions and dynamically modifies message priority rules and communication triggering conditions of the interaction protocol based on this data. Monitoring latency data begins with deploying a monitoring agent to each agent node. The monitoring agent is responsible for capturing the timestamps of agents receiving queries and sending responses. Timestamps are synchronized using high-precision clocks to ensure cross-node time consistency. The interval is calculated by subtracting the query reception timestamp from the response timestamp, and the result is recorded as latency data. Latency data is stored in milliseconds, and the storage format includes the agent identifier, query identifier, and latency value. The monitoring agent is implemented as a lightweight background process that periodically reports data to a central monitoring service. The central monitoring service aggregates the latency data from all agents, and the aggregated data is used for system-level performance analysis. Throughput data is statistically analyzed using a counting mechanism that maintains the number of queries successfully processed by each agent within a sliding time window. The sliding time window size is configurable, for example, set to 60 seconds, and the unit of time is defined as the number of queries processed per second. Throughput data is recorded as the query per second value, calculated by dividing the total number of queries within the window by the window duration. A counting mechanism is integrated into the agent's processing pipeline, triggering a counter increment upon completion of each query. Successful processing is categorized based on a response status code, indicating whether the query was responded to correctly. Throughput data and latency data are stored together, with the association achieved through a shared query identifier. Data recording is performed in real-time, ensuring that throughput reflects the current system load.
[0035] Latency and throughput data are stored as time-series datasets, organized as sequences of data points ordered by time. Each data point contains a timestamp, metric value, and label information, including agent identifier and metric type. The storage backend uses a time-series database optimized for writing and querying time-series data. The dataset is partitioned based on time ranges, such as by day or by hour. Data compression algorithms, such as delta coding and run-length encoding, are applied to reduce storage space. The time-series dataset supports efficient range queries and aggregation operations for subsequent data analysis. A data retention strategy defines the automatic cleanup of old data to prevent storage overflow. When modifying message priority rules and communication triggering conditions of the interaction protocol based on latency data, the system compares the current latency data with a preset threshold. The preset threshold is set based on the percentile of the historical latency distribution, such as the 95th percentile. When latency data exceeds the preset threshold, the message priority rules for high-priority responder roles are lowered; this is achieved by adjusting message priority values. Message priority values are mapped to message queue priority levels, arranged from highest to lowest. Increase the frequency of communication trigger conditions for the coordinator role type. This increase is achieved by shortening the trigger check interval. The trigger check interval is reduced to half its original value, for example, from 100 milliseconds to 50 milliseconds. The modification process is automatically triggered based on real-time monitoring data. When throughput data falls below a preset threshold, increase the message priority rules for low-priority responder role types, giving low-priority messages a higher chance of processing. Reduce the intervention conditions for the coordinator role type, relaxing the intervention conditions, for example, by increasing the complexity threshold. Increasing the complexity threshold by 10% reduces the number of triggers for the coordinator role type. The throughput threshold is set based on system capacity planning, which considers hardware resources and business needs. Modification decisions are based on the average throughput within a rolling window, with the average smoothing out short-term fluctuations.
[0036] Large-scale model analysis is used to analyze time-series datasets. These large models load time-series prediction models such as ARIMA or LSTM networks. Analysis identifies trends, periodicities, and outliers in latency and throughput. Time-series dataset preprocessing includes denoising and normalization, with moving average filters used for denoising. The large model is trained on historical time-series data covering various load scenarios. Adjustment recommendations are generated based on prediction results, including new values for protocol parameters. These recommendations are formatted as machine-readable JSON documents containing parameter key-value pairs. Automatic updates to interactive protocol parameters are implemented through a configuration management interface that supports dynamic reconfiguration. Protocol parameters are stored in a distributed configuration store, such as ZooKeeper or etcd. The update process is guaranteed to be atomic, preventing inconsistencies in intermediate states. After parameter updates, the agent reloads the configuration, ensuring that ongoing queries are not interrupted. A version control mechanism tracks parameter change history, supporting rollback operations.
[0037] When modifying message priority rules, a formula is introduced to calculate the new priority weight. The formula is as follows: in: Indicates the priority weight of the new message. Indicates the priority weight of older messages. This represents the adjustment factor (ranging from 0 to 1). This indicates the current delayed data value. This indicates a preset threshold for delay.
[0038] The implementation details of the monitoring agent include capturing timestamps using system calls such as `gettimeofday` or `clock_gettime`. Timestamp accuracy reaches the microsecond level, reducing measurement errors. Monitoring data transmission uses lightweight protocols such as UDP to minimize overhead. A central monitoring service handles data aggregation and persistence, using a stream processing framework like Apache Flink. The stream processing framework supports real-time calculation of rolling metrics, such as average latency and throughput. The sliding time window of the counting mechanism uses a circular buffer, which efficiently manages window data. Atomic counter operations ensure accuracy and avoid concurrent counting errors. Successful processing status codes are defined based on HTTP status code analogies, with status code 200 indicating success. Throughput data is correlated with latency data using distributed trace identifiers, such as `TraceID`, which associate the entire query chain. The time-series database selection considers performance factors, using databases such as InfluxDB or Prometheus. Data point format is standardized to OpenMetrics format, promoting interoperability. The storage partitioning strategy is based on time sharding, with shard size balancing query performance and storage efficiency. The data compression algorithm has adjustable configuration parameters, such as the compression level, to adapt to the data characteristics. The query interface for the time series dataset supports SQL-like languages, such as InfluxQL, for convenient data analysis.
[0039] The threshold comparison process is continuous, comparing the current value with the threshold value. Preset thresholds are dynamically adjusted, recalculated based on long-term historical data. An alarm mechanism is triggered when the latency threshold is exceeded, notifying the administrator of potential issues. Message priority values are adjusted to update the message queue scheduling algorithm, such as a weighted fair queue. The trigger check interval modification for coordinator role types is implemented through timer reset, using hardware timers to ensure accuracy. When the throughput threshold is lower than the threshold, a scaling suggestion is triggered, increasing the number of agent instances. The weight of low-priority responder role types is increased, increasing their message processing share; share adjustment is based on weight ratios. The intervention conditions for coordinator role types are reduced by modifying rule condition expressions, using Boolean logic. Complexity threshold adjustments are based on the query classification model, with the model outputting a complexity score. The process for analyzing large model time series datasets includes data loading, preprocessing, model inference, and post-processing. Data loading reads the most recent data from the time series database, with the data volume limited to a manageable size. Preprocessing steps include missing value imputation and outlier detection; imputation uses linear interpolation. Model inference is accelerated using GPUs to reduce analysis latency. The post-processing step interprets the model output, generating a human-readable suggestion summary. A mechanism for automatically updating protocol parameters is integrated into the continuous integration pipeline, automating testing and deployment. The configuration management interface provides a RESTful API, allowing programmatic updates. Parameter storage uses a versioned key-value store, supporting transactional operations. Smart reload configuration is achieved through a signal mechanism, with signals such as SIGHUP triggering reloads. Version control uses a Git-like system, recording change authors and timestamps.
[0040] Example 4: The steps for optimizing interaction protocol parameters are based on establishing a mapping relationship between performance indicators and protocol parameters. This mapping relationship is constructed using a regression analysis model. The input variables of the regression analysis model include latency data and throughput data, and the output variable is the weight value in the message priority rule. The mapping relationship captures the degree of influence of performance indicator changes on protocol parameters, and the degree of influence is quantified as regression coefficients. The model is trained using a historical interaction dataset, which contains performance indicator values and corresponding optimal protocol parameter records. The training process uses the least squares method for fitting, which minimizes the sum of squared prediction errors. The mapping relationship is stored as a lookup table or a mathematical function; the lookup table supports fast lookup, and the mathematical function allows interpolation calculations. The model is periodically retrained to adapt to changes in system behavior, and the retraining cycle is based on data freshness requirements. The weight values in the message priority rule are dynamically adjusted based on latency and throughput data. The dynamic adjustment process is implemented as a feedback control loop. The feedback control loop reads the current performance indicator value, compares it with the target value, and generates an error signal. The error signal is input to the controller, and the controller outputs the weight value adjustment amount. The controller algorithm uses proportional-integral-derivative (PID) control, which eliminates steady-state errors and improves response speed. Weight adjustments are subject to constraints, such as weight range and rate of change limits. Adjustments are performed atomically to prevent inconsistencies caused by concurrent modifications. Adjusted weights take effect immediately through a hot-update mechanism.
[0041] A large-scale model simulates interaction scenarios under different parameter settings, loading the model into a multi-agent system simulation environment. The simulation environment models agent behavior, message passing, and resource constraints, with the behavioral model built based on historical interaction data. Parameter settings combinations cover the feasible space of weight values, defined by parameter ranges. Simulations are executed in batches, with each parameter combination run multiple times to reduce randomness. Simulation results record performance metrics such as simulation latency and throughput. The large-scale model analyzes the simulation results using sensitivity analysis. Sensitivity analysis identifies the parameters with the greatest impact on performance, and parameter ranking guides optimization priorities. The optimal weight value combination is selected for application in actual question-and-answer interactions, based on multi-objective optimization criteria. These criteria balance latency and throughput tradeoffs, represented by Pareto optimal solutions. The Pareto front identifies the optimal solution set where one objective cannot be further improved without harming another. Final selection considers business priorities, weighting the importance of different objectives. The optimal weight value combination is validated in small-scale testing, confirming performance improvements. The application process involves incremental rolling updates to reduce system risk. Refer to Table 1 for the mapping relationship between performance indicators and protocol parameters.
[0042] Table 1: Mapping Relationship between Performance Indicators and Protocol Parameters The process of establishing mapping relationships includes data standardization, which converts indicators with different dimensions into dimensionless scores. The standardization method uses min-max scaling, mapping values to the zero-to-one interval. Protocol parameters are discretized to reduce the parameter space. Mapping relationship validation uses cross-validation to assess the model's generalization ability. Version control tracks model iterations and improvements. Dynamic weight adjustments utilize incremental learning algorithms to update model parameters online. The adjustment magnitude is proportional to performance deviation, and the scaling factor is configurable. The adjustment direction is determined by performance change trends, analyzed using time-series derivatives. Smoothing weight changes prevents oscillations using moving average filters. An audit log is recorded during the adjustment process for fault diagnosis. Large-scale interactive scenario simulations employ the Monte Carlo method, which randomly samples parameter combinations. Scenario generation considers diverse load patterns, including bursty and stable loads. Random noise is introduced into the agent behavior model to improve simulation realism. Simulation acceleration utilizes parallel computing, leveraging multi-core processors. Simulation results are visualized for analysis, aiding in understanding the impact of parameters.
[0043] The optimal weight combination is selected and multi-attribute decision theory is applied to quantitatively evaluate different solutions. The decision matrix contains index values for all parameter combinations, and these values are normalized. Weight allocation reflects the importance of the objective, which is set by domain experts. The final selected solution must meet constraints, such as resource limitations. Before application, the solution undergoes a compliance check to ensure compliance with the service level agreement. The agent's update process periodically collects newly generated question-and-answer interaction data, which flows into the data acquisition system. The data acquisition system is implemented as a distributed message queue, which buffers the data stream. The data format is standardized to a general data model, which contains the complete interaction context. The collection frequency is configurable, balancing real-time performance with system load. Data quality check rules are executed, excluding invalid records. The agent's average response time and accuracy are recalculated using a larger model, recalculating the data within a sliding time window. The sliding time window size is determined based on data volatility; the window shrinks when volatility is high. Outliers are excluded during average response time calculation, and box plot methods are used for outlier detection. Accuracy calculation incorporates confidence intervals, reflecting measurement uncertainty. The recalculation process involves incremental updates, reducing computational overhead. Role type assignments are updated based on the recalculation results, triggered by a performance change threshold. This threshold is set at a statistical significance level, tested using a p-value. Role type assignment updates are atomic operations, maintaining system consistency. Update notifications are pushed to all agents using a publish-subscribe mechanism. Role type conversions are smoothly handled to avoid service interruptions. Interaction protocols are synchronously adjusted to reflect agent capability changes, including rule and parameter updates. Rule updates modify role-type specific clauses, such as message priority rules. Parameter updates adjust thresholds and weights, based on new role capabilities. Protocol adjustments are backward compatible, supporting mixed-version operation. The adjustments are validated through consistency testing, which checks the protocol logic.
[0044] Example 5: In the step of generating an interaction protocol adapted to different role types, a message caching mechanism is set up. This mechanism configures a short-term message cache for the coordinator role type. The short-term message cache is implemented as an in-memory hash table structure. The hash table uses the message fingerprint of the query content as the key and the response message sent by the high-priority responder role type as the value. The message fingerprint is generated using the SHA-256 hash algorithm, which converts the query text into a fixed-length unique identifier. The size of the short-term message cache is limited to 1000 entries. When the number of entries exceeds the limit, the least recently used algorithm is used for eviction. The lifetime of cached entries is set to 300 seconds, and entries exceeding the lifetime are automatically invalidated. The coordinator role type maintains an index structure for the cache in memory, which supports fast lookup and insertion operations. The short-term message cache stores recently sent response messages by the high-priority responder role type. This storage process occurs after the high-priority responder role type generates a response. The response messages are serialized using Protocol Buffers to reduce storage space. Message metadata is also saved, including a timestamp, agent identifier, and response message version number. Storage operations are atomic, guaranteeing data consistency in a multi-threaded environment. The cache implements a write-through strategy, ensuring that each new response is immediately stored in the cache. Response messages are compressed during storage using a GZIP compression algorithm to reduce memory usage. The cache is periodically persisted to disk to prevent data loss during system restarts.
[0045] When a low-priority responder role type needs to perform auxiliary verification, the coordinator role type prioritizes retrieving historical response messages from the message cache for comparison. The retrieval process uses the fingerprint of the currently queried message as the lookup key, which is then matched against a hash table. If the cache is hit, the coordinator role type compares the cached response message with the content currently requiring verification. The comparison algorithm uses semantic similarity calculation, employing a cosine similarity algorithm to compare text vector representations. A similarity threshold of 0.85 is set; responses exceeding this threshold are considered reusable. A difference report is generated based on the comparison results, highlighting the content changes. If the cache is not hit, the coordinator role type initiates the complete verification process, involving all relevant agents. The coordinator role type's priority retrieval of historical response messages from the message cache reduces redundant computation requests, which refer to the repeated processing of identical or similar queries. This reduction mechanism is achieved by directly returning historical responses when the cache is hit, avoiding recalculation of large models. The system maintains a cache hit rate metric to monitor the effectiveness of the caching mechanism. When the hit rate falls below a set threshold, the system automatically adjusts its caching strategy, including increasing the cache size or modifying the fingerprint generation algorithm. This reduces redundant calculations while maintaining response accuracy, which is guaranteed through periodic verification of cached content. The caching mechanism is particularly suitable for high-frequency, repetitive query scenarios, such as frequently asked questions or templated queries. The message caching mechanism implementation includes a cache consistency maintenance scheme, ensuring cache data synchronization among multiple coordinator role types. This scheme employs a version-based optimistic locking mechanism, which checks version number consistency when updating the cache. When a high-priority responder role type updates a response message, the coordinator role type broadcasts a cache invalidation notification, invalidating cache entries on other nodes. Cache synchronization uses a distributed message queue, ensuring reliable notification delivery. Consistency maintenance also includes periodic full synchronization, performed when the system is idle.
[0046] The caching mechanism's monitoring system encompasses multiple dimensions, including cache hit rate, response time savings, and memory usage. Cache hit rate statistics are displayed every minute, and the results are shown on the monitoring dashboard. Response time savings are calculated by comparing the processing time difference between cache hits and misses; this time difference reflects the performance improvement. Memory usage monitors the proportion of memory used by the cache; alarms are triggered when the proportion exceeds a threshold. Monitoring data is stored in a time-series database, which supports historical trend analysis. The cache invalidation strategy considers not only time but also the frequency of content changes. For frequently changing domains, the cache lifetime is shortened to 60 seconds. For stable domains, the cache lifetime can be extended to 1800 seconds. The invalidation strategy is dynamically adjusted based on domain characteristics, achieved through machine learning algorithms. The algorithm analyzes content change patterns in historical data, and pattern recognition guides the setting of invalidation times. Seamless integration of the message caching mechanism with existing interaction protocols is achieved through a standardized cache application programming interface (API). The cache API provides three basic operations: put, get, and invalidate. The agent calls the put interface when sending a response and the get interface when verification is required. The protocol engine automatically calls the invalidate interface when it detects a data update. The implementation of this interface hides the details of the underlying caching technology, such as distributed or local caching. Caching performance optimization techniques include memory pre-allocation and cache preheating. Memory pre-allocation allocates a fixed-size cache space at system startup, reducing runtime memory allocation overhead. Cache preheating loads response messages from frequently queried requests during off-peak periods, improving the initial cache hit rate. These optimization techniques are particularly suitable for systems with clear access patterns, such as systems with periodic business queries.
[0047] The fault tolerance mechanism handles cache failure scenarios, including cache node downtime or network partitioning. It employs a degradation strategy, directly accessing the backend system when the cache becomes unavailable. A replication mechanism maintains multiple replicas of the cache, distributed across different physical nodes. Fault detection uses a heartbeat mechanism, periodically checking the health of cache nodes. Automatic failover ensures that a single node failure does not affect overall functionality, with failover time controlled at the millisecond level. Security considerations are reflected in the caching mechanism through data encryption and access control. Data encryption uses AES encryption for cached response messages, with the encryption key managed by a key management system. Access control is based on intelligent agent authentication; access to the cache is only granted after successful authentication. Audit logs record all cache operations and are used for security analysis and compliance checks. Security measures prevent the leakage of sensitive information through the cache, such as patient medical records or customer financial data. The scalability design of the caching mechanism supports horizontal scaling, achieved through sharding technology. Sharding distributes cached data across multiple nodes, with the number of nodes increasing as the data volume grows. A consistent hashing algorithm is used for data sharding, minimizing data migration when nodes are added or removed. The load balancer routes requests to appropriate cache nodes, with the routing algorithm considering node load and network latency. The implementation of the entire message caching mechanism significantly improves the performance of the multi-agent question-answering system, resulting in reduced response time and lower system load. The mechanism intelligently utilizes historical response data, avoiding resource waste caused by redundant calculations. Various edge cases, such as cache breakdown and cache avalanche, are considered during implementation. Solutions include mutex locks and random expiration times, ensuring system stability. The caching mechanism becomes an important component of the interaction protocol, partially enhancing its processing capabilities. Continuous optimization is based on actual operational data, which guides parameter tuning and strategy improvements.
[0048] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model, characterized in that, The method includes: By analyzing historical data of multi-agent question-and-answer sessions using a large model, response time and accuracy metrics of the agents are extracted, and interaction frequency patterns between agents are identified. Based on the extracted response time metrics, accuracy metrics, and interaction frequency patterns, the agents are classified into different role types, and a specific type of question-and-answer task is assigned to each role type. Generate an interaction protocol that adapts to the role type, and define message priority rules and communication triggering conditions when agents communicate. The process of multi-agent question-and-answer interaction is executed, with agents exchanging messages and responding to queries according to the interaction protocol. Collect latency and throughput data generated during the question-and-answer interaction process, and modify the message priority rules and communication triggering conditions of the interaction protocol based on the latency and throughput data.
2. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 1, characterized in that, The steps for analyzing historical multi-agent question-answering data using a large model include: Construct a historical data parsing process to separate query text and response text from multi-agent question-and-answer historical data; The query and response texts are processed using a large model to calculate the average response time and accuracy for each agent. Analyze the message sequences between agents, count the interaction frequency, and generate an interaction pattern map.
3. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 2, characterized in that, The step of classifying agents into different role types based on extracted response time indicators, accuracy indicators, and interaction frequency patterns includes: Based on average response time and accuracy, agents are divided into high-priority responders and low-priority responders. Core communication nodes are identified using an interaction pattern graph, and the core communication node agents are assigned to coordinator role types. Assign direct response tasks to high-priority responder role types, auxiliary verification tasks to low-priority responder role types, and message routing tasks to coordinator role types.
4. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 1, characterized in that, The steps for generating an interaction protocol that adapts to the role type include: Set high message priority rules for high-priority responder role types to allow them to respond to queries directly; Set low message priority rules for low-priority responder role types, requiring them to wait for confirmation from high-priority responders before participating; Define communication trigger conditions for the coordinator role type, and trigger the coordinator's intervention when the query complexity exceeds the threshold.
5. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 4, characterized in that, The steps for performing the multi-agent question-answering interaction process include: The intelligent agent receives query requests and determines the message sending order based on role type and interaction protocol; High-priority responder role types generate response messages first and forward them to low-priority responder role types through the coordinator role type; The low-priority responder role type supplements or corrects the received response message and returns the final result to the query source.
6. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 5, characterized in that, The steps for collecting latency and throughput data generated during the question-and-answer interaction process include: Monitor the time interval between each agent receiving a query and sending a response, and record it as latency data; The number of queries successfully processed by the agent per unit time is recorded as throughput data. Latency and throughput data are stored as a time-series dataset.
7. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 6, characterized in that, The steps for modifying the message priority rules and communication triggering conditions of the interaction protocol based on latency data and throughput data include: When the delayed data exceeds the preset threshold, the message priority rule for high-priority responder roles is reduced, and the communication triggering condition frequency for coordinator roles is increased. When throughput data is below a preset threshold, increase the message priority rules for low-priority responder roles and reduce the intervention conditions for coordinator roles. Analyze time series datasets using large models, generate adjustment suggestions, and automatically update interaction protocol parameters.
8. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 1, characterized in that, The method also includes the step of optimizing the interaction protocol parameters: Establish a mapping relationship between performance metrics and protocol parameters, and dynamically adjust the weight values in message priority rules based on latency and throughput data; By simulating interaction scenarios under different parameter settings using a large model, the optimal combination of weight values is selected for application in actual question-and-answer interactions.
9. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 1, characterized in that, The method also includes an agent update step, specifically: Regularly collect newly generated question-and-answer interaction data, and recalculate the agent's average response time and accuracy using a large model; The role type assignments are updated based on the recalculation results, and the interaction protocols are adjusted synchronously to reflect changes in agent capabilities.
10. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as described in claim 4, characterized in that, The step of generating the interaction protocol adapted to the role type also includes setting up a message caching mechanism. This step specifically includes: configuring a short-term message cache for the coordinator role type to store response messages recently sent by high-priority responder role types; when a low-priority responder role type needs to perform auxiliary verification, the coordinator role type first retrieves historical response messages from the message cache for comparison, reducing redundant calculation requests.
Citation Information
Patent Citations
Data sharing system and method for realizing multi-agent interaction
CN120277143A
Multi-agent collaborative data visualization analysis method, equipment and medium
CN120744000A
Multi-agent system and control method therefor
WO2022001120A1
Cited By
Enterprise complex task automatic disassembly and execution method based on multi-agent collaboration
CN121836641A