# Research and Application of a Multi-Agent-Based Intelligent Mine Gas State Decision-Making System
## 4 Construction of the Intelligent Mine Gas State Decision-Making System
### Core Layer
#### 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:  
Figure 3: Schematic diagram of the LLMs workflow and knowledge base construction.  
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.