Building Code Question-Answering Systems Enhanced by Large Language Models and Knowledge-Graph-Based Retrieval-Augmented Generation

Abstract Building codes are complex documents that pose significant challenges for consistent interpretation and efficient compliance checking in the construction industry. Existing automated methods often overlook the interrelationships between provisions and lack comprehensive evaluation support from practical engineering perspectives. In this study, we develop a retrieval-augmented generation (RAG) system enhanced with a knowledge graph to interpret building codes by leveraging both the semantic content and structural relationships within the documents. We evaluated the system using 661 query-context-answer triplets from a particular building code. The RAG-enhanced model outperformed state-of-the-art pretrained transformer models and general-purpose large language models (LLMs) in answer quality. Shorter text chunks led to higher semantic relevance, while longer chunks improved precision. The closed-source model achieved better accuracy and speed than the open-source alternative. These findings demonstrate the potential of knowledge-graph-based RAG systems to support accurate, efficient, and scalable regulatory interpretation in real-world engineering contexts.

Authors

Institutions

Publication Details

Journal
Journal of Computing in Civil Engineering
Published
2026-10-14
DOI
https://doi.org/10.1061/jccee5.cpeng-7400
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Building Code Question-Answering Systems Enhanced by Large Language Models and Knowledge-Graph-Based Retrieval-Augmented Generation

Fan Yang, Jiansong Zhang
Journal of Computing in Civil Engineering
Topic Modeling
article

Building Code Question-Answering Systems Enhanced by Large Language Models and Knowledge-Graph-Based Retrieval-Augmented Generation

Fan Yang, Jiansong Zhang
article en

Abstract

Abstract Building codes are complex documents that pose significant challenges for consistent interpretation and efficient compliance checking in the construction industry. Existing automated methods often overlook the interrelationships between provisions and lack comprehensive evaluation support from practical engineering perspectives. In this study, we develop a retrieval-augmented generation (RAG) system enhanced with a knowledge graph to interpret building codes by leveraging both the semantic content and structural relationships within the documents. We evaluated the system using 661 query-context-answer triplets from a particular building code. The RAG-enhanced model outperformed state-of-the-art pretrained transformer models and general-purpose large language models (LLMs) in answer quality. Shorter text chunks led to higher semantic relevance, while longer chunks improved precision. The closed-source model achieved better accuracy and speed than the open-source alternative. These findings demonstrate the potential of knowledge-graph-based RAG systems to support accurate, efficient, and scalable regulatory interpretation in real-world engineering contexts.

Journal of Computing in Civil EngineeringVol. 41(1)
Purdue University West Lafayette (US), University of Tennessee at Knoxville (US)
Openalex Percentile: Top 13%
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.