Intelligent pollution discharge license table generation method based on RAG and LangGraph
By constructing a dedicated question set and knowledge base based on RAG and LangGraph, and utilizing a large language model for document transformation and information extraction, the efficiency and accuracy issues of filling out pollution discharge permit application forms in the environmental protection field are solved, and intelligent pollution discharge permit generation and compliance verification are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUNWAY DIGITAL INTELLIGENCE (WUXI) TECHNOLOGY CO LTD
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies, general-purpose RAG systems in the environmental protection field have difficulty accurately extracting structured information from heterogeneous documents such as environmental impact assessment reports, and cannot achieve intelligent matching and compliance verification of emission standards, resulting in time-consuming, labor-intensive, and error-prone completion of pollutant discharge permit application forms.
A dedicated question set is constructed using a method based on RAG and LangGraph. A large language model (LLM) is used for document transformation and information extraction. The RAG knowledge base is combined for compliance verification to generate a discharge permit form.
It has enabled intelligent filling of pollutant discharge permit application forms, improved the efficiency and accuracy of environmental protection government services, reduced the operating costs and administrative burden of enterprises, and ensured the authority and comprehensiveness of data.
Smart Images

Figure CN121920337A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of artificial intelligence and environmental protection, specifically to a method for intelligent generation of discharge permit forms based on RAG and LangGraph. Background Technology
[0002] With the increasing emphasis placed on environmental protection by the state, the pollutant discharge permit system has become a core component of environmental management. Enterprises are required to manually fill out complex pollutant discharge permit application forms based on a large amount of environmental regulations, standards, and their own production and operation data. This process is time-consuming and labor-intensive, and manual operation can easily lead to inaccurate data entry, omissions, or formatting errors, seriously affecting approval efficiency and enterprise compliance.
[0003] While existing general-purpose RAG systems can be used for document question answering and information extraction, they lack a deep understanding of the complex table structures and technical terminology in the environmental protection field. This makes it difficult to accurately locate and extract structured information scattered across heterogeneous documents from multiple sources (such as environmental impact assessment reports, monitoring reports, and production process descriptions), and further hinders intelligent matching and compliance verification of emission standards. Therefore, a solution that deeply adapts to the characteristics of environmental protection forms and possesses intelligent workflow management capabilities is urgently needed. Summary of the Invention
[0004] This invention provides a method for intelligent generation of discharge permit forms based on RAG and LangGraph, aiming to solve the problems mentioned in the background.
[0005] This invention provides a method for intelligently generating discharge permit forms based on RAG and LangGraph, specifically including the following steps: Document Input and Conversion Steps: The system receives heterogeneous documents (including PDF, Word, and image formats) containing information required for pollution discharge permit applications. These documents are then converted into a unified text representation using document conversion technology. Specifically, OCR is used to extract text information from image documents, paragraph and table structures are restored from PDF documents, and text and table data are directly extracted from Word documents. Specific markers are inserted during the conversion process to preserve the original document's logical structure and table information.
[0006] Steps for constructing and applying a dedicated question set: Based on the "Technical Specifications for Application and Issuance of Discharge Permits" and local form requirements, construct a dedicated question set for Discharge Permit Tables 1 (Basic Information Table for Discharge Entities) to 20 (Correction Regulations Information Table). Each table corresponds to a list of questions, and each question is precisely mapped to one or more specific fields in the table to guide LLM in accurately extracting structured information.
[0007] Workflow orchestration and management steps: Select an LLM with a parameter scale of no less than 7 billion and support for long context input lengths of no less than 4K tokens as the core information extraction engine; use the LangGraph framework to build a multi-stage workflow with conditional branches, define processing nodes such as document ingestion, information extraction, data integration, compliance checks, table generation, and manual review, as well as data flow and control flow connection edges between nodes; set execution strategies for step-by-step generation or one-time generation, and automatically trigger the manual review node when compliance verification finds problems.
[0008] LLM Information Extraction and Data Integration Steps: Driven by the LangGraph workflow, LLM extracts structured information based on the transformed unified text and a dedicated question set, in the order of Tables 1 to 20. The extracted information undergoes cleaning, including deleting duplicate data, correcting erroneous data, and filling in missing data. The structured information from different table or document sources is then integrated and updated to the shared state of the LangGraph workflow. After structured information extraction, Named Entity Recognition (NER) and relation extraction are used to further improve data accuracy.
[0009] RAG Knowledge Base Compliance Verification Steps: 1. Construct a RAG knowledge base storing the latest environmental laws, regulations, emission standards, and industry guidelines, using a vector database for storage and semantic retrieval. 2. Extract key data such as pollutant types, emission concentrations, industry categories, and enterprise regions from shared workflow states to intelligently construct query statements. 3. Search the RAG knowledge base to match corresponding national or local emission standards, automatically comparing enterprise emission data with standard limits to identify exceedance risks or non-compliance items, and generating a compliance verification report containing warnings or revision suggestions.
[0010] Form generation and model deployment steps: After compliance verification is passed, the integrated structured information is populated into a predefined standardized discharge permit application form template, and after formatting, it is converted into a formal application document in PDF format; the fine-tuned LLM and RAG models are deployed as API services, supporting document analysis tasks with text input and outputting data with... <thought>Reasoning process labeling and <result>The final result label response supports batch processing across multiple enterprises and cross-task generalized prediction.
[0011] Due to the adoption of the above solution, the beneficial effects of the present invention are: (1) The intelligent generation method for discharge permits based on RAG and LangGraph proposed in this invention can quickly and accurately complete the intelligent filling of discharge permit application forms, which greatly improves the efficiency and accuracy of discharge data processing and analysis in environmental protection government services.
[0012] (2) By constructing and applying domain-specific question sets, combined with LangGraph’s flexible workflow orchestration, we ensured a deep understanding of information extraction and automated management of processes, thereby ensuring the authority and comprehensiveness of the data entered, and providing a solid foundation for the accuracy of generating discharge permits.
[0013] (3) The integration of the RAG knowledge base enables intelligent matching and compliance verification of emission standards, effectively identifying and reducing potential violation risks and improving the level of enterprise compliance management.
[0014] (4) It supports batch processing of multiple enterprises and cross-task generalization prediction, with good scalability and practicality, reducing administrative burden and operating costs. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the system flow of the present invention; Figure 2 This is the node graph for the LangGraph method workflow. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0017] like Figure 1 and Figure 2 A method for intelligent generation of discharge permits based on Retrieval Enhanced Generation (RAG) and LangGraph includes the following steps: (1) Constructing a dedicated question set and document preprocessing: A dedicated set of questions is constructed and pre-set for each form in the discharge permit. The set of questions is carefully designed based on the actual form structure and filling requirements of the discharge permit. Receive at least one heterogeneous document containing the information required for a pollution discharge permit application, and use document conversion technology to uniformly convert it into a text representation that can be processed by a large language model (LLM). The conversion process focuses on maintaining the logical structure and tabular information of the original document.
[0018] (2) Set LangGraph workflow parameters: A large language model with generative and reasoning capabilities is selected as the core information extraction engine; Configure LangGraph workflow parameters, which include: defining multiple processing nodes (Nodes) for tasks such as information extraction, data integration, compliance verification, and table generation, defining the connection edges (Edges) between nodes for data flow and control flow, and setting the workflow execution strategy, including step-by-step generation or one-time generation schemes.
[0019] (3) Perform LLM information extraction and data integration: Based on the transformed text representation and the dedicated question set constructed in step (1), under the control of the LangGraph workflow, the structured information required for the discharge permit application is accurately extracted from the document through the LLM. The extracted structured information is cleaned, including identifying and deleting duplicate data, correcting erroneous data according to the reporting specifications of the discharge permit, and filling in missing data based on the logic of the environmental protection industry. Structured information from different tables or document sources is integrated and updated to the shared state of the LangGraph workflow.
[0020] (4) Perform RAG knowledge base compliance verification: Construct and integrate a Retrieval Enhanced Generation (RAG) knowledge base, which stores the latest environmental laws and regulations, emission standards, and industry guidelines; After information extraction and data integration are completed in step (3), under the control of the LangGraph workflow, the RAG knowledge base is used to intelligently retrieve and match the environmental emission standards corresponding to the extracted enterprise emission data; The system automatically compares enterprise emission data with the environmental emission standards to identify potential risks of exceeding standards or non-compliance items, and generates a compliance verification report containing warnings or revision suggestions.
[0021] (5) Model deployment and table generation: The validated and integrated structured information is populated into a predefined discharge permit application template under the control of the LangGraph workflow to generate the final discharge permit application document. The finely tuned LLM and RAG models are deployed as API services, supporting document analysis tasks with text input. The input is a joint text containing document content and natural language questions, and the output is a natural language inference process and final result with specific tags. It can be applied to intelligent filling and compliance review scenarios for pollution discharge permits, and supports multi-task parallel processing and cross-task generalization prediction.
[0022] Example: Intelligent generation of discharge permits by Donaldson Filters Ltd. Data Preparation and Preprocessing (1) Construction of Dedicated Question Sets: Based on the "Technical Specifications for Application and Issuance of Discharge Permits (Trial)" and the local requirements of Jiangsu Province, dedicated question sets from Table 1 to Table 20 were designed. For example, Table 1 corresponds to questions such as "What is the complete name of the discharge unit?" and "What is the unified social credit code?"; Table 7 corresponds to questions such as "What are the discharge outlet numbers respectively?" and "What are the concentration limits of pollutants respectively? (mg / Nm³)?". (2) Document Reception and Conversion: Heterogeneous documents such as "Environmental Impact Assessment Report" (PDF), "Discharge Monitoring Report" (Word), "Production Process Flow Description" (PDF), and "Business License" (JPG) provided by Donaldson (Wuxi) Filter Co., Ltd. were received. The text and table structure were extracted using PDF parsing tools, and the images in the PDF were OCR-recognized; the text and table data of the Word document were extracted; the key information of the business license image was extracted using OCR recognition, and all converted text data were uniformly stored and included in the initial state of the LangGraph workflow.
[0023] LangGraph Workflow Setup and Execution (1) LLM Selection: Qwen2.5-7B-Instruct model (7 billion parameters, supports 4K token context) is selected as the core information extraction engine. (2) Workflow Configuration: Define 6 nodes: document ingestion (DocIngest), information extraction (ExtractTable1 to ExtractTable20), data integration (DataIntegrate), compliance check (ComplianceCheck), table generation (GeneratePermit), and human review (HumanReview). Define the data flow between nodes through edges. Set a step-by-step generation strategy. When the compliance check finds that the standard is exceeded or the information is missing, the process will be routed to the human review node.
[0024] LLM Information Extraction and Data Integration (1) Information Extraction: LangGraph workflow drives LLM to extract information in the order of Table 1 to Table 20. Table 1 extracts information such as "Name of Discharge Unit: Donaldson (Wuxi) Filter Co., Ltd." from business license and environmental impact assessment report; Table 4 extracts information such as "Name of Pollution Generating Facility: Coating Waste Gas Drying Furnace" from production process description; Table 8 extracts information such as "Emission Outlet Number: DA001" and "VOCs Application Permit Emission Concentration Limit: 35 mg / Nm³" from monitoring report, and the extracted data is updated to the workflow sharing status in real time. (2) Data Cleaning and Integration: Delete duplicate data (such as duplicate company names in multiple documents), correct data with format errors (such as latitude and longitude coordinates), fill in missing key fields (supplemented through logical reasoning or prompts), and store the integrated data according to the standard structure.
[0025] RAG Knowledge Base Compliance Verification (1) Knowledge Base Query: Extract data such as pollutant types (VOCs, particulate matter), industry category (C2922 filter manufacturing), and region (Xinwu District, Wuxi City) from the shared state, and construct query statements such as "What is the VOCs emission standard limit for the filter manufacturing industry?". (2) Standard Retrieval and Comparison: The RAG knowledge base retrieves the VOCs limit of 40 mg / Nm³ in the "Emission Control Standard for Volatile Organic Compounds of Industrial Enterprises" and the particulate matter limit of 30 mg / Nm³ in the "Integrated Emission Standard for Air Pollutants"; compare the enterprise's emission data (VOCs 35 mg / Nm³, particulate matter 10 mg / Nm³) with the standards, and determine that it is compliant, without the need for manual review.
[0026] Table Generation and Model Deployment (1) Table Generation: Load a standardized Word template, map the integrated data to template placeholders (such as {{Company Name}}, {{Unified Social Credit Code}}), fill in the data, format it, and convert it into a formal PDF application document. (2) Model Deployment: Deploy the LLM and RAG models as API services, receive inputs containing document content and natural language questions, and output with... <thought>and <result>The tag response supports batch processing across multiple enterprises and generalized prediction across tasks.
[0027] This invention is not limited to the above embodiments. Any improvements and modifications made by those skilled in the art within the scope of the principles of this invention should be included within the protection scope of this invention.
[0028] The above description of the embodiments is intended to enable those skilled in the art to understand and use the present invention. It will be apparent to those skilled in the art that various modifications can be made to these embodiments, and the general principles described herein can be applied to other embodiments without inventive effort. Therefore, the present invention is not limited to the above embodiments. Improvements and modifications made by those skilled in the art based on the principles of the present invention without departing from the scope of the invention should be within the protection scope of the present invention. The above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / result> < / thought> < / result> < / thought>
Claims
1. A method for intelligent generation of discharge permit forms based on RAG and LangGraph, characterized in that, Includes the following steps: (1) Document input and conversion steps: Receive at least one heterogeneous document containing the information required for the application for a pollution discharge permit, and convert it into a unified text representation using a document conversion method. The text representation retains the logical structure and table information of the original document. (2) Steps for constructing and applying a dedicated question set: Pre-set and load a dedicated question set for each form in the discharge permit. The question set is designed according to the actual structure and filling requirements of the form and is used to guide the large language model (LLM) to extract the structured information required for the discharge permit application from the unified text representation. (3) Workflow orchestration and management steps: The LangGraph framework is used to build and manage the pollution discharge permit generation workflow. The workflow includes multiple nodes and edges. The nodes perform tasks such as information extraction, compliance verification, data integration and table generation. The edges define the data flow and control flow between nodes, supporting step-by-step generation or one-time generation schemes. (4) RAG Knowledge Base Compliance Verification Steps: Integrate the Retrieval Enhanced Generation (RAG) knowledge base, which stores environmental laws, regulations and emission standards; after information extraction, call the RAG knowledge base to verify the compliance of the extracted emission data, and adjust the workflow according to the verification results; (5) Form generation and output steps: Fill the predefined pollutant discharge permit application form template with the verified structured information to generate the final pollutant discharge permit application document.
2. The method according to claim 1, characterized in that, The dedicated question set includes detailed question configurations for Tables 1 to 20 of the discharge permit, with each question precisely mapped to one or more specific fields in the corresponding table.
3. The method according to claim 1, characterized in that, The document conversion method includes: performing OCR recognition on image documents, parsing text in PDF documents and restoring paragraph and table structures, extracting structured data from Word documents, and inserting specific tags during the extraction process to preserve the original document structure information.
4. The method according to claim 1, characterized in that, The nodes of the LangGraph workflow include document ingestion nodes, information extraction nodes (ExtractTable1 to ExtractTable20), data integration nodes, compliance check nodes, table generation nodes, and manual review nodes. The workflow supports conditional routing. When compliance verification finds that the process exceeds the standard or that key information is missing, the process is automatically routed to the manual review node, and continues after manual correction or confirmation.
5. The method according to claim 1, characterized in that, The LLM has a parameter scale of no less than 7 billion and supports long context input with a length of no less than 4K tokens. After structured information extraction, it also includes named entity recognition (NER) and relation extraction steps to improve data accuracy.
6. The method according to claim 1, characterized in that, The RAG knowledge base uses a vector database for storage and semantic retrieval, and can intelligently retrieve and match corresponding national or local environmental emission standards based on pollutant type, industry category, and enterprise location.
7. The method according to claim 1, characterized in that, The data integration steps include: identifying and deleting duplicate data, correcting erroneous data according to the discharge permit reporting specifications, filling in missing data based on environmental protection industry logic, and storing the integrated data in the shared state of the LangGraph workflow.
8. The method according to claim 1, characterized in that, It also includes a model deployment step: deploying the fine-tuned LLM and RAG models as API services, supporting document analysis tasks with text input, where the input is joint text containing document content and natural language questions, and the output is... <thought>The reasoning process of the label and <result> The final result of the tags constitutes the response.< / result> < / thought> 9. The method according to claim 1, characterized in that, The method supports multiple enterprises submitting applications simultaneously and processing them in batches, and has cross-task generalization prediction capabilities.