用知识图谱让大模型高效准确地理解工程图纸。
GraphRAG for Engineering Diagrams: ChatP&ID Enables LLM Interaction with P&IDs
- 将智能管道图转为知识图谱,通过图检索提升交互精度。
- 相比直接读图,准确率提升18%,令牌成本降低85%。
- 适合需要低耗高准交互的工业流程设计与安全分析场景。
大型语言模型(LLMs)结合检索增强生成(RAG)与知识图谱,为与工程图如管道仪表图(P&IDs)交互提供了新可能。然而,直接处理原始图像或智能P&ID文件往往成本高、效率低且易产生幻觉。本文提出ChatP&ID,一个基于图检索增强生成(GraphRAG)的代理框架,将符合DEXPI标准的智能P&ID转化为结构化知识图谱,支持LLM代理进行基于图的检索与推理。该方法显著提升了对工程图的可靠查询能力并大幅降低计算成本。在OpenAI、Anthropic等商用LLM API上的基准测试表明,图表示相较原始图像输入使准确率提升18%,比直接摄入智能文件减少85%的令牌开销。尽管小型开源模型仍难以解析知识图谱格式,但结合VectorRAG与PathRAG后,响应准确率最高可提升40%。值得注意的是,GPT-5-mini配合ContextRAG实现91%准确率,单次任务成本仅$0.004。最终的ChatP&ID界面支持直观自然语言交互复杂工程图,为人工智能辅助工艺工程任务(如HAZOP分析、多智能体分析)奠定基础。
原文摘要 · Abstract (English)
Large Language Models (LLMs) combined with Retrieval-Augmented Generation (RAG) and knowledge graphs offer new opportunities for interacting with engineering diagrams such as Piping and Instrumentation Diagrams (P&IDs). However, directly processing raw images or smart P&ID files with LLMs is often costly, inefficient, and prone to hallucinations. This work introduces ChatP&ID, an agentic framework that enables grounded and cost-effective natural-language interaction with P&IDs using Graph Retrieval-Augmented Generation (GraphRAG), a paradigm we refer to as GraphRAG for engineering diagrams. Smart P&IDs encoded in the DEXPI standard are transformed into structured knowledge graphs, which serve as the basis for graph-based retrieval and reasoning by LLM agents. This approach enables reliable querying of engineering diagrams while significantly reducing computational cost. Benchmarking across commercial LLM APIs (OpenAI, Anthropic) demonstrates that graph-based representations improve accuracy by 18% over raw image inputs and reduce token costs by 85% compared to directly ingesting smart P&ID files. While small open-source models still struggle to interpret knowledge graph formats and structured engineering data, integrating them with VectorRAG and PathRAG improves response accuracy by up to 40%. Notably, GPT-5-mini combined with ContextRAG achieves 91% accuracy at a cost of only $0.004 per task. The resulting ChatP&ID interface enables intuitive natural-language interaction with complex engineering diagrams and lays the groundwork for AI-assisted process engineering tasks such as Hazard and Operability Studies (HAZOP) and multi-agent analysis.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。