A Graph-based RAG for Energy
Efficiency Question Answering
Riccardo Campi1, Nicolò O. Pinciroli V.1,
Mathyas Giudici1, Pablo Barrachina R.G.2,
Marco Brambilla1, Piero Fraternali1
1 Politecnico di Milano, DEIB Department. Milano, Italy
2 MIWenergĂ­a, Parque CientĂ­fico de Murcia. Murcia, Spain
25th International Conference on Web Engineering
Delft, Netherlands | 30 June – 03 July 2025
Energy Efficiency (EE)
A Graph-based RAG for
Energy Efficiency Question Answering
Energy users
are key actors
EE is crucial for
sustainability goals
The implementation by
energy users
of the guidelines on
energy savings
is required to meet EE
EU created guidelines
on energy savings
Large Language Models (LLMs)
LLMs are effective in
recommending..
..with synthesis and
multilingualism..
NO factual
correctness
NO information
updatability
NO information
provenance
Problems:
A Graph-based RAG for
Energy Efficiency Question Answering
Retrieval Augmented Generation (RAG)
LLMs
Factual
correctness
Information
updatability
Information
provenance
External
knowledge
+
RAG
=
A Graph-based RAG for
Energy Efficiency Question Answering
• Builds a Knowledge Graph of
entities and their relationships
• Retrieves information by
traversing KG’s nodes
• Ideal for complex reasoning and
structured data
• Context is preserved
Vector-RAG Graph-RAG
• Computes vector embeddings
to represent chunked documents
• Queries in embedding space
• Retrieves relevant content
based on semantic similarity
• Context of the answer is less
relevant while retrieving
P. Lewis et al. 2020. Retrieval-augmented generation for knowledge-
intensive NLP tasks. In Proceedings of NIPS '20. Curran Associates
Inc., Red Hook, NY, USA, Article 793, 9459–9474.
D. Edge et al. 2024. From Local to Global: A Graph RAG Approach
to Query-Focused Summarization. https://arxiv.org/abs/2404.16130
A Graph-based RAG for
Energy Efficiency Question Answering
Our Goals
Propose a Graph-
RAG architecture..
..to offer energy users
recommendations..
..helping them
saving energy
..using guidelines and
regulations on energy savings..
A Graph-based RAG for
Energy Efficiency Question Answering
Related Work - Agents on EE
In 2024, Arslan et al. introduced a Vector-RAG designed to support decision-making in
SMEs by offering insights into the energy sector. They show that combining RAG with
Llama3.1:8B boosts the chatbot’s performance.
In 2024, Fortuna et al. explored a
Graph-RAG for answering complex
electricity-related questions,
leveraging publicly available
electricity consumption KGs. They
show that combining RAG and LLMs
with KGs holds strong potential for
improving performance.
In 2023, Giudici et al. examined how
LLMs can support EE by improving
understanding and optimizing energy
use. While their chatbots responded
fluently on general topics, they
struggled in domain-specific queries.
A Graph-based RAG for
Energy Efficiency Question Answering
Our General Architecture
• 3 distinct subsystems
• A Knowledge Extractor takes
out triples from documents
• Triples are used to build the
KG in the Knowledge Base
• A Runtime subsystem
answers in NL by querying the
Knowledge Base to retrieve
relevant information
A Graph-based RAG for
Energy Efficiency Question Answering
Knowledge Extraction
• Context Documents are cleaned and chunked
• An LLM is prompted to extract entity-relationship-entity triples
• Triples’ syntax is unified
Fragment of the defined ontology:
A Graph-based RAG for
Energy Efficiency Question Answering
Runtime
• Top-o incoming relationships and
top-i incoming relationships are
selected (5 ≤ o, i ≤ 10)
• Connected entities are selected
• Top-c chunks are selected and
serialized
• An answer is constructed
• entity-relationship-entity triples are extracted
from the question
• Similarity scores are computed between each
entity in the query and those in the KG. If no
score surpasses a threshold t, the NLF answers
“no results exist”
• Top-k entities are kept (3<k<15)
A Graph-based RAG for
Energy Efficiency Question Answering
Data sources
Source websites
in Italian language
Construct
the KG
Extract QA pairs
as ground-truth
• Italian State Revenue Agency
• AEG Cooperativa
• Luce-gas.it
• SvizzeraEnergia
• TicinoEnergia
• Federal Department of the
Environment, Transport,
Energy and Communications
A Graph-based RAG for
Energy Efficiency Question Answering
Ground-truth Question-Answer (QA) Pairs
25 QA pairs focusing on Italian
regulation and incentives on EE
25 QA pairs addressing Swiss
regulations and incentives on EE
+
+
51 QAs providing general
recommendations and
suggestions on EE
101 QA pairs
in Italian
101 QA pairs
in English
= 202 QAs
A Graph-based RAG for
Energy Efficiency Question Answering
Some QA pairs example
What is the maximum deductible
spending limit in 2025 for the furniture
and household appliances bonus in Italy?
— 5.000 euros. What is the law that defines the
determining surface area in the Canton
of Ticino? — The Cantonal Building Law
(LE), art. 38, paragraph 3.
How much does an LED bulb consume?
— Between 1 and 11 Watts per hour.
A Graph-based RAG for
Energy Efficiency Question Answering
Evaluation Experiment
Source documents in Italian language
Build a KG
QA pairs are in Italian (101) and in English (101):
25 on Italian guidelines 25 on Swiss guidelines 51 on general EE
gpt-4o-mini and text-embedding-3-small by OpenAI
Domain experts evaluate answers with criteria from the RAGAs framework
Faithfullness Answer relevance Context relevance
A Graph-based RAG for
Energy Efficiency Question Answering
Some insights from our results
Italy (25) Switzerland (25) General (51) All (101)
75% accuracy on average
General QAs perform better than technical / country-specific ones (78% on average)
Promising multilingual abilities: 4.4% accuracy loss due to translation
A Graph-based RAG for
Energy Efficiency Question Answering
Future Work
Involve a variety of different
LLMs and languages
Add a domain-specific
ontology for the KG
construction Run extensive tests
on real energy users
Improve RAG performance on
technical / country-specific QAs
A Graph-based RAG for
Energy Efficiency Question Answering
Improve the evaluation
Thank You!
Riccardo Campi1, Nicolò O. Pinciroli V.1,
Mathyas Giudici1, Pablo Barrachina R.G.2,
Marco Brambilla1, Piero Fraternali1
1 Politecnico di Milano, DEIB Department. Milano, Italy
2 MIWenergĂ­a, Parque CientĂ­fico de Murcia. Murcia, Spain
25th International Conference on Web Engineering
Delft, Netherlands | 30 June – 03 July 2025

A GraphRAG approach for Energy Efficiency Q&A

  • 1.
    A Graph-based RAGfor Energy Efficiency Question Answering Riccardo Campi1, Nicolò O. Pinciroli V.1, Mathyas Giudici1, Pablo Barrachina R.G.2, Marco Brambilla1, Piero Fraternali1 1 Politecnico di Milano, DEIB Department. Milano, Italy 2 MIWenergía, Parque Científico de Murcia. Murcia, Spain 25th International Conference on Web Engineering Delft, Netherlands | 30 June – 03 July 2025
  • 2.
    Energy Efficiency (EE) AGraph-based RAG for Energy Efficiency Question Answering Energy users are key actors EE is crucial for sustainability goals The implementation by energy users of the guidelines on energy savings is required to meet EE EU created guidelines on energy savings
  • 3.
    Large Language Models(LLMs) LLMs are effective in recommending.. ..with synthesis and multilingualism.. NO factual correctness NO information updatability NO information provenance Problems: A Graph-based RAG for Energy Efficiency Question Answering
  • 4.
    Retrieval Augmented Generation(RAG) LLMs Factual correctness Information updatability Information provenance External knowledge + RAG = A Graph-based RAG for Energy Efficiency Question Answering
  • 5.
    • Builds aKnowledge Graph of entities and their relationships • Retrieves information by traversing KG’s nodes • Ideal for complex reasoning and structured data • Context is preserved Vector-RAG Graph-RAG • Computes vector embeddings to represent chunked documents • Queries in embedding space • Retrieves relevant content based on semantic similarity • Context of the answer is less relevant while retrieving P. Lewis et al. 2020. Retrieval-augmented generation for knowledge- intensive NLP tasks. In Proceedings of NIPS '20. Curran Associates Inc., Red Hook, NY, USA, Article 793, 9459–9474. D. Edge et al. 2024. From Local to Global: A Graph RAG Approach to Query-Focused Summarization. https://arxiv.org/abs/2404.16130 A Graph-based RAG for Energy Efficiency Question Answering
  • 6.
    Our Goals Propose aGraph- RAG architecture.. ..to offer energy users recommendations.. ..helping them saving energy ..using guidelines and regulations on energy savings.. A Graph-based RAG for Energy Efficiency Question Answering
  • 7.
    Related Work -Agents on EE In 2024, Arslan et al. introduced a Vector-RAG designed to support decision-making in SMEs by offering insights into the energy sector. They show that combining RAG with Llama3.1:8B boosts the chatbot’s performance. In 2024, Fortuna et al. explored a Graph-RAG for answering complex electricity-related questions, leveraging publicly available electricity consumption KGs. They show that combining RAG and LLMs with KGs holds strong potential for improving performance. In 2023, Giudici et al. examined how LLMs can support EE by improving understanding and optimizing energy use. While their chatbots responded fluently on general topics, they struggled in domain-specific queries. A Graph-based RAG for Energy Efficiency Question Answering
  • 8.
    Our General Architecture •3 distinct subsystems • A Knowledge Extractor takes out triples from documents • Triples are used to build the KG in the Knowledge Base • A Runtime subsystem answers in NL by querying the Knowledge Base to retrieve relevant information A Graph-based RAG for Energy Efficiency Question Answering
  • 9.
    Knowledge Extraction • ContextDocuments are cleaned and chunked • An LLM is prompted to extract entity-relationship-entity triples • Triples’ syntax is unified Fragment of the defined ontology: A Graph-based RAG for Energy Efficiency Question Answering
  • 10.
    Runtime • Top-o incomingrelationships and top-i incoming relationships are selected (5 ≤ o, i ≤ 10) • Connected entities are selected • Top-c chunks are selected and serialized • An answer is constructed • entity-relationship-entity triples are extracted from the question • Similarity scores are computed between each entity in the query and those in the KG. If no score surpasses a threshold t, the NLF answers “no results exist” • Top-k entities are kept (3<k<15) A Graph-based RAG for Energy Efficiency Question Answering
  • 11.
    Data sources Source websites inItalian language Construct the KG Extract QA pairs as ground-truth • Italian State Revenue Agency • AEG Cooperativa • Luce-gas.it • SvizzeraEnergia • TicinoEnergia • Federal Department of the Environment, Transport, Energy and Communications A Graph-based RAG for Energy Efficiency Question Answering
  • 12.
    Ground-truth Question-Answer (QA)Pairs 25 QA pairs focusing on Italian regulation and incentives on EE 25 QA pairs addressing Swiss regulations and incentives on EE + + 51 QAs providing general recommendations and suggestions on EE 101 QA pairs in Italian 101 QA pairs in English = 202 QAs A Graph-based RAG for Energy Efficiency Question Answering
  • 13.
    Some QA pairsexample What is the maximum deductible spending limit in 2025 for the furniture and household appliances bonus in Italy? — 5.000 euros. What is the law that defines the determining surface area in the Canton of Ticino? — The Cantonal Building Law (LE), art. 38, paragraph 3. How much does an LED bulb consume? — Between 1 and 11 Watts per hour. A Graph-based RAG for Energy Efficiency Question Answering
  • 14.
    Evaluation Experiment Source documentsin Italian language Build a KG QA pairs are in Italian (101) and in English (101): 25 on Italian guidelines 25 on Swiss guidelines 51 on general EE gpt-4o-mini and text-embedding-3-small by OpenAI Domain experts evaluate answers with criteria from the RAGAs framework Faithfullness Answer relevance Context relevance A Graph-based RAG for Energy Efficiency Question Answering
  • 15.
    Some insights fromour results Italy (25) Switzerland (25) General (51) All (101) 75% accuracy on average General QAs perform better than technical / country-specific ones (78% on average) Promising multilingual abilities: 4.4% accuracy loss due to translation A Graph-based RAG for Energy Efficiency Question Answering
  • 16.
    Future Work Involve avariety of different LLMs and languages Add a domain-specific ontology for the KG construction Run extensive tests on real energy users Improve RAG performance on technical / country-specific QAs A Graph-based RAG for Energy Efficiency Question Answering Improve the evaluation
  • 17.
    Thank You! Riccardo Campi1,Nicolò O. Pinciroli V.1, Mathyas Giudici1, Pablo Barrachina R.G.2, Marco Brambilla1, Piero Fraternali1 1 Politecnico di Milano, DEIB Department. Milano, Italy 2 MIWenergía, Parque Científico de Murcia. Murcia, Spain 25th International Conference on Web Engineering Delft, Netherlands | 30 June – 03 July 2025