October 26, 2026
Application of KAG (Knowledge Augmented Generation) for the analysis of governmental efficiency with open data
Rubem Ribeiro de Barros; Edilson José Rodrigues
DOI: 10.22167/2675-6528-202603443
Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
The analysis of Brazilian governmental efficiency from open data faces heterogeneity, volume, and fragmentation of official sources, and approaches based on Retrieval Augmented Generation (RAG) presented limitations in numerical aggregations and multi-source cross-referencing. A prototype based on the Knowledge Augmented Generation (KAG) architecture, named KAG-Gov, was proposed and evaluated for the analysis of Brazilian public management efficiency. The prototype integrated ten federal sources into a knowledge graph with 1.18 million nodes and 2.31 million relations, using hybrid retrieval by Reciprocal Rank Fusion (RRF) between graph search, vector search, and lexical search, supported by 13 cross-source templates. The architecture replicated four of the five central components of the original framework, replacing the KAG-Model component with an external language model. The evaluation covered four research questions on correlations, anomalies, regional variation, and traceability, with 2,464 automated tests and a benchmark of 300 queries. The comparison between three approaches registered 85.0% accuracy for KAG, 35.3% for RAG, and 19.7% for LLM without retrieval, demonstrating a gain of 49.7 percentage points over RAG and an Expected Calibration Error (ECE) five times lower. The results indicated that the integration of graph, vector retrieval, and generative model is viable for public efficiency analysis, with gains in accuracy, calibration, and traceability compared to the evaluated baselines.
Keywords: Open Government Data; Public Management Efficiency; Knowledge Graphs; Language Models; Hybrid Reasoning.
1. Introduction
Intelligence in public management, defined as the organizational capacity to employ data to enhance decision-making and optimize resource allocation, is a fundamental cornerstone for socioeconomic development and societal trust in institutions (Melati and Janissek-Muniz, 2022). In Brazil, the increasing availability of public data through platforms such as the Transparency Portal (Federal Government of Brazil, 2024a) and the Open Data Portal (Federal Government of Brazil, 2024b), as well as specialized official databases like DATASUS (2024), IBGE (2024), and INEP (2024), supported by the Access to Information Law (Brazil, 2011) and the Open Data Policy (Brazil, 2016), offers an unprecedented opportunity for analyzing governmental efficiency. However, the heterogeneity, volume, and institutional fragmentation of these sources represent a considerable technical challenge for extracting applicable knowledge (Kawashita et al., 2024; Cristina et al., 2025).
In this scenario, Large Language Models (LLMs) emerge as artificial intelligence systems capable of understanding and generating natural language from vast volumes of text. Although these models have expanded the possibilities of interaction with current language data, they present significant limitations regarding knowledge updating, factual accuracy, and reasoning about structured data. Frequently, they can produce incorrect statements, a phenomenon known as “hallucination” (Gao et al., 2024; Huang et al., 2025).
Retrieval Augmented Generation (RAG) has been proposed to mitigate some of these limitations, by retrieving pertinent snippets from an external knowledge base to provide context to the LLM before generation, typically through vector search over dense representations (Gao et al., 2024). However, classic RAG demonstrates insufficiency in specific governmental contexts. This occurs in queries that require the combination of attributes from heterogeneous sources, where the similarity of “embeddings” rarely covers all necessary attributes in a single snippet, and in numerical aggregations over tabular values, where the LLM may accumulate errors when performing operations directly (Baek et al., 2023; Yuan et al., 2025; Xiang et al., 2025).
To overcome these barriers, knowledge graphs, which are structured representations in typed nodes and edges, offer distinctive capabilities absent in vector search. These include exact entity identification, declarative relation crossing, and aggregation over numerical properties. The integration between knowledge graphs and LLMs is formalized in architectures such as GraphRAG (Edge et al., 2024; Han et al., 2025) and, more specifically, in the Knowledge Augmented Generation (KAG) architecture, proposed by Liang et al. (2024), which organizes concepts, instances, and “chunks” in layers, with mutual indexing between graph and text, and a logical form solver.
The application of these techniques to open government data in Portuguese, however, is still introductory. Research such as Kawashita et al. (2024) and Cristina et al. (2025) points to the fragmentation of formats and the need for unification of public databases in Brazil, while Oliveira et al. (2026) apply RAG with a graph to the legal domain in Portuguese, without addressing efficiency data. There are no empirical reports of KAG applied to Brazilian open government data in the audited catalog, which highlights a gap in the literature and practice.
Thus, this work proposes and evaluates a KAG-based prototype, named KAG-Gov, for analyzing the efficiency of Brazilian public management from official open data, seeking to fill the identified gap and offer a robust solution for the challenges of integrating and analyzing governmental data.
2. Material and Methods
The research adopted an exploratory and applied design, based on the research-development approach. This process involved the implementation of a functional prototype, followed by a quantitative evaluation based on a reference “benchmark”. The objective was to analyze the efficiency of Brazilian public management using open data, employing the KAG (Knowledge Augmented Generation) architecture.
The methodology describes the architecture of the KAG-Gov prototype, the data sources used, the knowledge graph construction process, the hybrid reasoning mechanism, the generative model used, and the evaluation metrics. The structure follows the architectural model proposed by Liang et al. (2024), which divides the framework into three main subsystems: KAG-Builder, for offline graph construction; KAG-Solver, for online reasoning; and KAG-Model, the generative component.
To ensure the reproducibility of the study, the experiment was executed in a Windows 11 environment, with 16 GB of RAM and an AMD Radeon RX 6600 graphics card. The software stack included Python 3.13 and Poetry for dependency management, Docker Compose for Neo4j and Qdrant services, and DuckDB with PyArrow for analytical storage in Parquet. Tools such as FastAPI, Pydantic, Streamlit, pandas, requests, httpx, tenacity, structlog, and Prometheus were employed for API, data validation, interface, processing, integration, resilience, structured logging, and observability.
The generation of responses used the GPT-4o model, accessed via the Abacus RouteLLM API. Reproduction of the environment requires valid credentials for this provider and, when applicable, access keys to official data sources. The source code, configuration files, and the docker-compose.yml file, which define the operational parameters, were gathered in a versioned repository.
The architecture of the KAG-Gov prototype was organized into four sequential logical layers. The first is the governmental sources layer. The second is the KAG-Builder, responsible for graph ingestion and construction. The third is the storage layer, which comprises a Medallion format “data lake”, a knowledge graph, and a vector index. The fourth is the KAG-Solver, which performs online reasoning on natural language questions. An access layer, composed of a REST API and a web application, connects end-users to the “solver”.
The prototype integrated ten official Brazilian sources, articulated by nine specialized software adapters and an ingestor dedicated to the Transparency Portal. The selection of sources was guided by the research objectives, which demanded fiscal, legislative, contracting, health, education, security, territory, and business registration data. The sources included data from the Chamber of Deputies, Federal Senate, PNCP, Transparency Portal, SICONFI, DATASUS, IBGE, INEP, SINESP, and RFB, with temporal coverage varying between 2021 and 2026, depending on the source.
The ingestion layer implemented open government data integration patterns, as per Kawashita et al. (2024), addressing the heterogeneity and fragmentation of sources (Melati and Janissek-Muniz, 2022; Cristina et al., 2025). Each adapter managed authentication, pagination, primary normalization, and resilience, delegating rerun control to a “checkpoint” manager that persisted state in DuckDB. Execution occurred in parallel, using a parameterizable “worker pool” with “circuit breaker” and exponential “retries”.
The persistence layer adopted the Medallion architecture, materialized on DuckDB and Parquet files, organizing the data into three layers. The Bronze layer stored raw HTTP responses in their original format for auditability. The Silver layer applied typed normalization, validation by Pydantic classes, and numerical analysis. The Gold layer consolidated deduplicated entities and relationships, marking each record with the knowledge_layer=KGfr property and creating “cross-links” between sources.
In the construction of the knowledge graph, the Gold layer records were published in Neo4j. The semantic schema, declared in a configuration file, included 54 entity types, 16 conceptual hierarchies, and 36 relationship types. The resulting graph contained 1,181,407 nodes and 2,312,054 relationships. Fidelity to the LLMFriSPG schema (Liang et al., 2024) was ensured by linking each instance node to its corresponding ConceptType and by the automatic expansion of the conceptual hierarchy by a hypernym predictor.
Mutual indexing between the knowledge graph and “Raw Chunks” was implemented in three redundant layers. A mutual index table in DuckDB stored (entity_id, chunk_id) pairs. Labeled nodes :Chunk were created in Neo4j, connected to entity nodes by HAS_CHUNK and SUPPORTS edges. The kag_chunks vector collection in Qdrant stored 565,233 points of 384 dimensions, generated by the “embedding” model paraphrase-multilingual-MiniLM-L12-v2 and indexed in an HNSW structure. Semantic “chunking” grouped tabular records by keys such as organ and year.
Knowledge alignment was performed by three offline predictors: one for semantic relations, one for instance synonyms, and one for concept hypernyms. The fusion of synonymous instances was executed by a specific routine in the graph loading module. During query, the solver expanded question terms via synonym and isA edges, resorting to contextual inference in the absence of direct matching. The choice for deterministic heuristics, instead of calls to LLMs, aimed to reduce computational costs and increase reproducibility (Baek et al., 2023).
The KAG-Solver implemented the complete flow of section 2.3 from the article by Liang et al. (2024). The question was submitted to mention extraction to identify entities and temporal references. The Logical Form Planner translated the question into a plan with five standard functions: Retrieval, Sort, Math, Deduce, and Output. For cross-referencing between sources, a reasoning component triggered 13 parameterized Cypher templates, covering combinations such as “IDEB + municipal fiscal indicator” and “company + sanction + contract”, integrating diverse governmental sources.
The retrieval stage was hybrid, integrating Cypher search over Neo4j, vector search over Qdrant, and lexical similarity Best Match 25 (BM25) over chunk “payloads”, consolidated by Reciprocal Rank Fusion (RRF) with k=60 (Cormack et al., 2009). A dynamic selector adjusted the relative contribution of each signal according to the query type. The “Judger” assessed the sufficiency and confidence of the evidence, requesting new iterations to the Planner, if necessary, limited to five cycles. The “Generator” produced the final answer with numerical markers referencing the sources and applied textual sanitization.
Regarding the generative model, the prototype opted not to replicate the original KAG-Model component, which involved proprietary fine-tuning. Response generation was delegated to the GPT-4o model, accessed via API. This decision, aligned with the predominant practice in recent KAG literature (Yuan et al., 2025; Zhang et al., 2025; Bahr et al., 2025; Huang et al., 2025; Oliveira et al., 2026), reduced costs and enabled the scope of the work, although it represents a partial adherence to the seminal paper.
The prototype evaluation was structured around four axes. The first was the functional evaluation of the four research questions (Q1 to Q4), conducted by 89 automated tests. The second was a main stress test, composed of 300 queries on a reference template, with answers classified as CORRECT, PARTIAL, INCORRECT, INSUFFICIENT_DATA, or ERROR. The INSUFFICIENT_DATA category indicated a structural gap in the graph, aligned with confidence calibration.
The third axis consisted of the comparison between three architectures: the complete KAG, the classic RAG (using Qdrant with ten closest chunks, threshold 0.5, coupled with the LLM, as per Gao et al., 2024) and the LLM without retrieval. The fourth axis involved quality metrics per response, including ROUGE-1, BLEU-1, entity coverage, Expected Calibration Error (ECE), and latency. A dedicated module calculated the aggregated confidence based on the number of entities, cited sources, and sufficiency declared by the Judger.
3. Results and Discussion
The results obtained from the KAG-Gov prototype, developed for the analysis of the efficiency of Brazilian public management, are presented and discussed in this section. The organization of the exposition covers the scale of the prototype’s construction, its adherence to KAG’s seminal paper (Liang et al., 2024), the functional evaluation of the research questions (Q1 to Q4), the results of the main stress test, and the comparative benchmark between the KAG, RAG, and LLM without retrieval approaches, in addition to the positioning of the findings in recent literature.
The construction of the KAG-Gov prototype resulted in a modular codebase, structured into packages for ingestion, graph construction, persistence, reasoning, observability, and domain models. The developed semantic schema formalizes 54 entity types, 16 conceptual hierarchies, 6 event types, and 36 relation types. This framework is fundamental for the complex representation of governmental data.
The prototype was subjected to a set of 2,464 automated tests, which were collected and approved, reaching an aggregate coverage of 76%. This level of coverage exceeds the 60% threshold usually adopted in applied research, prioritizing the critical paths of the Solver, Builder, and ingestion adapter components. Such scope ensures the reliability of core operations.
The knowledge graph, implemented in Neo4j, demonstrated significant scale, containing 1,181,407 nodes and 2,312,054 relationships, distributed across 43 labels and 22 edge types. Among the standard semantic relationships, 582,383 `belongTo` edges were instantiated, connecting each instance to its corresponding `ConceptType`, and 24 `isA` edges and 22 `synonym` edges were identified, resulting from offline alignment.
Complementarily, the vector index in Qdrant stores 565,233 points of 384 dimensions in the `kag_chunks` collection, with 605,234 vectors indexed by the HNSW structure. The tabular persistence layer, organized in the Medallion format, occupies 204 MB in the Bronze layer, 31 MB in the Silver, and 67 MB in the Gold. These numbers indicate that the prototype transcends a mere academic exercise, configuring itself as a medium-sized functional system, capable of supporting defensible empirical evaluation, as discussed by Han et al. (2025) for GraphRAG experimentation.
The adherence of the KAG-Gov prototype to the five architectural aspects of the seminal paper by Liang et al. (2024) was evaluated. Five out of six aspects were classified as “Implemented”, indicating full adherence. Aspect 2.1, referring to the LLMFriSPG structure, was fully implemented, with 582,383 `belongTo` edges ensuring the explicit link between instance and `ConceptType`, and the formalization of six standard semantic relations and six event types as `EventType` in the graph.
The 2.2 aspect, which deals with mutual indexing between the graph and textual chunks, was implemented in three redundant layers: a `mutual_index` table in DuckDB, `:Chunk` nodes in Neo4j linked by `HAS_CHUNK` and `SUPPORTS` edges (564,555 occurrences each), and the vector collection in Qdrant. The adaptation of semantic chunking by tabular keys (organ and year) to the tabular governmental domain is distinctive, aligned with discussions on RAG in multi-source collections (Edge et al., 2024).
The Logical Form Solver (aspect 2.3) fully reproduced the five standard functions (Retrieval, Sort, Math, Deduce, Output), the iterative cycle with Judger, and hybrid retrieval by RRF fusion. The Knowledge Alignment (aspect 2.4) articulated three offline predictors (semantic relations, instance synonyms, and concept hypernyms), a routine for merging synonymous instances, and online term expansion via `synonym` and `isA` edges.
The only aspect classified as “Missing” was 2.5, referring to the KAG-Model, which involves proprietary fine-tuning via K-LoRA, feedback via AKGF, and integrated generation via OneGen. This architectural decision was intentional, delegating response generation to a GPT-40 model accessed via API. Such an approach is consistent with the predominant practice in recent empirical KAG literature (Yuan et al., 2025; Zhang et al., 2025; Bahr et al., 2025; Huang et al., 2025) and does not compromise the empirical validity of the comparison.
The functional evaluation of the four research questions (Q1 to Q4) was verified by 89 automated tests, distributed as 26 for Q1, 17 for Q2, 20 for Q3, and 26 for Q4. These tests confirmed that the solver triggers the relevant source-crossing templates to answer each question. Question Q1, concerning correlations between spending and performance indicators, was supported by three crossing templates, such as municipality-IDEB, municipality-mortality, and municipality-crime with fiscal indicators.
The P2 question, which investigates patterns, trends, and anomalies in spending, was supported by 13 templates, including one specific for company-sanction-contract intersection, aiming to identify integrity risks in contracts with sanctioned companies. The P3 question, regarding efficiency variation by region and time, was supported by federation unit, municipality, and year filters applied to all templates, in addition to a rule for multi-year queries. The P4 question, concerning actionable recommendations with traceability, combined a prescriptive engine, a source assigner for numerical citations, and the Judger, which indicated the sufficiency of the evidence.
The main stress test, conducted with an Answer Sheet of 300 queries, revealed that 255 answers were classified as CORRECT, two as PARTIAL, 39 as INCORRECT, and four as INSUFFICIENT_DATA. There were no records of ERROR. KAG-Gov’s hit rate was 85.0%, or 85.7% if PARTIAL answers were included. The average reported confidence was 0.821, with an average response time of 6.07 seconds per query.
Responses classified as INSUFFICIENT_DATA were not counted as failures, as the solver refrains from generating factual content when no source supports the answer, behavior aligned with confidence calibration. The average latency of 6.07 seconds is compatible with the deferred analysis profile, not intended for real-time conversational service.
The central hypothesis of the work, that the KAG architecture surpasses classic RAG and LLM without retrieval on open Brazilian governmental data, was verified. In 300 queries, KAG-Gov obtained 255 CORRECT answers (85.0%), while RAG registered 106 (35.3%) and LLM without retrieval only 59 (19.7%). This represents an absolute gain of 49.7 percentage points for KAG over RAG and 65.3 percentage points over LLM.
Considering the CORRECT or PARTIAL answers, KAG-Gov maintained 85.7% accuracy, RAG 37.0%, and LLM 22.0%. The aggregated content quality score, which weighs metrics such as ROUGE-1 F1, BLEU-1, entity coverage, and Solver confidence, favored KAG-Gov prominently, with 0.850, compared to 0.344 for RAG and 0.367 for LLM. RAG showed slightly lower performance than LLM in this metric, reflecting the penalty for irrelevant retrieved passages.
The average confidence reported by the systems themselves also showed a substantial difference: 0.821 for KAG-Gov, 0.736 for RAG, and 0.300 for LLM. The observed average latency was 6.07 seconds for KAG-Gov, 1.52 seconds for RAG, and 2.17 seconds for LLM. Although KAG-Gov is slower, this difference is an explicit cost of structured reasoning, which involves Cypher queries, vector search, RRF fusion, and the iterative cycle of the Judger, operations absent in the alternative approaches.
This trade-off between precision and latency is consistent with the prototype’s offline analysis profile, and Xiang et al. (2025) argue that the gain in precision justifies the additional latency in domains with strong relational structure, compatible with the government efficiency scenario. The disaggregated analysis by thematic category revealed that the KAG-Gov gain was universal across most structured data dimensions.
In expenses by agency, KAG-Gov got 100% of the 27 queries right, while RAG got only 15% and LLM 4%. For SICONFI fiscal indicators, KAG-Gov achieved 100% accuracy in the 25 queries, while RAG and LLM got none right. In tenders and contracts, KAG-Gov got 100% of the 22 queries right, versus zero for the alternative approaches.
In queries that require cross-referencing multiple sources, such as combining municipality, fiscal indicator, and educational performance, KAG-Gov got 100% of the 27 queries right, while RAG got 41% right and LLM only 19%. In regional comparisons by federation unit, KAG-Gov got 85% of the 20 queries right, RAG only 10%, and LLM none. For crime indicators, KAG-Gov got 75% of the 20 queries right, with the other approaches achieving zero correct answers.
The only category in which RAG outperformed KAG-Gov was that of the IDEB indicators, with 90% accuracy for RAG versus 75% for KAG-Gov. This inversion is explained by the data structure: each IDEB indicator is serialized into a chunk by the semantic chunking module, containing the municipality-year pair and the numerical value in a single snippet. This allows RAG to retrieve the answer directly by semantic proximity, without requiring cross-referencing with other sources.
The KAG-Gov, in turn, prioritizes graph paths that traverse municipalities and fiscal exercises, which introduces additional complexity for queries whose answer is already available in plain text format. This finding is consistent with the analysis by Yuan et al. (2025) on how vector search and the graph complement each other, where the cost of traversing the graph is not justified if the chunk already contains the specific answer.
The performance disaggregated by logical function type assigned by the Logical Form Planner confirmed the pattern observed by category. KAG-Gov achieved 100% of the 35 Deduce type queries, 94.3% of the 70 for Retrieval, 83.8% of the 111 for Sort, and 72.6% of the 84 for Math. In contrast, RAG obtained 48.6% in Deduce and Retrieval, 27.9% in Sort, and 28.6% in Math. The LLM, in turn, achieved 57.1% in Deduce, 22.9% in Retrieval, 16.2% in Sort, and 6.0% in Math.
The largest absolute difference occurred in the Math category, with a lead of 44.0 percentage points for KAG-Gov over RAG and 66.6 percentage points over LLM. This finding empirically demonstrates the value of the knowledge graph, as numerical queries requiring aggregation depend on structured access to atomic values, an operation for which vector retrieval is inadequate. The Deduce category, with 100% accuracy for KAG-Gov, reinforces the conclusion of Liang et al. (2024) that declarative reasoning benefits from the formal graph.
Regarding confidence calibration, the Expected Calibration Error (ECE) measured the divergence between reported confidence and empirical accuracy. The values were 0.11 for KAG-Gov, 0.56 for RAG, and 0.10 for LLM. The KAG-Gov and LLM values indicate reasonable calibration, suggesting that reported confidence is a reliable proxy for the probability of correctness. The RAG value, however, indicates systematic overestimation of confidence, as its heuristic elevates confidence when multiple chunks are retrieved, even if irrelevant.
This RAG desynchronization has operational implications, as its confidence cannot be used for automatic approval of responses, unlike KAG-Gov. This advantage is typical of GraphRAG systems and aligns with Bahr et al.’s (2025) observation that adding a knowledge graph in structured domains improves the reliability of reported confidence. Regarding response structure, KAG-Gov produced responses with numerical references linked to sources, extracted named entities, and navigated graph relations.
On average, in the benchmark, KAG-Gov cited 1.00 source per query and returned 2.44 entities, while RAG and LLM did not perform these steps. This structural property corroborates the argument of Bahr et al. (2025) in favor of traceability as a criterion for adopting graph-based architectures in regulated domains, directly applicable to Brazilian public data.
The set of results converges with recent literature and adds empirical evidence for the domain of Brazilian governmental open data. The superiority of KAG-Gov over classic RAG replicates the main finding of Liang et al. (2024): the combination of formal graph with vector retrieval surpasses the approach based solely on embeddings in environments with explicit relational structure.
The pattern of concentrated gain in structural categories, such as fiscal aggregations, cross-overs between organs, and filtrations involving multiple entities, is compatible with the findings of Edge et al. (2024) in GraphRAG, reinforced by the analysis of Xiang et al. (2025) and the empirical evaluation of Yuan et al. (2025) on the use of graphs for retrieval augmentation.
The results are positioned as additional evidence in a little-explored domain in Portuguese, whose institutional maturity is discussed by Kawashita et al. (2024) and Cristina et al. (2025), and whose regulatory context is analyzed by Melati and Janissek-Muniz (2022). The legal application of Oliveira et al. (2026), based on RAG with a graph, corroborates the trend of adopting the technique in Lusophone research.
The performance drop of pure RAG in structural queries (0% versus 100% of KAG-Gov in fiscal and bidding categories) replicates, in a larger sample and with a unified template, the pattern reported by Gao et al. (2024): classic RAG loses effectiveness when the answer is not contained in a single chunk. Bahr et al.’s (2025) demonstration that RAG enrichment with a graph improves queries in a structured domain offers a direct analogy to the gain observed in the Brazilian governmental domain.
Finally, the work by Huang et al. (2025) on delta-KAG anticipates a relevant research agenda for extending the prototype, focusing on the explicit prioritization of the graph over the LLM’s parametric memory in events after the model’s cutoff date. The study by Zhang et al. (2025) on KAG-Thinker suggests a complementary direction: the integration of iterative “chain-of-thought” over the graph, in addition to the already implemented cycles.
In summary, the results demonstrate that the KAG-Gov prototype is a viable and effective solution for analyzing the efficiency of Brazilian public management, outperforming RAG and LLM approaches without retrieval in terms of accuracy, calibration, and traceability, especially in queries requiring complex reasoning and the cross-referencing of heterogeneous data. The findings confirm that the integration of knowledge graphs, hybrid retrieval, and generative models offers a significant advancement for extracting applicable knowledge from open government data, fulfilling the study’s objectives.
4. Conclusion
This study proposed and evaluated the KAG-Gov prototype to improve the analysis of Brazilian public management efficiency, using official open data and seeking to overcome the challenges of data integration and fragmentation. It was found that KAG-Gov, by integrating ten federal sources into a knowledge graph with 1.18 million nodes and 2.31 million relations, and employing hybrid retrieval, achieved 85.0% accuracy on a benchmark of 300 queries. This performance represented a gain of 49.7 percentage points over the classic RAG approach and 65.3 percentage points over the LLM without retrieval. It was observed that the prototype demonstrated confidence calibration five times superior to RAG and offered explicit source traceability, properties absent in the baseline approaches. The superiority of KAG-Gov was particularly evident in queries requiring complex reasoning, such as fiscal aggregations, multi-source cross-referencing, and filtering by multiple entities, confirming the viability of integrating knowledge graphs, vector retrieval, and generative models for public efficiency analysis.
The main contribution of this work lies in the empirical demonstration that the KAG architecture, adapted to the Brazilian governmental tabular domain and supported by an external language model, is effective in converting heterogeneous official data into applicable knowledge, with adequate traceability and calibration for decision support, social control, and auditing. However, the prototype presents limitations, such as an average latency of 6.07 seconds per query, which restricts its use to offline analyses, and the dependence on a reference template generated from the graph itself. For future studies, it is suggested to expand the dataset, mitigate conflicts between the LLM’s parametric knowledge and the graph, integrate deeper interactive reasoning, and validate practical utility with real users. It is also recommended to implement an incremental graph update process in continuous production, with integrity monitoring and periodic reconciliation of synonyms, to ensure the sustainability of the solution in regulated domains.
Bibliographic References
Baek, J.; Aji, A. F.; Saffari, A. 2023. Knowledge-Augmented Language Model Prompting for Zero-Shot Knowledge Graph Question Answering. In: Proceedings of the 1st Workshop on Natural Language Reasoning and Structured Explanations (NLRSE). Toronto, Canadá: Association for Computational Linguistics, p. 78-106. DOI: https://doi.org/10.18653/v1/2023.nlrse-1.7.
Bahr, L.; Wehner, C.; Wewerka, J. et al. 2025. Knowledge graph enhanced retrieval-augmented generation for failure mode and effects analysis. Journal of Industrial Information Integration, v. 45, art. 100807. DOI: https://doi.org/10.1016/j.jii.2025.100807.
Brasil. 2011. Lei nº 12.527, de 18 de novembro de 2011 (Lei de Acesso à Informação). Regula o acesso a informações previsto na Constituição Federal. Disponível em: https://www.planalto.gov.br/ccivil_03/_ato2011-2014/2011/lei/l12527.htm. Acesso em: 9 set. 2026.
Brasil. 2016. Decreto nº 8.777, de 11 de maio de 2016. Institui a Política de Dados Abertos do Poder Executivo Federal. Disponível em: https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2016/decreto/d8777.htm. Acesso em: 9 set. 2026.
Cormack, G. V.; Clarke, C. L. A.; Büttcher, S. 2009. Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods. In: Proceedings of the 32nd International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR ’09). New York: ACM, p. 758-759. DOI: https://doi.org/10.1145/1571941.1572114.
Cristina, I.; Gonze, R.; Santos, J. et al. 2025. Brazil Data Commons: A Platform for Unifying and Integrating Brazil’s Public Data. arXiv preprint arXiv:2511.11755. Disponível em: https://arxiv.org/abs/2511.11755. Acesso em: 9 set. 2026.
DATASUS – Ministério da Saúde. 2024. Portal de Dados Abertos do SUS. Disponível em: https://dadosabertos.saude.gov.br/. Acesso em: 9 set. 2026.
Edge, D.; Trinh, H.; Cheng, N. et al. 2024. From Local to Global: A Graph RAG Approach to Query-Focused Summarization. arXiv preprint arXiv:2404.16130. Disponível em: https://arxiv.org/abs/2404.16130. Acesso em: 9 set. 2026.
Gao, Y.; Xiong, Y.; Gao, X. et al. 2024. Retrieval-Augmented Generation for Large Language Models: A Survey. arXiv preprint arXiv:2312.10997. Disponível em: https://arxiv.org/abs/2312.10997. Acesso em: 9 set. 2026.
Governo Federal do Brasil. 2024a. Portal da Transparência. Disponível em: https://portaldatransparencia.gov.br/. Acesso em: 9 set. 2026.
Governo Federal do Brasil. 2024b. Portal de Dados Abertos. Disponível em: https://dados.gov.br/. Acesso em: 9 set. 2026.
Han, H.; Wang, Y.; Shomer, H. et al. 2025. Retrieval-Augmented Generation with Graphs (GraphRAG). arXiv preprint arXiv:2501.00309. Disponível em: https://arxiv.org/abs/2501.00309. Acesso em: 9 set. 2026.
Huang, P.; Liu, Z.; Yan, Y. et al. 2025. delta-KAG: Mitigating Knowledge Conflicts in Knowledge-Augmented Generation via Parametric Pruning. arXiv preprint arXiv:2502.15543. Disponível em: https://arxiv.org/abs/2502.15543. Acesso em: 9 set. 2026.
IBGE – Instituto Brasileiro de Geografia e Estatística. 2024. API de Serviço de Dados do IBGE. Disponível em: https://servicodados.ibge.gov.br/api/docs/. Acesso em: 9 set. 2026.
INEP – Instituto Nacional de Estudos e Pesquisas Educacionais Anísio Teixeira. 2024. Dados Abertos do INEP. Disponível em: https://www.gov.br/inep/pt-br/acesso-a-informacao/dados-abertos. Acesso em: 9 set. 2026.
Kawashita, I.; Baptista, A. A.; Soares, D.; Andrade, M. 2024. Open government data use: The Brazilian states and federal district cases. PLOS ONE, v. 19, n. 3, e0298157. DOI: https://doi.org/10.1371/journal.pone.0298157.
Liang, L.; Sun, M.; Gui, Z. et al. 2024. KAG: Boosting LLMs in Professional Domains via Knowledge Augmented Generation. arXiv preprint arXiv:2409.13731. Disponível em: https://arxiv.org/abs/2409.13731. Acesso em: 9 set. 2026.
Melati, C.; Janissek-Muniz, R. 2022. A inteligência na gestão pública: uma análise sob a perspectiva institucional. Revista de Administração Pública, v. 56, n. 6, p. 721-744. DOI: https://doi.org/10.1590/0034-761220220103.
Oliveira, V. T.; Silva, D. O.; Souza, M. A. et al. 2026. Retrieval-Augmented Generation and Knowledge Graphs in Portuguese-Language Legal Documents. In: Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026), v. 1. Salvador, Brasil: Association for Computational Linguistics, p. 1-10. Disponível em: https://aclanthology.org/2026.propor-1.1/. Acesso em: 9 set. 2026.
Xiang, Z.; Wu, C.; Zhang, Q. et al. 2025. When to use Graphs in RAG: A Comprehensive Analysis for Graph Retrieval-Augmented Generation. arXiv preprint arXiv:2506.05690. Disponível em: https://arxiv.org/abs/2506.05690. Acesso em: 9 set. 2026.
Yuan, X.; Liu, Y.; Di, S. et al. 2025. A Pilot Empirical Study on When and How to Use Knowledge Graphs as Retrieval Augmented Generation. arXiv preprint arXiv:2502.20854. Disponível em: https://arxiv.org/abs/2502.20854. Acesso em: 9 set. 2026.
Zhang, D.; Xu, J.; Zhou, J. et al. 2025. KAG-Thinker: Interactive Thinking and Deep Reasoning in LLMs via Knowledge-Augmented Generation. arXiv preprint arXiv:2506.17728. Disponível em: https://arxiv.org/abs/2506.17728. Acesso em: 9 set. 2026.
Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform