A layered graph enhancement and multi-agent-based production safety accident question and answer method and system

CN122220467BActive Publication Date: 2026-10-23SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610390757.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-27
Publication Date
2026-10-23
Estimated Expiration
2046-03-27

AI Technical Summary

Technical Problem

[0007]本发明公开了一种基于分层图增强与多智能体的生产安全事故问答方法及系统,旨在解决现有的KG-RAG技术在生产安全事故问答中存在语义粒度冲突、复杂因果追溯能力不足、大模型“幻觉”与查询代码生成错误的问题

Benefits of technology

[0043]本发明提出了一种分层因果图结构,通过细粒度的实例层与粗粒度的国家标准层的双层架构及映射函数,有效化解了知识图谱构建中的语义粒度冲突问题,既保留了事故场景的关键细节,支持微观因果追溯,又能实现跨案例的宏观统计聚合,提升了图谱的表达能力与适配性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122220467B_ABST
    Figure CN122220467B_ABST
Patent Text Reader

Abstract

The application discloses a production safety accident question and answer method and system based on layered graph enhancement and multiple agents, comprising data acquisition and preprocessing: acquiring production safety accident investigation report data, preprocessing the data and extracting accident related element information; layered causal diagram construction: constructing a layered causal diagram with a double-layer structure based on the extracted element information; multiple agent collaborative reasoning and question and answer generation: receiving a user natural language query and combining the layered causal diagram, generating a final question and answer result through the collaborative reasoning mechanism of four agents of graph analysis, question analysis, query generation and reasoning insight; the layered causal diagram structure and the multiple agent collaborative reasoning mechanism solve the semantic granularity conflict problem, overcome the limitations of traditional retrieval enhancement generation models in complex multi-factor coupled causal chain tracking, and especially in the deep mining of safety accident reasons and the macro statistical analysis scene, can provide scientific and reliable intelligent decision support.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence and natural language processing technology, specifically relating to a question-and-answer method and system for production safety accidents based on hierarchical graph enhancement and multi-agent technology. Background Technology

[0002] Accident investigation reports are invaluable data assets in production safety and emergency management. They comprehensively record the environmental factors, unsafe behaviors, and complex chain reactions that lead to accidents. Systematically analyzing large-scale accident report data helps researchers discover potential risk patterns and causal relationships. In recent years, the development of large-scale language models has enabled the automatic transformation of complex unstructured raw text into valuable safety evidence.

[0003] In specialized fields, retrieval augmentation (RAG) has become the mainstream paradigm to overcome the knowledge blind spots and "illusion" phenomena of large language models. Among them, knowledge graph-based retrieval augmentation (KG-RAG) is particularly effective, as it organizes domain knowledge into structured entities and relations, capturing explicit logical connections that are easily lost in unstructured vector spaces. However, when existing KG-RAG technologies are directly applied to causal question-answering tasks related to production safety accidents, they face two major challenges:

[0004] First, there is a semantic granularity balance problem in the graph construction stage. The causes of accidents are complex, and a single granularity graph cannot meet the diverse analysis needs. If a fine-grained graph is built based only on instance text (such as a node for "valve leakage"), it will lead to data sparsity and hinder macro-statistical clustering. On the other hand, if the data is only mapped to coarse-grained national standard categories (such as "defects in equipment, facilities, tools, and accessories"), key scenario-specific details will be lost, affecting the accuracy of causal tracing.

[0005] Secondly, causal tracing tasks suffer from logical complexity. Production safety accidents are usually the result of multiple risk factors coupled together, and causal chains have complex characteristics of long distance and multiple branches. However, existing KG-RAG methods mostly adopt a single-step retrieval paradigm, lacking a decomposition mechanism for complex queries and explicit modeling of long-distance logical dependencies. For example, existing structured semantic parsing generation models are prone to problems such as query code syntax errors and misunderstandings of graph structure when faced with complex causal graphs with a large number of heterogeneous relationships, leading to the failure of deep causal inference. Summary of the Invention

[0006] (1) Technical problems to be solved

[0007] This invention discloses a production safety accident question answering method and system based on hierarchical graph enhancement and multi-agent technology, aiming to solve the problems of semantic granularity conflict, insufficient ability to trace complex causality, large model "illusion" and query code generation errors in the existing KG-RAG technology for production safety accident question answering.

[0008] (2) Technical solution

[0009] This invention discloses a question-and-answer method for production safety accidents based on hierarchical graph enhancement and multi-agent systems, comprising the following steps:

[0010] Step 1, Data Acquisition and Preprocessing: Acquire production safety accident investigation report data, preprocess the data and extract accident-related element information. The element information is structured data containing accident metadata, accident causes and causal relationships.

[0011] Step 2, Hierarchical Cause-Effect Graph Construction: Based on the extracted element information, a hierarchical cause-effect graph with a two-layer architecture is constructed. The two-layer architecture includes a fine-grained instance layer and a coarse-grained national standard layer, realizing the association mapping between instance details and standard classification.

[0012] Step 3, Multi-agent Collaborative Reasoning and Question Answer Generation: Receive the user's natural language query and combine it with a hierarchical causal graph. Through the collaborative reasoning mechanism of four agents—graph parsing, question analysis, query generation, and reasoning insight—the user query's graph pattern parsing, intent decomposition, graph query execution, and integrated output are completed to obtain the final question answer result.

[0013] Furthermore, the accident metadata includes the time, location, industry, accident type, and consequences of the accident.

[0014] Furthermore, step 2 specifically includes the following steps:

[0015] Step 201, Entity normalization processing: Based on the preset location normalization table and cause category matching table, the entities in the structured data are normalized and aligned; wherein, location normalization maps the specific incident location to the provincial administrative division entity; cause category normalization maps the instance-level accident cause to the prescribed standard cause category;

[0016] Step 202, Basic graph structure construction: Construct a macro layer and a micro layer in the initialized hierarchical causal graph. Create accident instance nodes in the macro layer, and connect the accident occurrence time, location after normalization, industry, accident type and consequences in the accident metadata as standard nodes to the graph. Establish the association edges between the accident instance nodes and each standard node.

[0017] Step 203, Hierarchical Cause Association Construction: For each instance-level accident cause, an instance-level cause node is created in the micro layer, and a corresponding standard-level cause node is created in the macro layer based on the cause category normalization result. Causal trigger relationship edges from accident instance nodes to instance-level cause nodes, as well as subordinate classification relationship edges from instance-level cause nodes to standard-level cause nodes are established. At the same time, based on the extracted causal relationships, causal chain edges between instance-level cause nodes are established.

[0018] Furthermore, in step 2, the accident instance node does not establish a direct connection with the standard-level cause node, so as to ensure that the two-layer architecture of the hierarchical cause-effect graph is clear and logically rigorous, while supporting complete tracing and statistics from micro-instances to macro-standards.

[0019] Furthermore, step 3 includes the following steps:

[0020] Step 301, Graph Analysis Agent: Traverse the hierarchical causal graph, extract graph pattern information and generate graph pattern description;

[0021] Step 302, Problem Analysis Agent: Receives user queries and combines them with graph pattern descriptions to perform intent parsing and task decomposition, generating graph operation logic steps;

[0022] Step 303, query to generate intelligent agent: Based on the graph operation logic steps and graph pattern description, generate structured query code and obtain the corresponding structured search results;

[0023] Step 304, Reasoning and Insight Agent: Integrate structured search results and combine them with preset prompts from security experts to generate the final response.

[0024] Further, step 301 includes the following steps:

[0025] Step 30101: Traverse all nodes in the hierarchical cause-effect graph, extract and record all node type and attribute information;

[0026] Step 30102: Traverse all edges in the hierarchical cause-effect graph and extract the source node type, target node type, and the relationship type between them;

[0027] Step 30103: The extracted node types, attributes, and relationship types are concatenated to generate a graph pattern description string, providing a structural reference for downstream agents.

[0028] Further, step 302 includes the following steps:

[0029] Step 30201: Perform the intent parsing phase, cross-validate the core entities in the user's natural language query with the graph pattern description, and determine whether the graph data is sufficient to answer the query. If it exceeds the graph coverage, generate an explanatory response and terminate the search; otherwise, proceed to the task decomposition phase.

[0030] Step 30202 involves the task decomposition phase. For feasible queries, complex user queries are mapped layer by layer into a series of executable graph operation logic steps, including identifying core constraints and locating the corresponding node types.

[0031] Further, step 303 includes the following steps:

[0032] Step 30301: Dynamically generate executable query code for the graph database based on the generated graph operation logic steps;

[0033] Step 30302: Run the generated query code in the local sandbox to perform subgraph traversal, path finding, or statistical aggregation operations on the hierarchical cause-effect graph to obtain structured search results.

[0034] Further, step 304 includes the following steps:

[0035] Step 30401: Receive the original user natural language query and the structured search results output by the query generation agent;

[0036] Step 30402: Based on the preset prompts from security experts, the model is instructed to use the retrieved data as a basis to conduct in-depth analysis of causal patterns.

[0037] Step 30403 transforms the discrete structured search results into a semantically coherent and logically rigorous natural language deep analysis report, which serves as the final question-answering result output.

[0038] This invention also discloses a production safety accident question-answering system based on hierarchical graph enhancement and multi-agent technology, utilizing the above-described method, comprising:

[0039] The data acquisition and preprocessing module is used to acquire data from production safety accident investigation reports, preprocess the data, and extract accident-related information.

[0040] The hierarchical causal graph construction module is used to construct a hierarchical causal graph with a two-layer architecture, consisting of a fine-grained instance layer and a coarse-grained national standard layer, based on extracted feature information.

[0041] The multi-agent collaborative reasoning and question-answering generation module receives user natural language queries and combines them with a hierarchical causal graph. Through the collaborative reasoning mechanism of four agents—graph parsing, question analysis, query generation, and reasoning insight—it completes graph pattern parsing, intent decomposition, graph query execution, and integrated output to obtain the final question-answering result.

[0042] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0043] This invention proposes a hierarchical causal graph structure. Through a two-layer architecture of fine-grained instance layer and coarse-grained national standard layer and mapping function, it effectively resolves the semantic granularity conflict problem in knowledge graph construction. It not only preserves the key details of the accident scenario and supports micro-causal tracing, but also realizes macro-statistical aggregation across cases, thereby improving the expressive power and adaptability of the graph.

[0044] This invention also introduces a multi-agent collaborative reasoning mechanism, which decomposes complex security analysis tasks into a structured and controllable collaborative workflow, including four sub-tasks: graph pattern parsing, intent decomposition, graph query execution, and integrated output of question-and-answer results. These sub-tasks are executed by specialized agents, which significantly reduces the risk of syntax errors and logical confusion in generating complex query code from a single large model, improves the controllability and reliability of the reasoning process, effectively suppresses the "illusion" phenomenon of large language models, and provides scientific and interpretable intelligent support for risk assessment and emergency decision-making in the field of production safety. Attached Figure Description

[0045] Figure 1 is a schematic diagram of the overall process of the present invention;

[0046] Figure 2 is a schematic diagram of the hierarchical cause-effect graph construction process of the present invention;

[0047] Figure 3 is a schematic diagram of the multi-agent collaborative workflow in this invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention and technical theory. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0049] To better understand the technical content of this embodiment, the terms involved in this embodiment will be explained first:

[0050] Knowledge Graph: A semantic network that describes the objective world using a graph structure; essentially, it is a knowledge base that describes concepts, entities, and their relationships.

[0051] Cause-effect graphs are a special type or extension of knowledge graphs that focus on expressing causal relationships.

[0052] This invention proposes a question-and-answer method for production safety accidents based on hierarchical graph enhancement and multi-agent technology, referencing... Figure 1 This includes the following steps:

[0053] Step 1, Data Acquisition and Preprocessing: Acquire data from production safety accident investigation reports, preprocess the data, and extract accident-related information.

[0054] Step 2, Hierarchical Cause-Effect Graph Construction: Based on the extracted feature information, a hierarchical cause-effect graph (HC-Graph) with a two-layer architecture is constructed. The two-layer architecture includes a fine-grained instance layer and a coarse-grained national standard layer, realizing the association mapping between instance details and standard classification.

[0055] Step 3, Multi-agent Collaborative Reasoning and Question Answer Generation: Receive the user's natural language query and combine it with a hierarchical causal graph. Through the collaborative reasoning mechanism of four agents—graph parsing, question analysis, query generation, and reasoning insight—the user query's graph pattern parsing, intent decomposition, graph query execution, and integrated output are completed to obtain the final question answer result.

[0056] The following examples illustrate the question-and-answer method for production safety accidents based on hierarchical graph enhancement and multi-agent systems:

[0057] Step 1, Data Acquisition and Preprocessing: Acquire production safety accident investigation report data, preprocess the data and extract accident-related element information. The element information is structured data containing accident metadata, accident causes and causal relationships.

[0058] The data in this report can be derived from publicly available official accident investigation reports released by emergency management departments, which contain information on accident-related elements. Among them, the accident metadata includes the time, location, industry, accident type, and consequences (consequences refer to data on casualties and economic losses caused by the accident).

[0059] The preprocessing includes cleaning, deduplication, and format standardization of the data.

[0060] For example, inputting the investigation report of "XX Company 11.2 Fire Accident" will extract the following structured data: {

[0061] Accident metadata: {

[0062] Industry: Chemicals;

[0063] Accident type: Fire;

[0064] Location: XX District, XX City;

[0065] Date: 2023-11-02;

[0066] Consequences: Two people sustained minor injuries, and direct economic losses amounted to 5 million yuan.

[0067] }

[0068] Cause of the accident: {The instrument engineer violated regulations by opening the valve, causing a leak};

[0069] Causal relationship: {Instrument engineer improperly opened the valve → valve leakage; valve leakage → fire}

[0070] }

[0071] Step 2 involves constructing a hierarchical cause-effect graph, which includes the following steps:

[0072] Step 201, entity normalization processing, including location normalization and cause category normalization:

[0073] Based on the preset location normalization table and cause category matching table, the entities in the extracted structured data are normalized and aligned. Specifically, location normalization maps the specific location of the incident (e.g., "XX City XX District") to the provincial administrative division entity (e.g., "XX Province" to which XX City belongs). Cause category normalization maps the instance-level accident causes (e.g., "Instrument engineer violated regulations by opening the valve", "Valve leakage") to the prescribed (e.g., GB / T 13861-2022) standard cause categories (e.g., "Personnel operation error", "Defects in equipment, facilities, tools, and accessories").

[0074] Step 202, Basic graph structure construction: In the initialized hierarchical causal graph G, construct a macro layer (coarse-grained layer) and a micro layer (fine-grained layer). In the macro layer, create accident instance nodes (such as "20231102-XX City-Fire"), and connect the accident metadata such as the time and location of the accident, the normalized location, industry, accident type, and consequences as standard nodes to the graph. Establish "has_metadata" association edges between the accident instance nodes and each standard node.

[0075] Step 203, Hierarchical Cause Association Construction: For each instance-level accident cause, create instance-level cause nodes in the micro-level (e.g., "instrument engineer improperly opened the valve", "valve leakage"), and create corresponding standard-level cause nodes in the macro-level based on the cause category normalization results (e.g., "personnel operation error", "defects in equipment, facilities, tools, and accessories"). Establish "has_cause" causal triggering relationship edges from accident instance nodes to instance-level cause nodes and "classified_as" subordinate classification relationship edges from instance-level cause nodes to standard-level cause nodes. At the same time, based on the extracted causal relationships, establish "lead_to" causal chain edges between instance-level cause nodes.

[0076] To achieve the "two-layer architecture of fine-grained instance layer and coarse-grained national standard layer" described in this invention, the construction of the hierarchical cause-effect graph is explained in a formulaic way:

[0077] The hierarchical causal graph Defined as a directed graph ;

[0078] in, This represents a set of entity nodes, including incident instance nodes, standard nodes for each metadata, instance-level cause nodes, and standard-level cause nodes. This represents a set of edges with different types between entity nodes, including four core relation edges: "has_metadata", "has_cause", "classified_as", and "lead_to". Represents a collection of entity types; Represents a set of relation types;

[0079] Define the set of instance-level cause nodes as The set of standard-level cause nodes corresponding to national standards This invention defines a mapping function. This mapping function seamlessly maps fine-grained instance-level causes to a macro-level classification standard system.

[0080] It should be noted that, since directly extracted graph nodes often face the problem of granularity mismatch, this step adopts a hierarchical differentiated modeling strategy. For dimensions with clear national standard mutually exclusive classifications (such as industry classification and accident type), they are directly mapped to standard nodes; while for highly heterogeneous accident causes and / or locations (accident locations can also be processed by hierarchical processing through the above macro and micro layers), a hierarchical structure can be designed.

[0081] This two-layer architecture design uses the micro layer as a fine-grained instance layer and the macro layer as a coarse-grained national standard layer, and constructs corresponding correlation mappings. This supports macro-level aggregation and statistics of common risk patterns while preserving key technical details and micro-level accident characteristics at the underlying level. At the same time, accident instance nodes do not establish direct connections with standard-level cause nodes to ensure that the two-layer architecture of the hierarchical cause-effect graph is clear and logically rigorous, while supporting complete tracing and statistics from micro-level instances to macro-level standards.

[0082] Step 3 involves multi-agent collaborative reasoning and question-answer generation. Traditional single-step generation paradigms are prone to errors in the generated graph query code due to confusion of relationships. Therefore, this embodiment utilizes a multi-agent collaborative reasoning mechanism (MACR) to decouple the reasoning process into four specialized agent sub-tasks, specifically including the following steps:

[0083] Step 301, Graph Analysis Agent: Traverse the hierarchical causal graph, extract graph pattern information, and generate a standardized description, specifically including:

[0084] Step 30101: Traverse all nodes in the hierarchical cause-effect graph, extract and record node type and attribute information;

[0085] Step 30102: Traverse all edges in the hierarchical cause-effect graph and extract the source node type, target node type, and the relationship type between them;

[0086] Step 30103: The extracted node types, attributes, and relationship types are concatenated to generate a graph pattern description string, providing a structural reference for downstream agents.

[0087] Step 302, Problem Analysis Agent: Acting as a semantic planner, it receives user queries and performs intent parsing and task decomposition based on graph pattern descriptions, specifically including the following steps:

[0088] Step 30201: Perform the intent parsing stage. Cross-validate the core entities in the user's natural language query with the graph pattern description to determine whether the graph data is sufficient to answer the query. If it exceeds the graph coverage (e.g., querying "traffic accidents in province A" but the graph only contains production safety accidents in a specific jurisdiction (province B)), then generate an explanatory response and terminate the search; otherwise, proceed to the task decomposition stage.

[0089] Step 30202: In the task decomposition phase, for feasible queries, complex user queries are mapped layer by layer into a series of executable graph operation logic steps, including identifying core constraints and locating the corresponding node types.

[0090] Specifically, complex queries can be broken down into multiple logical operations. For example, querying "the most common standard-level accident causes in the chemical industry of XX City in 2023-2024" can be broken down into the following logical steps: "① Filter accident instance nodes with occurrence time of 2023-2024, associated industry = chemical industry, and associated location = XX City; ② Associate instance-level cause nodes and corresponding standard-level cause nodes; ③ Calculate the frequency of associated accidents for standard-level cause nodes and take the maximum value."

[0091] Step 303, Query Generation Agent: As a code synthesizer, based on the graph operation logic steps and graph pattern description, it generates executable structured query code for the graph database and obtains the corresponding structured retrieval results. Specifically, this includes the following steps:

[0092] Step 30301: Dynamically construct executable query code for the graph database based on the generated graph operation logic steps;

[0093] Step 30302: Run the generated query code in the local sandbox to perform subgraph traversal, path finding or statistical aggregation operations on the hierarchical cause-effect graph to obtain structured search results (such as "Standard cause: human operation error, accident frequency: 105").

[0094] Step 304, Reasoning and Insight Agent: As the end component, it integrates the search results and combines them with preset prompts from security experts to generate the final response, specifically including the following steps:

[0095] Step 30401: Receive the original user natural language query and the structured search results (usually discrete data points such as discrete statistical results or isolated case summaries) output by the query generation agent.

[0096] Step 30402: Based on the preset prompts from security experts, the model is instructed to use the retrieved data as a basis to conduct in-depth analysis of the underlying causal patterns.

[0097] Step 30403 transforms the discrete structured search results into a semantically coherent and logically rigorous natural language deep analysis report as the final question-answering result output. The report may include query requirements, analysis results, data basis, typical cases, and causal explanations.

[0098] For example, the output of the Q&A results is as follows: From 2023 to 2024, a total of 275 production safety accidents occurred in the chemical industry of XX City. The most common standard-level accident cause was 'human error,' accounting for 105 cases, or 38.2%. Typical manifestations of this cause include instrument engineers opening valves in violation of regulations and failing to conduct inspections according to procedures. Its high frequency is related to incomplete safety training coverage in some enterprises and weak safety awareness among operators. A typical case is the fire accident at XX Company on November 2, 2023, which was caused by an instrument engineer opening a valve in violation of regulations, resulting in a valve leak that caused a fire, resulting in minor injuries to two people and direct economic losses of 5 million yuan.

[0099] Furthermore, the production safety accident question-and-answer task described in this invention is formalized as: maximizing the response based on user queries. hierarchical cause-effect graph Natural language sequence The posterior probability is defined by the following formula:

[0100]

[0101] in, Represents the space of all possible natural language sequences;

[0102] The natural language response sequence generated by the language model satisfies ;

[0103] This represents the optimal response result, i.e., the final question-and-answer output corresponding to maximizing the posterior probability;

[0104] This indicates that the large language model performs well in a given user query. hierarchical cause-effect graph Below, generate a specific response sequence. Maximize the conditional probability.

[0105] The formal theory of this invention aims to obtain the optimal response result by decomposing the conditional probability and the constraint query space through multiple agents;

[0106] For example, when a user queries When determining the cause of the most frequent standard-level accidents in the chemical industry of XX City in 2023-2024, traditional single-generative models may produce illusions (because of the solution space). (Too large); however, in this invention, firstly, through multiple agents... Transformed into a hierarchical causal graph The deterministic graph query code accurately retrieves underlying statistical data (such as "Standard cause: human error, accident frequency: 105"), and then combines it with expert prompts to generate the final natural language sequence. As the optimal answer ;

[0107] By breaking down complex queries into constraints in a hierarchical cause-effect graph The multi-step logical operations greatly optimize the probability of the generation process. This ensures the optimal answer. The accuracy and interpretability.

[0108] This invention also discloses a production safety accident question-answering system based on hierarchical graph enhancement and multi-agent technology, implemented using the above method, comprising:

[0109] The data acquisition and preprocessing module is used to acquire data from production safety accident investigation reports, preprocess the data, and extract accident-related information.

[0110] The hierarchical cause-effect graph construction module is used to construct a hierarchical cause-effect graph with a two-layer architecture based on the extracted element information. The two-layer architecture includes a fine-grained instance layer and a coarse-grained national standard layer, realizing the association mapping between instance details and standard classification.

[0111] The multi-agent collaborative reasoning and question-answering generation module receives user natural language queries and combines them with a hierarchical causal graph. Through the collaborative reasoning mechanism of four agents—graph parsing, question analysis, query generation, and reasoning insight—it completes graph pattern parsing, intent decomposition, graph query execution, and integrated output to obtain the final question-answering result.

[0112] The technical features or steps of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features or steps in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0113] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

Claims

1. A question-and-answer method for production safety accidents based on hierarchical graph enhancement and multi-agent technology, characterized in that: Includes the following steps: Step 1, Data Acquisition and Preprocessing: Acquire production safety accident investigation report data, preprocess the data and extract accident-related element information. The element information is structured data containing accident metadata, accident causes and causal relationships. Step 2, Hierarchical Cause-Effect Graph Construction: Based on the extracted element information, a hierarchical cause-effect graph with a two-layer architecture is constructed. The two-layer architecture includes a fine-grained instance layer and a coarse-grained national standard layer, realizing the association mapping between instance details and standard classification. Step 3, Multi-agent Collaborative Reasoning and Question Answer Generation: Receive the user's natural language query and combine it with a hierarchical causal graph. Through the collaborative reasoning mechanism of four agents—graph parsing, question analysis, query generation, and reasoning insight—the user query's graph pattern parsing, intent decomposition, graph query execution, and integrated output are completed to obtain the final question answer result. The accident metadata includes the time, location, industry, accident type, and consequences of the accident. Step 2 specifically includes the following steps: Step 201, Entity normalization processing: Based on the preset location normalization table and cause category matching table, the entities in the structured data are normalized and aligned; wherein, location normalization maps the specific incident location to the provincial administrative division entity; cause category normalization maps the instance-level accident cause to the prescribed standard cause category; Step 202, Basic graph structure construction: Construct a macro layer and a micro layer in the initialized hierarchical causal graph. Create accident instance nodes in the macro layer, and connect the accident occurrence time, location after normalization, industry, accident type and consequences in the accident metadata as standard nodes to the graph. Establish the association edges between the accident instance nodes and each standard node. Step 203, Hierarchical Cause Association Construction: For each instance-level accident cause, an instance-level cause node is created in the micro layer, and a corresponding standard-level cause node is created in the macro layer based on the cause category normalization result. Causal trigger relationship edges from accident instance nodes to instance-level cause nodes, as well as subordinate classification relationship edges from instance-level cause nodes to standard-level cause nodes are established. At the same time, based on the extracted causal relationships, causal chain edges between instance-level cause nodes are established.

2. The production safety accident question-answering method based on hierarchical graph enhancement and multi-agent technology according to claim 1, characterized in that: In step 2, the accident instance node does not establish a direct connection with the standard-level cause node to ensure that the two-layer architecture of the hierarchical cause-effect graph is clear and logically rigorous, while supporting complete tracing and statistics from micro-instances to macro-standards.

3. The production safety accident question-answering method based on hierarchical graph enhancement and multi-agent technology according to claim 1, characterized in that: Step 3 includes the following steps: Step 301, Graph Analysis Agent: Traverse the hierarchical causal graph, extract graph pattern information and generate graph pattern description; Step 302, Problem Analysis Agent: Receives user queries and combines them with graph pattern descriptions to perform intent parsing and task decomposition, generating graph operation logic steps; Step 303, query to generate intelligent agent: Based on the graph operation logic steps and graph pattern description, generate structured query code and obtain the corresponding structured search results; Step 304, Reasoning and Insight Agent: Integrate structured search results and combine them with preset prompts from security experts to generate the final response.

4. The production safety accident question-answering method based on hierarchical graph enhancement and multi-agent technology according to claim 3, characterized in that: Step 301 includes the following steps: Step 30101: Traverse all nodes in the hierarchical cause-effect graph, extract and record all node type and attribute information; Step 30102: Traverse all edges in the hierarchical cause-effect graph and extract the source node type, target node type, and the relationship type between them; Step 30103: The extracted node types, attributes, and relationship types are concatenated to generate a graph pattern description string, providing a structural reference for downstream agents.

5. The production safety accident question-answering method based on hierarchical graph enhancement and multi-agent technology according to claim 4, characterized in that: Step 302 includes the following steps: Step 30201: Perform the intent parsing phase, cross-validate the core entities in the user's natural language query with the graph pattern description, and determine whether the graph data is sufficient to answer the query. If it exceeds the graph coverage, generate an explanatory response and terminate the search; otherwise, proceed to the task decomposition phase. Step 30202 involves the task decomposition phase. For feasible queries, complex user queries are mapped layer by layer into a series of executable graph operation logic steps, including identifying core constraints and locating the corresponding node types.

6. The production safety accident question-answering method based on hierarchical graph enhancement and multi-agent technology according to claim 5, characterized in that: Step 303 includes the following steps: Step 30301: Dynamically generate executable query code for the graph database based on the generated graph operation logic steps; Step 30302: Run the generated query code in the local sandbox to perform subgraph traversal, path finding, or statistical aggregation operations on the hierarchical cause-effect graph to obtain structured search results.

7. The production safety accident question-answering method based on hierarchical graph enhancement and multi-agent technology according to claim 6, characterized in that: Step 304 includes the following steps: Step 30401: Receive the original user natural language query and the structured search results output by the query generation agent; Step 30402: Based on the preset prompts from security experts, the model is instructed to use the retrieved data as a basis to conduct in-depth analysis of causal patterns. Step 30403 transforms the discrete structured search results into a semantically coherent and logically rigorous natural language deep analysis report, which serves as the final question-answering result output.

8. A production safety accident question-and-answer system based on hierarchical graph enhancement and multi-agent technology, utilizing the method described in any one of claims 1-7, characterized in that: include: The data acquisition and preprocessing module is used to acquire data from production safety accident investigation reports, preprocess the data, and extract accident-related information. The hierarchical causal graph construction module is used to construct a hierarchical causal graph with a two-layer architecture, consisting of a fine-grained instance layer and a coarse-grained national standard layer, based on extracted feature information. The multi-agent collaborative reasoning and question-answering generation module receives user natural language queries and combines them with a hierarchical causal graph. Through the collaborative reasoning mechanism of four agents—graph parsing, question analysis, query generation, and reasoning insight—it completes graph pattern parsing, intent decomposition, graph query execution, and integrated output to obtain the final question-answering result.

Citation Information

Patent Citations

  • Multi-agent collaborative question and answer enhancement method and system based on heterogeneous data knowledge

    CN120705277A

  • Domain intelligent question-answering method and system based on multi-modal knowledge graph and RAG

    CN121166896A