LLMs in Process Diagram Engineering: From Optimal PFDs to Validated P&IDs
06:00 · August 13, 2026 · arXiv cs.AI RSS

Nowadays, the creation of a process flow diagram (PFD) and its subsequent transformation into a piping and instrumentation diagram (P&ID) is predominantly performed manually. Applying artificial intelligence in the task could potentially lead not only to process automation and time savings, but also to financial gains by exploring numerous diagram's topology options and reducing manual labor. This research presents P&ID Pilot - a practical end-to-end AI pipeline capable of handling flowsheet developing for both stages. The first stage focuses on PFD synthesis, whereas the second is directed toward modifying the generated PFD into P&ID. After comparing four different methods, the hybrid approach combining genetic algorithms (GA) and large language models (LLM) is shown to generate the optimal valid PFD topology, achieving the lowest loss value among all the methods, while satisfying the required outlet flow parameters without engineering-rule violations. For the second stage, the proposed LLM-based agent successfully transforms the generated PFD into a source-grounded P&ID by producing validated, executable modifications through a restricted engineering software development kit, achieving 100% execution success while maintaining compliance with domain-specific rules and reference graph structures. This unified pipeline - coupling GA/LLM-driven synthesis with an LLM-based transformation agent - offers a feasible path toward end-to-end process design automation by producing validated, deployable outputs and substantially reduces manual engineering effort.
Summary
The creation of process flow diagrams (PFDs) and their conversion into piping and instrumentation diagrams (P&IDs) remains largely manual, despite the availability of computer-aided tools. Both diagram types represent process topology as graphs whose nodes, edges and attributes encode equipment, streams, connectivity and engineering metadata. Manual revision of these graphs is repetitive yet error-prone, because even modest topology changes can invalidate downstream assumptions about flow, control or safety.
P&ID Pilot addresses the full cycle with a single AI pipeline. In the first stage, four synthesis methods are compared on the task of generating valid PFD topologies that meet specified outlet flow parameters. The hybrid approach that couples a genetic algorithm with LLM-based repair produces the lowest loss value while satisfying all engineering constraints and avoiding rule violations. The resulting PFD then serves as the source for the second stage.
There, an LLM-based agent receives natural-language modification requests and emits executable actions through a deliberately restricted engineering SDK. Every action is validated against domain rules and a reference graph structure before it is applied. In reported tests the agent achieved 100 percent execution success while preserving compliance. By grounding all diagram changes in predefined graph operations rather than unconstrained file edits, the pipeline produces outputs that are both machine-validated and ready for further engineering use.
The combined workflow therefore links optimal topology generation directly to controlled, auditable P&ID refinement, offering a practical route to reduce manual effort in process design.
Why it matters
This research is highly relevant for Dutch AI researchers and process engineering enterprises looking to automate complex industrial design tasks. The hybrid GA/LLM methodology and restricted SDK approach offer actionable, technically deep insights for deploying safe and compliant AI in industrial engineering.








