1. Introduction
Mine gas, as a significant safety hazard in coal mining, has long been a focal point of attention in the global mining industry. Accidents such as gas explosions and gas outbursts not only pose severe threats to the safety of miners but also result in substantial economic losses and social impacts [
1].
With the increasing depth of coal mining and the growing complexity of mining conditions, the prevention and control of gas-related disasters have become increasingly challenging. Traditional safety management models, which primarily rely on human experience, are not only inefficient but also prone to safety loopholes caused by human negligence. Clearly, such approaches fail to meet the stringent requirements of modernized mine safety production [
2,
3,
4]. Consequently, there is an urgent need to develop an intelligent mine gas state decision-making system based on advanced artificial intelligence technology, which can significantly improve gas safety management and reduce accident rates.
This study is based on the deep integration and application expansion of existing technologies, and it has constructed an intelligent gas state judgment system for mining. This system combines the decision-making capabilities of LLMs [
5,
6] with the collaborative intelligence of multi-agent systems [
7]. It also incorporates various technologies, including knowledge base construction [
8], retrieval-augmented generation (RAG), human feedback mechanisms [
9], tool management [
10], prompt engineering [
11], and asynchronous processing. This comprehensive application approach promotes the innovative use of LLM-based multi-agent systems in the vertical field of mining safety production, providing new perspectives and methods for the intelligent development of mining safety.
The core of this paper lies in the design of a hybrid multi-agent orchestration algorithm, which cleverly integrates centralized and decentralized strategies to enhance the system’s adaptability and responsiveness in complex mining environments. Through this algorithm, the system can more accurately monitor gas states and issue warnings, thereby achieving an intelligent upgrade that includes functionalities such as user management, file operations, voice assistance, alarm inquiries, intelligent Q&A, smart judgment, and automated generation of mining safety production reports. These advancements not only improve the efficiency of gas safety management but also provide a more solid technical foundation for mining safety production, contributing to the protection of miners’ safety and the sustainable development of the mining economy.
2. Related Work
In the Intelligent Mine Gas State Decision-Making System, the research and application of gas monitoring technology are crucial, as they are directly related to the system’s effectiveness and reliability. In recent years, with the rapid advancement of information technology, artificial intelligence, and big data, mine gas monitoring technologies have gained new momentum and development pathways. The integration and application of these emerging technologies have not only enhanced the accuracy and real-time capabilities of gas detection but also provided effective technical support to cope with unexpected safety hazards. Furthermore, with the introduction of LLMs and multi-agent systems, their potential in mine safety management is progressively being harnessed, providing a theoretical foundation for more efficient safety monitoring and decision-making support. This study will subsequently provide a detailed exposition of the development of mine gas monitoring technologies and the current state of research on LLMs and multi-agent systems.
2.1. Development of Mine Gas Monitoring Technology
Mine gas safety monitoring, as a core research area in the mining sector, aims to achieve precise monitoring of gas concentrations through the integration of advanced technological methods and management strategies, effectively preventing gas-related incidents to ensure the safety of miners and the security of mining assets. With the rapid advancement of information technology, intelligent detection has gradually become a vital approach to enhancing the level of mine gas safety monitoring.
In recent years, scholars, both domestically and internationally, have conducted extensive and in-depth research in the field of intelligent mine gas safety monitoring. Wang et al. [
12] introduced digital twin technology as an innovative approach to intelligent management, creating a digital replica of the physical mining entity. This technology facilitates real-time monitoring, behavior simulation, and performance prediction of the mining production environment. It can accurately identify potential gas accumulation and leakage risks, offering a new perspective and efficient tools for mine gas safety monitoring. In the realm of big data analysis technology [
13,
14,
15], researchers have conducted deep mining and analysis of vast amounts of gas monitoring data, uncovering patterns and trends in gas emissions. This provides a scientific basis for judgment in gas safety monitoring and significantly enhances the precision and efficiency of gas safety detection. In the domain of artificial intelligence and machine learning technologies, Niu et al. [
16] developed a risk assessment model for unsafe behaviors in coal mine gas explosion accidents, based on the HFACS-GE framework and Bayesian networks. This model identifies risk paths and key factors, providing technical support for gas explosion risk management. Wang et al. [
17] proposed a prediction method for coal and gas outbursts based on GWO-SVM and optimized the parameters using the random forest algorithm, thereby enhancing prediction accuracy and robustness. The application of these technologies enables deep learning and pattern recognition of coal mine safety data, allowing for effective prediction and evaluation of safety risks. This provides timely safety warnings for mining enterprises, helping to reduce incident rates. Furthermore, the integration of the Internet of Things (IoT) technology [
18,
19,
20,
21] in mine safety production management has achieved interconnectivity among equipment, sensors, and systems. By collecting and transmitting gas data in real time, IoT offers reliable data support for gas safety monitoring, enabling mining companies to precisely monitor gas conditions and promptly respond to anomalies.
Despite the positive impact of the aforementioned technologies on mine gas safety monitoring, the current level of intelligence in research still needs to be enhanced. While some systems have begun integrating artificial intelligence technologies, there remains room for improvement, especially in areas such as data processing, in-depth analysis, and decision support. The functionalities of these systems require further strengthening and optimization.
2.2. Research Status of LLMs and Multi-Agent System
In recent years, LLMs have rapidly emerged as a focal point of research in the field of natural language processing (NLP). These models demonstrate exceptional capabilities in natural language understanding, reasoning, decision-making, and text generation. As research has progressed, significant advancements have been made in the study of LLMs, with numerous innovative techniques being developed to enhance their performance and broaden their application scope.
The introduction of the Transformer architecture [
22] has laid the foundation for the development of LLMs, significantly enhancing the model’s ability to handle long-range dependencies through the self-attention mechanism. The application of LangChain [
23] technology provides tools and framework support for LLMs, enabling the models to integrate external data and functions more efficiently when handling complex tasks, thereby improving the accuracy and diversity of problem-solving. The combination of retrieval-augmented generation (RAG) technology allows LLMs to leverage external knowledge bases during text generation, enhancing the precision and richness of the generated text. Additionally, research on pre-training and fine-tuning strategies [
24] is also a crucial direction in the field of LLMs. Through pre-training on large-scale corpora, LLMs can learn rich language representations, while fine-tuning specific tasks further improves the model’s adaptability to particular domains.
The proposal of multi-agent systems (MAS) [
25] offers new insights for the further optimization of LLMs. A multi-agent system is a distributed system composed of multiple autonomous agents that can be used to solve complex problems through collaboration and competition among the agents. Currently, research on the application of multi-agent structures in the LLMs domain is still in its infancy, but some preliminary achievements have been made. Researchers are exploring ways to effectively combine multi-agent systems into LLMs to address collaboration and decision-making challenges in complex tasks. For instance, the extended coevolution theory proposed by de Zarzà et al. [
26] focuses on studying the behaviors and interactions of different entities in dynamic environments, highlighting the potential of LLMs in facilitating collaboration in multi-agent systems. The AutoGen framework developed by Wu et al. [
27] allows multiple agents to collaborate via LLMs, supporting flexible dialogue patterns, with empirical studies demonstrating its effectiveness across various domains. This lays the foundation for complex LLMs-based applications, showcasing how multi-agent systems can leverage LLMs capabilities to enhance task execution. Li et al. [
28] conducted a comprehensive survey on LLM-based multi-agent systems, proposing a unified workflow framework encompassing key components and revealing their wide applications in problem-solving and world modeling. They also discussed the current challenges and future directions in this field.
As technology continues to mature, LLM-based multi-agent systems have been widely applied across various industries, with their influence continually expanding. In the healthcare sector, their applications are primarily focused on areas such as diagnostic assistance [
29], telemedicine [
30], and clinical trial screening [
31]. They have also demonstrated significant capabilities in bioinformatics. For example, the BRAD digital assistant developed by Pickard et al. [
32] can automate bioinformatics workflows. In the field of cybersecurity, their applications cover various aspects, including automated penetration testing, security analysis, and threat intelligence [
33,
34,
35]. In chemical research, their potential is evident in advancing autonomous chemical research [
36].
In the field of coal mine safety management, researchers have attempted to apply LLM-based multi-agent systems to safety information retrieval and intelligent mining. Li et al. [
37] explored the application of multi-agent systems in autonomous driving technology for open-pit mines. Rivera et al. [
38] utilized LLMs for coal mining question-and-answer systems, while Zhu et al. [
39] developed a coal mine safety information query system based on an LLM-based multi-agent system. Moreover, Cao et al. [
40] developed a multi-agent system model (XCoalChat) for coal mine equipment maintenance. These studies suggest that LLM-based multi-agent systems hold significant potential in the realm of coal mine safety management, enhancing the efficiency of information retrieval, supporting decision-making processes, and advancing intelligent mining technologies.
However, despite some progress in the application of LLM-based multi-agent systems in coal mine safety management, these applications remain largely limited to specific scenarios and tasks, lacking comprehensiveness and depth. For instance, current assessment systems often rely on simple rule-based judgments and lack a deep understanding and advanced analytical capabilities for complex safety issues, resulting in low accuracy and efficiency when addressing intricate safety problems. In addition, the current applications of LLMs in automated report generation are still inadequate, often relying on manual writing. This not only affects work efficiency but may also introduce subjective errors.
In light of this, this research will design a task orchestration algorithm suitable for multi-agent systems, achieving an organic integration of the central controller and local agent negotiations to enhance the efficiency and flexibility of task allocation. At the same time, by integrating LLM and other advanced technologies, a gas status assessment system will be constructed for mine safety production management. This system will feature intelligent question-and-answer capabilities, gas alarm assessment, and automatic report-generation functions. It will not only understand natural language queries and provide accurate answers to enhance user experience but also analyze gas concentration levels in depth to provide early warnings and decision support. Additionally, it will automatically extract key information to generate structured reports, significantly reducing the need for human intervention, improving the efficiency and accuracy of report generation, and enhancing the level of intelligence in mine safety production management.
3. Hybrid Multi-Agent Orchestration Algorithm
In the multi-agent-driven Intelligent Mine Gas State Decision-Making System, the task orchestration algorithm is a core component that directly impacts the system’s efficiency and accuracy. The mine environment is a typical complex dynamic system characterized by complexity, dynamism, and variability in local conditions. Although traditional centralized management systems excel in resource allocation, they often lack adaptability in complex environments, leading to slow responses. On the other hand, while distributed systems possess the ability to respond quickly, they face significant challenges in overall coordination, which can result in resource wastage. Therefore, this research adopts a hybrid multi-agent orchestration algorithm, aiming to combine the advantages of both centralized and distributed algorithms to achieve efficient and flexible task allocation and execution.
The algorithm adopts a hierarchical architecture, dividing tasks into global and local levels, as illustrated in
Figure 1. At the global level, a centralized algorithm is used for overall task planning, resource allocation, and coordination control, ensuring the smooth achievement of system objectives and optimized resource allocation. At the local level, a distributed algorithm is employed, allowing each agent to make autonomous decisions and execute tasks based on its perceived information and local objectives while exchanging information and collaborating with other agents to achieve local optimization and rapid response.
3.1. Problem Definition
In the Intelligent Mine Gas State Decision-Making System, multiple agents need to collaborate to complete tasks such as data collection, analysis, judgment, and report generation. Each agent possesses various capabilities, such as sensor data collection, alarm assessment, and report generation, as well as different resources. The goal of the hybrid multi-agent orchestration algorithm is to maximize task execution efficiency and resource utilization while satisfying task requirements and resource constraints.
Assume a network consisting of
N agents, where each agent possesses unique capabilities and resources. A workflow comprising
K tasks needs to be executed, with each task requiring specific types and quantities of resources. Moreover, each task is associated with a metric for token consumption and system stability. The objective is to determine a task allocation scheme that optimizes the overall quality in terms of execution time, token consumption, and system stability. Therefore, the objective function can be formulated as follows:
where:
denotes the number of agents, and denotes the number of tasks;
represents the time needed for Agent to perform task ; indicates the degree of contribution of Agent to task ; denotes the Token consumption of Agent for task ; signifies the system stability of Agent during the execution of task .
, and are weight parameters that balance the importance of execution time, token consumption, and the accuracy of the generated results, respectively.
The constraints are as follows:
Task Allocation Constraint: Each task must have at least one agent assigned to it.
Agent Resource Limitation: The total resources allocated by each agent across all tasks must not exceed the resources they possess.
Here, represents the capabilities and resources of Agent , and denotes the types and quantities of resources required by Agent to execute task .
Non-Negativity Constraint: The contribution level of an agent to a task must be non-negative.
3.2. Algorithm Design
This section provides a detailed explanation of the design principles and implementation steps for the hybrid multi-agent orchestration algorithm. The algorithm integrates centralized and distributed strategies through a layered architecture, aiming to achieve an organic combination of global optimization and local flexibility. The overall process of the algorithm is shown in Algorithm 1.
Algorithm 1. Pseudocode of the hybrid multi-agent orchestration algorithm (Hybrid Task Scheduling Algorithm). |
![Applsci 15 00968 i001]() |
The algorithm primarily consists of four stages: global-level planning, local-level allocation, task execution, and information interaction. During each stage, information is exchanged and processed among the agents to ensure the successful completion of tasks.
Global Level Planning: The central control unit
performs global task planning, resource allocation, and coordinated control based on the system’s overall objective function
. This process results in the formation of a global task allocation matrix,
, which is represented by the following formula:
Here, , , and represent the task execution time, the amount of Token consumption, and the system stability, respectively.
Local-Level Allocation: Each agent, based on the global-level task allocation matrix
and its own perceived information performs local task allocation to generate the local-level task allocation matrix
. This is expressed using the following formula:
Here, represents the local objective function for Agent , and denotes the perceived information of Agent .
Task Execution: Each agent executes tasks based on the local-level task allocation matrix while simultaneously exchanging information and collaborating with other agents. The content of the information exchange includes the following:
Task Execution Progress: Agents periodically exchange information on task execution progress to keep track of each other’s work status.
Local Environmental Status: Agents share information about the local environmental conditions, such as sensor readings, equipment status, and so on.
Resource Utilization: Agents exchange information regarding resource usage, such as the amount of tokens used.
Iterative Optimization: Based on the task execution results and information exchange outcomes, the task allocation strategies at both the global and local levels are iteratively optimized until the termination condition is met. This can be expressed with the following formula:
This collaborative approach can enhance task execution efficiency. Firstly, information exchange helps agents understand each other’s work status and resource utilization, allowing for better coordination in task execution and avoiding resource wastage and conflicts. Secondly, collaboration enables each agent to leverage its strengths to collectively complete complex tasks, thereby improving overall task execution efficiency. For instance, when an agent encounters resource shortages, it can request assistance from other agents through information exchange and collaboration, thus preventing task failure.
Taking the handling of gas detection events as an example, the central control unit decomposes the alarm event into multiple subtasks and assigns these subtasks to different agents. One agent is responsible for collecting sensor data, another agent analyzes the data to determine whether an alarm should be triggered, and yet another agent generates the alarm report. These agents exchange information such as sensor data, analysis results, and report content, and collaborate to ensure that the tasks are completed smoothly. Without information exchange and collaboration, each agent would have to work independently, leading to inefficiency and a higher likelihood of errors.
4. Construction of the Intelligent Mine Gas State Decision-Making System
4.1. System Design
In the design of the Intelligent Mine Gas State Decision-Making System, the choice of architecture is crucial. A modular architecture can enhance the system’s flexibility and scalability, but it may also lead to increased complexity and affect data processing speed. While a single-layer structure is simple and easy to understand, it lacks modularity and struggles to adapt to future changes in requirements. Therefore, considering the system’s complexity and future expansion needs, we opted for a layered architecture. The layered architecture clearly delineates system functional modules, improving maintainability and scalability. It breaks down complexity, allowing each layer to be independently optimized, thereby enhancing overall system performance and user experience.
The layered architecture in this study is divided into three main levels: the data layer, the core layer, and the application layer, as illustrated in
Figure 2. The purpose of this layering is to ensure accurate data collection, secure storage, and efficient processing, thereby guaranteeing the stable operation and high performance of the system.
Data Layer: Responsible for collecting and integrating data sources related to gas safety production in mines and establishing a database to store and manage this critical information. The data layer ensures the integration of different data sources by standardizing data formats and interfaces, thereby enhancing the accuracy and consistency of the data. Through the comprehensive processing of this data, the data layer provides a rich and reliable information foundation for in-depth analysis and decision-making within the system.
Core Layer: Serving as the intelligent core of the system, the LLMs undertake the critical task of advanced data processing and analysis. The LLM system integrates various technical modules, including agent workflow settings, prompt templates, tool management, memory management, human feedback retrieval-augmented generation, and asynchronous processing, to handle user queries or analyze data. It searches for relevant information in the knowledge base and generates responses based on the retrieved information set. By leveraging the powerful natural language understanding, text generation, and decision-making capabilities of LLMs, the core layer enhances the speed of data analysis and effectively responds to user queries.
Application Layer: The application layer serves as the direct interface for user interaction with the system, offering a range of practical functions, including user management, file operations, alarm queries, intelligent Q&A, smart assessments, report generation, and voice assistance. The system features a graphical user interface that is easy to operate, allowing users to perform various tasks seamlessly. Additionally, the system provides data visualization capabilities, making trends in gas concentration changes and alarm information clear and accessible for real-time monitoring and analysis. Through its intuitive interface design and intelligent recommendation features, the application layer enhances user convenience, enabling users to quickly access the information they need and efficiently manage gas safety.
Through this layered architecture design, the system can effectively handle data related to mine safety production and provide corresponding services based on different user needs. Furthermore, this design approach facilitates system expansion and maintenance, creating conditions for future improvements and updates.
4.2. Data Layer
The foundation of building the Intelligent Mine Gas State Decision-Making System lies in the extensive collection of mine safety production data. The details of the system’s data collection are presented in
Table 1. To enhance data quality, a series of preprocessing operations, including deduplication, error correction, and outlier elimination, were performed on the collected data. These data collection and preprocessing efforts provide a rich and high-quality data resource for the Intelligent Mine Gas State Decision-Making System.
In terms of real-time data acquisition, the system interacts with mine sensors through standardized API interfaces. The sensors continuously monitor gas concentrations and transmit the detected data to the system in JSON format. Upon receiving this real-time data, the system immediately performs preprocessing to ensure the accuracy and consistency of the data. This real-time data acquisition mechanism enables the system to respond promptly to changes in gas concentrations, providing a reliable basis for decision-making.
To address the diverse data storage needs, a multi-faceted database strategy has been employed, incorporating both relational and vector databases to tackle the challenges of storing structured and unstructured data. The relational database is primarily used for storing structured data, such as basic information about the coal mine and alarm records. In contrast, the vector database is responsible for storing unstructured data, including alarm determination criteria, processing methods, log files, and reports.
To better accommodate data processing needs, a separate storage design strategy has been adopted, creating three specialized vector databases, each optimized for specific data types and application scenarios. The first vector database is dedicated to storing the specific ranges and standards for gas exceedance alarms in various parts of the coal mine, providing a direct basis for gas alarm judgments. The second vector database contains standardized safety protocols and operating guidelines, which are crucial for formulating specific measures in response to different alarm situations. The third vector database is responsible for storing historical alarm event records, which serve as the foundation for generating reports and analyzing historical trends. This storage design strategy significantly enhances data retrieval efficiency and ensures the system’s high responsiveness when processing large volumes of data.
4.3. Core Layer
As a core component, the decision-making model is responsible for the intricate task of understanding, analyzing, and evaluating vast amounts of data. As shown in
Figure 3, this study employs LLMs for the decision-making process, leveraging their robust capabilities in comprehension, decision-making, and generation to achieve efficient and accurate gas status assessments. The model integrates various technical modules, including knowledge base construction, agent workflow design, prompt templates, tool management, memory management, and human feedback retrieval-augmented generation. It processes user queries or analyzes data by searching for relevant information within the knowledge base and generating responses based on the retrieved information set.
4.3.1. Agent Workflow Design
This study employs the hybrid multi-agent orchestration algorithm to construct the workflow for LLMs, realized through the LangGraph library, to ensure that these models perform tasks efficiently and orderly. The architecture divides functionalities into different hierarchical levels, primarily constituting two core levels: the central control level and the local control level. These levels collectively form the management framework of the system, each bearing distinct responsibilities and functionalities.
The central control level consists of a unique Supervisor Agent, which acts as the “brain” of the system, responsible for transmitting the status information of various modules and deciding the next steps for data routing and task allocation based on the current situation. This centralized control method ensures efficient coordination and response within the system.
The local control level is composed of multiple specialized modules, each focusing on performing tasks within its specific domain. These modules include the alarm judgment module, the measure suggestion module, and the report generation module, each assigned to dedicated Agents responsible for realizing specific functions.
To meet the demands of gas monitoring in mining, this study has designed the following functional modules at the local control layer:
Alarm Judgment Module: This module monitors gas concentration in real time, comparing it with predefined safety thresholds to determine whether an alarm should be triggered. While processing sensor data, it extracts key information and queries the relevant safety thresholds; when addressing user inquiries, it leverages LLMs to understand the intent and provide evaluation results.
Measures Suggestion Module: Based on alarm judgment results, this module automatically generates targeted measures and suggestions to guide coal mine safety management. Upon receiving alarm information, it analyzes the cause and severity, making recommendations such as enhanced monitoring and operational adjustments. It supports output in both text and JSON data formats.
Report Generation Module: This module analyzes historical alarm data to generate structured reports for decision support. It extracts key information for in-depth analysis and visualization, including accident overviews and cause analysis. By integrating ARIMA and LLM models, it performs alarm predictions to identify potential risks in advance.
Each level comprises multiple Agents, and the scheduling process among Agents follows LangGraph’s hierarchical management structure, presented in a graphical workflow format, as shown in
Figure 4. The execution sequence starts from the top level and progresses downward sequentially. The top-level Agent triggers the next level’s Agents in an orderly manner, and each level’s Agents pass the task to the subsequent level after completing their own tasks. Within the same level, the execution order of the Agents is determined based on specific requirements.
4.3.2. Prompt Templates
To enhance the intelligence level of Agents within the Intelligent Mine Gas State Decision-Making System, this study employs Zero-shot Prompting and Few-shot Prompting techniques to design prompt templates. These templates aim to guide Agents to understand and execute tasks more accurately. By utilizing these prompt templates, the system can effectively direct Agents to perform tasks even in the absence of extensive training data, thereby improving the system’s adaptability and intelligence.
4.3.3. Tool Management
Throughout the entire workflow, various tools are employed, including but not limited to data reading tools, visualization tools, and document storage tools. To ensure these tools can be effectively managed and utilized, dedicated function tools have been defined, each with clear interfaces and functionalities for easy integration with Agents. For example, the data reading tool is responsible for receiving real-time data from sensors, the visualization tool handles the graphical representation of data analysis results, and the document storage tool is used to save report content in specific file formats. Based on the responsibilities and task requirements of each Agent, the corresponding function tools are bound accordingly. When handling specific tasks, Agents invoke these tools through an execution chain.
In this way, the efficient utilization of tools is ensured, while also enhancing the automation level and flexibility of Agents when executing complex tasks. The standardization of tool management not only improves the quality of report generation but also lays the foundation for the continuous optimization and expansion of the gas status judgment system.
4.3.4. Memory Management
This study employs the MemorySaver class built into the LangGraph framework to manage conversation history. This class provides a mechanism that allows developers to track and store dialog information, which is crucial for the workflow of agents using LLMs. Specifically, the MemorySaver class maintains context coherency by tracking conversation history, enabling seamless continuation of conversations without starting over, especially in lengthy dialogs. Additionally, as the conversation progresses, the accumulation of historical records can lead to an overly large context window. MemorySaver offers methods to manage these records, preventing issues associated with oversized context windows, such as increased model invocation costs and duration, as well as potential errors. Through memory management, the workflow of agents interacting with large language models is both efficient and accurate.
4.3.5. Human Feedback-Retrieval Augmented Generation
Although the Intelligent Mine Gas State Decision-Making System has significant advantages in improving efficiency and safety, it may also lead to an increased dependency on the system by users, thereby affecting their judgment abilities. To address this conflict, this study employs a human feedback-based RAG strategy, which is developed from the traditional RAG model. The core of this approach lies in the introduction of a key component: human feedback interruption.
Under this mechanism, the system strategically interrupts the retrieval and generation process, presenting intermediate results to human experts. These experts assess the relevance and accuracy of the retrieval or generation results based on the context of alert events and system requirements. The system proceeds with subsequent generation steps only when the experts confirm that the results are relevant and accurate.
By implementing this human feedback interruption mechanism, the retrieval-augmented generation technique in this study not only optimizes the efficiency of data processing and retrieval but also ensures the practicality and reliability of the output results.
4.3.6. Asynchronous Processing
When processing data with LLMs, there can be potential response delay issues, especially under high-concurrency user requests. To reduce latency, an asynchronous message queue is employed to handle user requests and data processing tasks. User requests are quickly placed into the queue, allowing the system’s worker threads to asynchronously read and process requests from the queue. This approach enables users to receive prompt feedback after submitting their requests, without having to wait for the processing to complete.
As the number of users and the volume of data increase, the system’s load also rises. To address this challenge, the asynchronous processing dynamically adjusts the number of worker threads based on the actual load. By utilizing load balancing techniques, requests are distributed across multiple processing nodes, enabling horizontal scaling. This design not only enhances the system’s throughput but also improves its stability.
4.4. Application Layer
User interaction with the system primarily occurs through an intuitive graphical user interface (GUI). This interface integrates multiple functional modules, including alarm queries, intelligent Q&A, and report generation, allowing users to easily access real-time gas concentration data, historical alarm records, and relevant regulatory information, facilitating in-depth data analysis and decision-making. The system also supports voice recognition functionality, enabling users to perform queries and operations via voice commands, further enhancing usability.
In practical operation, after logging into the system, users can quickly understand the current gas concentration, alarm status, and historical trend charts through the dashboard. When an alarm occurs, the system immediately triggers an alert and provides recommended measures. Users can document and process alarm events to ensure traceability. Additionally, the system can regularly generate safety reports and store them in the safety management system, supporting management in conducting overall safety assessments.
To facilitate integration with existing mine management systems, the application layer provides standardized API interfaces. This integration mechanism enables the system to obtain key operational data from the mine in real time and feedback gas monitoring results and alarm information to the mine management program, ensuring bidirectional data flow and enhancing the timeliness and accuracy of decision-making.
5. Experiments
The experimental design and evaluation analysis phase is a crucial step in verifying the effectiveness and reliability of the system. The following sections will provide a detailed introduction to the experimental setup, the selection of evaluation metrics, the statistical analysis of the experimental results, and an in-depth discussion based on these results.
5.1. Experimental Setup
This study employs the Visual Studio Code (VS Code) integrated development environment for system development. For database selection, a lightweight SQLite3 relational database and Chroma vector database are employed to reduce the complexity of data storage and management. The backend development utilizes the Python programming language, combined with the Flask lightweight framework, to construct RESTful APIs and services. The frontend development is based on the Vue.js framework, which integrates CSS, JavaScript, and HTML technologies to achieve user interface design and interactive functionality.
To test the performance of the Intelligent Mine Gas State Decision-Making System, an experimental dataset comprising over 1000 sets of coal mine gas concentration data were constructed. This dataset includes information such as the name of the coal mine, the installation location of monitoring equipment, maximum concentration values, measurement units, monitoring start time, end time, and monitoring duration, providing a comprehensive depiction of the data characteristics for gas concentration monitoring. The data comes from multiple different coal mines, encompassing various monitoring devices and mining conditions, reflecting the diversity encountered in practical applications to some extent. Future research plans will include expanding the dataset size and considering collaborations with more coal mines to further enhance the representativeness of the data.
5.2. Evaluation Metrics
To comprehensively assess the performance of the Intelligent Mine Gas State Decision-Making System, this study adopts a multidimensional comprehensive evaluation strategy. This strategy combines performance evaluation with expert review, aiming to reveal the system’s performance characteristics, strengths, and potential areas for improvement from multiple perspectives. The detailed setup of the evaluation metrics is as follows.
5.2.1. Performance Evaluation
The evaluation of the intelligent Q&A module and intelligent judgment focuses on consistency evaluation. This is measured by comparing the system’s responses to standard answers to assess the reliability and accuracy of the system’s responses.
Consistency Analysis: The consistency of the intelligent Q&A and intelligent judgment is evaluated by comparing the results of standard answers with those provided by the system. The evaluation metrics include the BLEU score and the BERT score. The BLEU score measures the level of lexical overlap between the generated text and the reference text, ranging from 0 to 1, with higher scores indicating higher accuracy of the generated text. The BERT score assesses the semantic similarity between the generated text and the reference text using the BERT model, also ranging from 0 to 1, where scores closer to 1 indicate better text quality.
The performance evaluation of the report generation module includes two aspects: overall quality and prediction accuracy. The overall quality evaluation examines the report’s performance across multiple dimensions, including response latency, content accuracy, and richness. This comprehensive evaluation method aims to thoroughly assess the module’s performance, ensuring its effectiveness and reliability in practical applications. The prediction accuracy evaluation focuses on the predictions provided in the report about future trends or events. By comparing actual results with predicted content, the system’s forecasting capability is measured, offering scientific and accurate decision-making support for mine safety management.
Overall Quality Analysis: The evaluation metrics include Token Usage, Waiting time, Grammar Errors, and Diversity Score. Grammar Errors are detected by introducing the language_tool_python library. Language_tool_python is an open-source grammar-checking tool that supports multiple languages and allows for custom rules. It takes the system-generated report as input and records the number and types of detected grammar errors to assess the grammatical accuracy of the text. The score ranges from 0 to 1, where 0 indicates no grammar errors, and an ideal score should be less than 0.05, indicating a high level of grammatical accuracy in the text. The Diversity Score quantifies the text’s diversity to evaluate the innovation and richness of the system’s generated content, with a score range from 0 to 1, where 0 represents no diversity in the content, and 1 represents very high diversity.
Alarm Prediction Accuracy Analysis: The evaluation metrics include Accuracy, Recall, F1 Score, and Coverage of Prediction Results. Accuracy measures the correctness of predictions, Recall reflects the comprehensiveness and coverage of the predicted results, and the F1 Score provides a balanced evaluation of prediction accuracy and recall capabilities.
5.2.2. Expert Review
Given the limitations of automated evaluation tools in handling long texts and complex content, this study adopts a more professional evaluation method—expert review. Fifteen experts with extensive experience and expertise in the field of coal mine risk assessment were invited to participate in this review. These experts not only possess a deep theoretical foundation within the industry but also have practical experience in risk assessment and safety management, enabling them to comprehensively evaluate the system’s responses from multiple dimensions. The experts will compare the system-generated reports with standard reports based on established scoring criteria and provide scores accordingly. The total score is 100 points, and the scoring criteria are detailed in
Table 2.
This comprehensive evaluation approach allows for a more accurate assessment of the report generation module’s performance and helps identify its strengths and areas for improvement in practical applications.
5.3. Function Evaluation
The experiment focuses on evaluating the three core functional modules of the system: intelligent Q&A, intelligent judgment, and report generation. ChatGPT, with versions GPT-3.5-turbo, GPT-4, and GPT-4o, was utilized as the benchmark LLM model for this assessment. The corresponding website for accessing ChatGPT is
https://chat.openai.com/, accessed on 19 December 2024. To reduce the impact of randomness on the results, the model’s temperature parameter was set to 0, ensuring output consistency.
A specific scenario was selected to test the practical application effectiveness of the intelligent Q&A module. The test question was: “The gas sensor is installed at the return corner of the coalface, with the sensor number T0. The current gas concentration is 1.6%. Should an alarm be triggered? If an alarm is required, please provide corresponding handling suggestions”.
Figure 5 shows the responses from different models to this question, with key information highlighted using black, bold underlines.
The intelligent assessment module obtains real-time data through sensors, including key information such as the name of the coal mine, type of measurement point, installation location, and maximum concentration values. The acquired data can consist of single or multiple entries.
Figure 6 shows the output results of the intelligent assessment in JSON format.
The performance evaluation results are shown in
Table 3. In both the intelligent question answering and intelligent assessment modules, the BLEU and BERT scores of the three models all performed excellently, indicating a high degree of matching between the system-generated answers and the standard answers.
This result confirms the system’s consistency in understanding and responding to complex safety production issues. Additionally, the report generation module performs excellently in terms of wait time; the error rate for Grammar Errors is maintained at an extremely low level, reflecting high textual accuracy; and the Diversity Score meets the expected standards, indicating good diversity in content generation. These data suggest that the system exhibits high efficiency and quality in report generation. Notably, the GPT-4o model demonstrates superior performance across the three key modules of intelligent Q&A, intelligent judgment, and report generation.
To evaluate the performance of the alarm prediction module, accuracy, recall, and F1 score were used as assessment metrics. The comparison results between the system’s alarm prediction module and traditional time series prediction models are presented in
Table 4.
The alarm prediction model of the Intelligent Mine Gas State Decision-Making System outperforms traditional time series prediction models in overall performance, particularly in terms of accuracy. However, its prediction coverage is relatively low, indicating that the system may only predict a portion of the actual alarm events. This may be due to the limited understanding of certain alarms caused by the LLM model or the ARIMA model’s failure to comprehensively capture the patterns of alarm events.
To further assess the quality of the generated reports, 15 experts in the field of coal mine risk assessment were invited to evaluate the report generation module. The evaluation criteria covered multiple dimensions.
As shown in
Figure 7, the average score for GPT3-turbo was 78 points. Experts noted that the system-generated reports performed well in terms of structure and language expression but suggested improvements in content completeness. When using the GPT4 model, the system’s average score increased to 83 points, with experts positively commenting on the report’s structure and completeness. With the GPT-4o model, the system achieved the highest average score of 89 points, with experts acknowledging that the reports reached a high level of content completeness and clarity of expression.
Compared to the traditional manual writing process, the system reduces the report writing time from an average of 1 h to approximately 1 min, significantly enhancing work efficiency. This allows mining enterprises to quickly obtain safety production reports, promptly understand the safety production status, and take necessary measures. Furthermore, the automatically generated reports meet preset standards in terms of textual accuracy and content diversity. By analyzing and integrating vast amounts of safety data, the system produces comprehensive and detailed report content, minimizing the oversights or errors that may occur in manual writing.
5.4. Evaluation of Orchestration Algorithms
To validate the effectiveness of the hybrid agent orchestration algorithm, a comparative experiment was designed to compare the hybrid algorithm with centralized and distributed algorithms. The evaluation utilized the GPT-4o model and employed a Multi-Criteria Decision-Making (MCDM) model to quantitatively assess the performance of different orchestration algorithms.
During the evaluation process, the following indicators were established, and corresponding weights were assigned to each indicator:
Alarm Judgment Response Time (Weight: 0.10): The average response time of the system to alarm requests. Scores are calculated based on the ratio of the actual response time to the maximum preset time—the shorter the response time, the higher the score.
Judgment Accuracy (Weight: 0.30): The accuracy of the Gas Alarm Assessment. Scores are directly proportional to accuracy—the higher the accuracy, the higher the score.
Report Generation Time (Weight: 0.10): The average time required to generate a complete report. Scores are calculated based on the ratio of the actual generation time to the maximum preset time—the shorter the generation time, the higher the score.
Overall Report Quality (Weight: 0.30): The quality of the report is assessed through expert scoring or user feedback. Scores are directly proportional to the actual ratings of the report—the higher the rating, the higher the score.
Token Utilization (Weight: 0.20): The number of tokens consumed by the system to process the requests. Scores are calculated based on the ratio of the actual token usage to the maximum preset token amount—the fewer the tokens used, the higher the score.
The formula for calculating the comprehensive score is as follows:
where
is the comprehensive score,
is the weight of the
-th indicator, and
is the score of the
-th indicator.
To comprehensively evaluate the performance of the multi-agent hybrid orchestration algorithm compared to distributed and centralized algorithms, simulation experiments based on a virtual environment were conducted. This environment simulates the performance of different algorithms in handling alarm requests. The maximum preset alarm judgment response time was set to 40 s, the maximum preset generation time to 120 s, and the maximum token count to 30,000.
By analyzing the experimental data under different orchestration algorithms, the results are presented in
Table 5.
The final score calculation results are as follows: the comprehensive score of the distributed algorithm is 0.7674, the comprehensive score of the centralized algorithm is 0.6752, and the comprehensive score of the hybrid algorithm is 0.7921.
There are significant differences in the performance of different orchestration algorithms across various indicators. Specifically, the distributed algorithm is fast and consumes less but has lower fault tolerance and correctness rates; the centralized algorithm has high fault tolerance and correctness rates but is slow and consumes more; the hybrid algorithm balances the advantages and disadvantages of the first two.
In summary, the effectiveness of the hybrid agent orchestration algorithm in mine gas monitoring has been validated, providing a theoretical basis and empirical support for future research.
5.5. Discussion
The Intelligent Mine Gas State Decision-Making System developed in this study demonstrates excellent performance in intelligent Q&A, intelligent judgment, and report generation, providing robust technical support for mine safety management.
In terms of functionality, the experimental data show that the system achieves a high level of accuracy and consistency in intelligent Q&A, demonstrating its ability to accurately understand and respond to complex safety production issues. The intelligent judgment module exhibits efficient decision-making and data processing capabilities, capable of making accurate alarm judgments based on real-time gas data and providing reasons for alarms along with handling suggestions. This is crucial for the early prevention and timely management of potential safety hazards. Regarding report generation, the automatic report generation module significantly reduces the time required compared to traditional manual report writing, which is critical for the quick response needs in mine safety management. Additionally, the automatically generated reports maintain a very low level of grammatical errors, outperforming potentially error-prone manual reports due to human factors, and excel in textual accuracy.
Moreover, the experimental results indicate that the hybrid multi-agent orchestration algorithm adopted by the system outperforms single centralized or distributed algorithms across various performance metrics, fully validating its effectiveness and superiority. While centralized algorithms ensure orderly task execution and rational resource utilization, their lack of flexibility may impede response speed and efficiency when dealing with complex and dynamic local environments. In contrast, distributed algorithms are capable of quick responses and adapting to environmental changes but may face difficulties in coordinating overall tasks, resulting in inconsistencies and inaccuracies. The hybrid multi-agent orchestration algorithm implemented in the system effectively combines the advantages of both centralized and distributed algorithms, achieving an organic integration of global task planning and local task execution.
However, the system also has some limitations. Firstly, while the use of large language models (LLMs) has enhanced the overall performance of the system, it also increases system complexity and operational costs, suggesting the need for further optimization of response time. Secondly, although the experimental results indicate that the system performs well in a simulated experimental environment, the lack of information from tests conducted in actual mining conditions limits a comprehensive assessment of the system’s performance under dynamic and complex conditions. Furthermore, the accuracy of the report prediction component needs improvement. The current approach combines only simple time series models with LLMs, and the predictive results are not yet ideal. Lastly, existing automatic evaluation tools have limitations in processing lengthy answers, and reliance on expert evaluation may introduce subjective bias.
To overcome the existing limitations, future research can focus on the following improvement directions:
Lightweight LLM Model Research: Explore key technologies such as model compression, quantization, and fine-tuning to reduce model complexity, enhance system response speed, and effectively lower operational costs while ensuring model performance.
Actual Environment Testing: Design and implement system tests in a real mining environment to comprehensively assess its performance under dynamic and complex conditions. This can be achieved through collaboration with coal mining companies to conduct on-site pilot projects, ensuring that the system can adapt to various challenges encountered in actual operations.
Construction of Complex Prediction Models: Integrate deep learning and other technologies to build more accurate prediction models, improving the accuracy and reliability of predictive results.
Development of Automatic Evaluation Tools: Employ natural language processing techniques to develop advanced automatic evaluation tools, enabling automated assessment of lengthy answers and enhancing the objectivity and accuracy of the evaluation process.
Through these improvements, the system will be better equipped to adapt to diverse application scenarios, providing more robust support for mine safety management.
6. Conclusions
This study focuses on the exploratory application in the field of mining safety and successfully constructed the Intelligent Mine Gas State Decision-Making System. By integrating LLMs with the hybrid multi-agent orchestration algorithm, the system enables rapid retrieval, intelligent analysis, and automatic generation of reports for mine safety production gas data, significantly improving the efficiency and level of mine safety management. The main contributions of this study are as follows:
Effectiveness of the Multi-Agent Orchestration Algorithm: This study designed a task orchestration algorithm suitable for multi-agent systems, achieving an organic integration of central controller coordination and local Agent negotiation. Experimental validation demonstrated that the algorithm exhibits significant advantages in task allocation efficiency and flexibility, effectively enhancing the collaborative working capability of the multi-agent system.
Multi-technology Integration: This study combines various technologies, including LLM with agent workflow settings, prompt templates, tool management, memory management, human feedback retrieval-enhanced generation, and asynchronous processing. This integration fully leverages the advantages of LLM in natural language understanding, reasoning, decision-making, and text generation, as well as the collaborative and competitive capabilities of multi-agent systems in solving complex problems. This approach to technology integration offers new insights for technological applications in the field of mine safety management, helping to address complex safety issues and enhance decision-making efficiency.
Intelligent Enhancement of the Intelligent Mine Gas State Decision-Making System: The Intelligent Mine Gas State Decision-Making System, built on multi-agent technology, achieved automation and intelligence in functions such as alarm analysis and judgment, intelligent Q&A, and report generation. The system demonstrated high accuracy and intelligence in practical applications, providing robust technical support for mine gas monitoring, early warning, and management.
In summary, the development and application of the Intelligent Mine Gas State Decision-Making System provide a practical tool for mine safety production management. This system can effectively enhance the efficiency of handling gas alarm events in mines and improve the quality of generated analysis reports, thereby offering substantial technical support for accident prevention and management in mines. Additionally, this study presents new ideas and methods for applying LLMs in the field of mine safety management, advancing the adoption and development of artificial intelligence technologies in this domain. In the future, we will further explore the application potential of the Intelligent Mine Gas State Decision-Making System and extend its use to safety management in other industries, contributing to the creation of safer and more efficient production environments.