Developing and putting into practice an intelligent legal assistant for public procurement: An enhanced hybrid RAG method
The increasing complexity of public procurement regulations poses significant challenges for public administrations in accessing, interpreting, and managing regulatory information efficiently. In Morocco, this challenge is amplified by the large volume of legal documents, frequent regulatory updates, and the presence of numerous scanned archives. To address these issues, this paper proposes a sovereign Artificial Intelligence framework based on a Retrieval-Augmented Generation (RAG) architecture for regulatory knowledge management within public administration. The proposed solution operates entirely in an On-Premise environment, ensuring data confidentiality and digital sovereignty. It integrates an Optical Character Recognition (OCR) pipeline for processing scanned documents, a hybrid retrieval mechanism combining semantic and lexical search, and a locally deployed Large Language Model (Llama-3-8B-Instruct) for context-aware answer generation. The framework was evaluated using a corpus of more than 1,200 regulatory documents and a Golden Dataset composed of 50 expert-validated question-answer pairs. Experimental results achieved a Recall@5 of 92.4%, an MRR@10 of 0.94, and a semantic similarity score of 92.4%, outperforming conventional retrieval approaches while maintaining low response latency. The results demonstrate the potential of sovereign generative AI to enhance regulatory knowledge management, improve information accessibility, and support decision-making processes within Moroccan public administration.