Intelligent Agent for Legal Health Case Automation: A Case Study in the Brazilian Public Sector
Abstract
This work presents the design, implementation, and evaluation of an intelligent agent developed to support the State Health Attorney’s Office of Ceará (PROSAÚDE) in managing over 3,000 monthly legal cases related to public health. The agent automates key decisions on legal contestation by interpreting court documents and applying internal legal norms. Built under the Judiciary vertical of Ceará’s Chief Scientist Program, the system combines large language models (GPT-4o), regulatory rule sets, and robotic process automation to extract medical/legal data, retrieve external sources (e.g., ANVISA), and generate official dispatches. It ensures consistent application of PROSAÚDE’s Internal Ordinance, which defines when appeals are required. Results show 98.4% precision in rule application and 93.8% recall in medication detection. In human-in-the-loop validation, 98.7% of dispatches required no revision. The solution highlights the potential of AI-driven legal automation to improve efficiency and accuracy in high-volume public workflows.References
Aguirre, S. and Rodriguez, A. (2017). Automation of a business process using robotic process automation (rpa): A case study. In Applied Computer Sciences in Engineering: 4th Workshop on Engineering Applications (WEA 2017), pages 65–71. Springer.
Anagnoste, S. (2018). Robotic automation process – the operating system for the digital enterprise. In Proceedings of the International Conference on Business Excellence, volume 12, pages 54–69.
Costa, D., Mamede, H., and Mira da Silva, M. (2022). Robotic process automation (rpa) adoption: A systematic literature review. Engineering Management in Production and Services, 14(2):1–12.
Devarajan, Y. (2018). A study of robotic process automation use cases today for tomorrow’s business. International Journal of Computer Techniques, 5(6):12–18.
Ivančić, L., Suša Vugec, D., and Bosilj Vukšić, V. (2019). Robotic process automation: Systematic literature review. In Business Process Management: Blockchain and Central and Eastern Europe Forum, pages 280–295. Springer.
Jovanović, S. Z., Ðurić, J. S., and Šibalija, T. V. (2018). Robotic process automation: Overview and opportunities. International Journal Advanced Quality, 46(3–4):34–39.
Khadka, R., Saeidi, A., Idu, A., Hage, J., and Jansen, S. (2013). Legacy to soa evolution: a systematic literature review. In Migrating Legacy Applications: Challenges in Service Oriented Architecture and Cloud Computing Environments, pages 40–70.
Lacity, M. and Willcocks, L. (2016). Robotic process automation at telefonica o2. MIS Quarterly Executive, 15(1). Article 4.
Lamberton, C., Brigo, D., and Hoy, D. (2017). Impact of robotics, rpa and ai on the insurance industry: Challenges and opportunities. Journal of Financial Perspectives, 4(1).
Ng, K., Chen, C.-H., Lee, C., Jiao, J., and Yang, Z.-X. (2021). A systematic literature review on intelligent automation: Aligning concepts from theory, practice, and future perspectives. Advanced Engineering Informatics, 47:101246.
Patrício, L., Varela, L., and Silveira, Z. (2024). Integration of artificial intelligence and robotic process automation: Literature review and proposal for a sustainable model. Applied Sciences, 14:9648.
Radke, A. M., Dang, M. T., and Tan, A. (2020). Using robotic process automation (rpa) to enhance item master data maintenance process. LogForum, 16(1).
Tsaih, R. H. and Hsu, C. C. (2018). Artificial intelligence in smart tourism: A conceptual framework.
Van der Aalst, W. M., Bichler, M., and Heinzl, A. (2018). Robotic process automation. Business & Information Systems Engineering, 60:269–272.
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Chi, E., Le, Q., and Zhou, D. (2022). Chain of thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems, volume 35, pages 24877–24891.
Anagnoste, S. (2018). Robotic automation process – the operating system for the digital enterprise. In Proceedings of the International Conference on Business Excellence, volume 12, pages 54–69.
Costa, D., Mamede, H., and Mira da Silva, M. (2022). Robotic process automation (rpa) adoption: A systematic literature review. Engineering Management in Production and Services, 14(2):1–12.
Devarajan, Y. (2018). A study of robotic process automation use cases today for tomorrow’s business. International Journal of Computer Techniques, 5(6):12–18.
Ivančić, L., Suša Vugec, D., and Bosilj Vukšić, V. (2019). Robotic process automation: Systematic literature review. In Business Process Management: Blockchain and Central and Eastern Europe Forum, pages 280–295. Springer.
Jovanović, S. Z., Ðurić, J. S., and Šibalija, T. V. (2018). Robotic process automation: Overview and opportunities. International Journal Advanced Quality, 46(3–4):34–39.
Khadka, R., Saeidi, A., Idu, A., Hage, J., and Jansen, S. (2013). Legacy to soa evolution: a systematic literature review. In Migrating Legacy Applications: Challenges in Service Oriented Architecture and Cloud Computing Environments, pages 40–70.
Lacity, M. and Willcocks, L. (2016). Robotic process automation at telefonica o2. MIS Quarterly Executive, 15(1). Article 4.
Lamberton, C., Brigo, D., and Hoy, D. (2017). Impact of robotics, rpa and ai on the insurance industry: Challenges and opportunities. Journal of Financial Perspectives, 4(1).
Ng, K., Chen, C.-H., Lee, C., Jiao, J., and Yang, Z.-X. (2021). A systematic literature review on intelligent automation: Aligning concepts from theory, practice, and future perspectives. Advanced Engineering Informatics, 47:101246.
Patrício, L., Varela, L., and Silveira, Z. (2024). Integration of artificial intelligence and robotic process automation: Literature review and proposal for a sustainable model. Applied Sciences, 14:9648.
Radke, A. M., Dang, M. T., and Tan, A. (2020). Using robotic process automation (rpa) to enhance item master data maintenance process. LogForum, 16(1).
Tsaih, R. H. and Hsu, C. C. (2018). Artificial intelligence in smart tourism: A conceptual framework.
Van der Aalst, W. M., Bichler, M., and Heinzl, A. (2018). Robotic process automation. Business & Information Systems Engineering, 60:269–272.
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Chi, E., Le, Q., and Zhou, D. (2022). Chain of thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems, volume 35, pages 24877–24891.
Published
2025-09-29
How to Cite
ROCHA, L.; AMARO, B.; FURTADO, V.; DUQUE, N.; MENEZES, V.; CLÁUDIO, J..
Intelligent Agent for Legal Health Case Automation: A Case Study in the Brazilian Public Sector. In: NATIONAL MEETING ON ARTIFICIAL AND COMPUTATIONAL INTELLIGENCE (ENIAC), 22. , 2025, Fortaleza/CE.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2025
.
p. 997-1008.
ISSN 2763-9061.
DOI: https://doi.org/10.5753/eniac.2025.14301.
