Which AI project should a government build first? The method behind the Gov.br agent

AI
LLM
public sector
data
With nearly 40 ministries, 180 agencies and up to 5,000 services on one portal, the hard part of public-sector AI is choosing what to build. A methodology presented at WEBIST 2024 and revised for LNBIP combines an elimination filter, AHP Express, problem framing and a Design Sprint, and it led to the design of a generative agent for the Gov.br portal.
Author

Pedro Carvalho Brom

Published

December 4, 2024

Picture the meeting. A digital-government team has a list of AI proposals from several departments, each one sponsored by someone who is sure their problem is the urgent one. One wants to automate account recovery, another wants a better support channel, a third wants an assistant for the whole portal. There is budget for one prototype. Whatever gets picked, someone will ask why it was that one, and “it seemed the most promising” is not an answer that survives an audit.

That is the problem behind Implementing AI for Enhanced Public Services Gov.br: A Methodology for the Brazilian Federal Government, a paper I wrote with colleagues from the University of Brasília, the Ministry of Management and Innovation in Public Services and other Brazilian institutions, and presented at WEBIST 2024 (DOI 10.5220/0012997000003825). A revised version, AI for Enhanced Public Services Gov.br, appeared in 2026 in the volume of revised selected papers of WEBIST 2024, Lecture Notes in Business Information Processing 583 (DOI 10.1007/978-3-032-25534-1_1). Its abstract describes the same methodology and the same Gov.br application. The figures and steps below come from the conference version, which is published under a CC BY-NC-ND 4.0 licence.

This post expands a LinkedIn post of 4 December 2024: linkedin.com/feed/update/urn:li:share:7270189068670402560.

The scale of the problem

The Gov.br portal gathers pages from nearly 40 ministries and 180 public agencies and integrates up to 5,000 public services. When the paper was written, citing a government news agency report from March 2024, over 150 million Brazilians accessed it, with about four thousand accesses per second. At that scale, any AI system placed in front of citizens touches a great many people, and so does a bad choice of what to build.

The paper states its research question bluntly. What is the best method for selecting AI projects in government when the issues must be judged subjectively and there are more than ten alternatives? The work belonged to a project of the federal government’s Artificial Intelligence Hub (NIA), executed by the University of Brasília through its LAMFO lab together with the Secretariat of Digital Government (SGD).

Seven steps from a demand to a prototype

The methodology runs in seven steps, followed by validation. A survey collects the AI needs of agencies, and in the application it used 16 open-ended questions on service context, problem characterization, AI needs and AI solution, preceded by a preamble on generative AI and the limits of large language models. An elimination step filters out proposals that AI cannot actually address. An AHP classifier ranks those that remain. Problem framing makes the chosen problem explicit. An adapted Design Sprint, a short time-boxed workshop in which a small team goes from a loosely understood problem to a prototype solution, turns it into a solution. A conceptual prototype (Type 1) defines requirements and an initial architecture, and a working prototype (Type 2) implements it in Python as a minimum viable product. Validation, the last stage, was still under development when the paper was written.

Two of these steps carry most of the method, and they are the ones worth copying.

Why elimination comes before AHP

The Analytic Hierarchy Process (SAATY, 1977) asks decision makers to compare alternatives in pairs on a 1 to 9 scale and derives priorities from those judgments. It works well with a handful of options. Saaty indicates that consistency is expected to be low when comparisons involve more than nine elements, and a government survey easily produces more than nine proposals. So the authors placed an elimination step before the ranking.

Elimination is deliberately coarse. Every proposal answers a fixed set of sub-criteria grouped under technical feasibility, data, the proposed solution, societal impact and strategic alignment, with three possible answers, YES, NO and I DON’T KNOW. A single NO on any sub-criterion removes the proposal. Each YES scores 1 and each I DON’T KNOW scores 0, the scores are summed, and the nine highest go on to the AHP. The paper reads that score as maturity, and ties among the top nine are broken by giving the most relevant criterion a weight of 2, only when a tie occurs.

The rule has a property worth naming. “I don’t know” does not kill a proposal, it only costs a point, while “no” is final. A team that has not yet checked whether its data exist stays in the race behind teams that have, and a team whose data do not exist leaves it.

AHP Express, with people in the room

The ranking uses AHP Express (LEAL, 2020), a simplified AHP that assumes the judgments are consistent. Instead of comparing every pair, the respondent judges the preferred alternative against each of the others, and the remaining comparisons follow from that first line of judgments. For nine proposals, by my count, that means 8 judgments per criterion instead of the 36 pairs of the full method, which is why the authors considered it suitable for agile project management. Inconsistency is not computed, because consistency is assumed.

There are eight criteria: urgency of the solution, availability of data sources, breadth of population reach, value to the user, projected access volume and cost, low technical effort, ease of implementation, and risks, ethics and the Brazilian data protection law (LGPD). Each one reached stakeholders through concrete sub-questions, such as how long the problem would take to solve without AI, whether internal data are reliable, or whether the solution would be accessible across income levels and digital skills.

Who answers matters as much as what is asked. The paper recommends three meetings for each segment, one with expert researchers, one with members of the segment and one with the SGD group, each with two to four people. The final score of each criterion is the geometric mean of the three groups.

The worked example

In the application, the survey ran in the SGD department responsible for digital public service platforms and raised three proposals: automated recovery of access to the Gov.br account, the citizen support channels of the general coordination for automation and service, and a citizen service channel for public services on the Gov.br portal. Elimination was carried out by four people from that coordination, two AI professors, a facilitator professor and SGD staff, and all three proposals passed. Three groups then answered the AHP Express, AI professors, SGD public servants and public servants from the area where the demand originated. The portal-wide service channel was selected for prototyping, and the paper notes that the results highlight the weight of reaching a large share of the population.

Problem framing then fixed what success would mean. The one-year goal was to increase public service engagement through Gov.br by 100%, and the long-term phrase was to reduce requests to the support channels, Gov.br account support and the ombudsman, by 25%. These are targets set at the framing stage, not measured results. The Design Sprint ran three of its five classic stages (understand and map, sketch, decide) in two days with a multidisciplinary squad.

What the agent was designed to do

The outcome was the design of an advanced generative agent for the portal, one that talks with citizens, clarifies doubts, sends them to the right service page and hands over to a human when needed. The architecture in the paper has five parts. Documents are collected, restructured and summarized into a FAQ. Text, topics and keywords are extracted with document intelligence tools. A vector database is built with layout-aware semantic chunking, embeddings and indexes organized by theme and problem.

The prompt sets polite, accessible language adapted to different user profiles, lists topics the agent will not discuss, such as political matters or prejudice, carries in-context examples (step-by-step service guides, lost Gov.br access, processes that need human intervention, complaint instructions) and gives support links, operating hours and contact details for the handover. For search, the paper proposes a LLaMA model trained on Portuguese with retrieval-augmented fine-tuning, RAFT (ZHANG et al., 2024), which combines supervised fine-tuning with retrieval-augmented generation (LEWIS et al., 2020).

Before any of that, the methodology applies Lean Office practices, the lean approach of eliminating waste applied to administrative processes. Waste is removed and the process standardized before automation is even evaluated, and once the process is automated a continuous improvement loop keeps refining the agent’s workflow. Automating a process before cleaning it only makes the waste run faster.

What the paper does and does not claim

The paper reports a method and one application of it. It does not report how the agent performed with citizens, because validation was still under development. That limit deserves to be stated plainly, and it also shows where the method earns its keep. The elimination filter and the framing step are cheap defences against three ways a project can go wrong before any model is trained: the wrong problem, data that do not exist, and a process nobody cleaned.

The discussion closes with a suggestion for scaling up. Other projects were selected with the same methodology across agencies and secretariats, and to harmonize those selections the authors propose uniform weights for all criteria, so that each project is judged from the perspective of the country rather than of a single secretariat.

What comes after selection, monitoring a model that drifts, deciding who answers for its errors, how much explanation a decision requires and how much control the agency keeps, is the subject of a separate post.

Put the list of AI ideas on your own table through the same sub-questions, with “no” as a veto, and count what is still standing. The proposal you favour may not be among them, and it is better to learn that before the prototype than after.


Paper. MELO, M. K. de et al. Implementing AI for Enhanced Public Services Gov.br: A Methodology for the Brazilian Federal Government. In: INTERNATIONAL CONFERENCE ON WEB INFORMATION SYSTEMS AND TECHNOLOGIES, 20., 2024, Porto. Proceedings of WEBIST 2024. Setúbal: SciTePress, 2024. p. 90-101. DOI: 10.5220/0012997000003825. Paper page: https://pcbrom.com/papers/2024-implementing-ai-for-enhanced-public-services-gov-br-a-methodology-for/. The paper was a Best Industrial Paper Candidate at WEBIST 2024.

Revised version. SOUZA, J. G. de M. et al. AI for Enhanced Public Services Gov.br. In: MARCHIORI, M.; GARCÍA PEÑALVO, F.; ABERER, K. (ed.). Web Information Systems and Technologies: 20th International Conference, WEBIST 2024, Revised Selected Papers. Cham: Springer, 2026. (Lecture Notes in Business Information Processing, 583). p. 3-17. DOI: 10.1007/978-3-032-25534-1_1. Paper page: https://pcbrom.com/papers/2026-ai-for-enhanced-public-services-gov-br/.

References.

LEAL, J. E. AHP-express: a simplified version of the analytical hierarchy process method. MethodsX, v. 7, 100748, 2020. DOI: 10.1016/j.mex.2019.11.021.

LEWIS, P. et al. Retrieval-augmented generation for knowledge-intensive NLP tasks. In: ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS, 33., 2020. Proceedings. p. 9459-9474.

SAATY, T. L. A scaling method for priorities in hierarchical structures. Journal of Mathematical Psychology, v. 15, n. 3, p. 234-281, 1977. DOI: 10.1016/0022-2496(77)90033-5.

ZHANG, T. et al. RAFT: adapting language model to domain specific RAG. arXiv:2403.10131, 2024.

Both versions of the paper are available through their DOIs, 10.5220/0012997000003825 and 10.1007/978-3-032-25534-1_1. I write about this kind of work, scientific method, statistics, and AI applied with rigor, on LinkedIn: linkedin.com/in/pcbrom.