LIA: The intelligent AI assistant
Making Portuguese legislation easier to access with INCM
ABOUT THIS SUCCESS STORY
Imprensa Nacional-Casa da Moeda (INCM) modernized the way citizens and professionals access legal information through LIA, an intelligent AI assistant developed in partnership with Xpand IT. This solution, powered by Azure OpenAI Service and Azure AI Search, makes it easier to search for and understand Portuguese legislation by eliminating linguistic, technical, and structural barriers.
SCOPE OF THIS SOLUTION
- Retrieval-Augmented Generation (RAG)
- Azure OpenAI Service
- Azure AI Search
- Hybrid Search
The challenge: accessible and understandable legal information
INCM’s main objective was to ensure that legal information from the Diário da República would be easily accessible and understandable for both regular citizens and legal professionals. However, the complexity of legal texts made access difficult, requiring specialized technical knowledge for interpretation.
Additionally, the existing search structure relied on exact keyword matches, making it inefficient for users unfamiliar with the correct legal terminology. This limitation created a strong need for a system capable of interpreting user intent.
A key challenge was ensuring credibility in the assistant’s answers. As the public entity responsible for publishing official legislation, INCM could not risk having an AI assistant generate incorrect or misleading information. It was essential that every response be strictly based on official sources, avoiding AI hallucinations.
Another development challenge, highlighted by legal experts, was supporting searches for specific legal articles. Some users search for broad legal concepts without knowing exactly where to find the information, while others—such as legal professionals—know precisely what they’re looking for and need quick access to specific articles. The solution therefore needed to handle both general questions in natural language and direct queries about specific legal provisions.
Accessible legislation
clear and understandable for all citizens.
Improved search experience
allowing users to find information even without knowing exact technical terms.
Reliable answers
based exclusively on official sources.
The solution: intelligent AI search assistant
To address these challenges, Xpand IT developed a solution based on a Retrieval-Augmented Generation (RAG) approach, combining hybrid search techniques with advanced generative AI models. The solution incorporated Azure OpenAI Service and Azure AI Search, ensuring that all responses were generated using official data directly sourced from the Diário da República.
The first step involved creating a structured knowledge base made up of pre-indexed legal documents. The hybrid search system was designed to combine vector-based search with keyword search, allowing users to find relevant information even without using the exact legal terms.
The search functionality was optimized for two scenarios: for users without legal expertise, the assistant interprets natural language questions to find relevant information; for legal professionals, hybrid search allows for direct access to specific articles and legal documents using structured metadata.
To avoid AI hallucinations, the model was restricted to only respond using verified official sources. Evaluation workflows were implemented to validate the intelligent AI assistant ’s behavior at scale.
Impartiality was another key requirement. The AI assistant was configured to avoid offering any kind of legal advice, strictly providing factual information. To reinforce transparency, responses include direct references to the source articles, allowing users to consult the original document for more detail.
With this approach, LIA, the intelligent AI assistant, became an essential tool for improving access to legislation, simplifying legal research, and enhancing the user experience for all.

"The experience was very positive, and Xpand IT was fully available and committed to achieving successful outcomes."
Bruno Pereira
Diretor, INCM
Benefits: accessible and clear legislation
Greater accessibility
Users can quickly find what they need without needing to understand complex legal jargon.
Accuracy and credibility
Responses are based on verified sources, avoiding misinformation.
Enhanced search for professionals
Lawyers and legal experts can efficiently access laws and regulations.
Simplified legal understanding
LIA translates complex legal language into plain terms, democratizing access to legal knowledge.
Clear responses
Instead of showing full legal texts, LIA provides accessible summaries.

"Xpand IT’s biggest strength was already knowing and mastering the state-of-the-art technologies required for this project. As a result, both the prototyping phase and the implementation of specific features had a clearly faster time-to-market compared to previous in-house projects at INCM. In this sense, the partnership worked very well."
Ricardo Matias
Program & Project Manager, INCM
Technologies


About INCM
Headquarters: Lisbon, Portugal
Imprensa Nacional-Casa da Moeda is the official entity responsible for publishing legislation in Portugal. It manages and publishes the Diário da República, ensuring public access to laws, regulations, and government decrees.
Mission and values
- To create, produce, and deliver goods and services that require high security standards, with a focus on user experience and innovative solutions.
Type of solution
- Legal virtual assistant powered by Generative AI
- A hybrid search and natural language platform that tailors the experience for both everyday citizens and professionals
- A reliable and impartial solution with direct references to official legislation
Read more
We believe in partnerships that deliver results
This success story shows what’s possible when collaboration happens. Shall we talk?