GraphRAG for Engineering Diagrams: ChatP&ID Enables LLM Interaction with P&IDs
New framework boosts AI accuracy by 18% and slashes costs 85% for analyzing engineering schematics.
Researchers Achmad Anggawirya Alimin and Artur M. Schweidtmann have published a paper introducing ChatP&ID, a novel agentic framework that enables natural language interaction with complex engineering diagrams like Piping and Instrumentation Diagrams (P&IDs). The core innovation is applying Graph Retrieval-Augmented Generation (GraphRAG) to this domain. Instead of feeding raw images or smart P&ID files directly to costly LLMs, ChatP&ID first transforms diagrams encoded in the DEXPI standard into structured knowledge graphs. This structured representation becomes the basis for retrieval and reasoning by LLM agents, addressing the high cost and hallucination problems of direct image processing.
Benchmark results across commercial LLM APIs from OpenAI and Anthropic are compelling. The graph-based approach improved answer accuracy by 18% compared to using raw image inputs. More strikingly, it reduced computational token costs by a massive 85% versus directly ingesting the structured smart P&ID files. The research also explored enhancing smaller open-source models by integrating VectorRAG and PathRAG techniques, boosting their response accuracy by up to 40%. A notable finding was that GPT-5-mini, when combined with a method called ContextRAG, achieved 91% accuracy on tasks at a minimal cost of just $0.004 per query.
The resulting ChatP&ID interface allows engineers to ask intuitive questions about complex schematics, such as "What is the pressure rating of valve V-101?" or "Show all safety instruments downstream of pump P-205." This work lays a practical foundation for automating critical process engineering tasks. The authors specifically highlight its potential to assist with Hazard and Operability Studies (HAZOP) and enable multi-agent systems for comprehensive plant analysis, moving AI from simple document Q&A to active engineering collaboration.
- ChatP&ID converts DEXPI-standard P&IDs into knowledge graphs for GraphRAG, boosting LLM accuracy by 18% over images.
- The framework slashes token costs by 85% versus processing smart P&ID files directly, with GPT-5-mini achieving 91% accuracy for $0.004/task.
- Enables intuitive Q&A with engineering diagrams, paving the way for AI-assisted HAZOP studies and multi-agent plant analysis.
Why It Matters
This brings reliable, cost-effective AI directly into core engineering workflows, automating analysis of critical safety and design documents.