FarmacIA: A RAG-Based Pharmaceutical Assistant for Brazilian Portuguese Medicine Leaflets
Resumo
Este trabalho apresenta um assistente farmacêutico baseado em Retrieval-Augmented Generation para responder perguntas sobre bulas de medicamentos em português do Brasil. Foram avaliados sete pipelines RAG, com diferentes estratégias de roteamento, recuperação, fusão de evidências, reranking e mecanismos de segurança, utilizando modelos de linguagem de pequeno porte gerais e especializados em saúde. O estudo construiu um benchmark com perguntas sobre três medicamentos, estratificadas por dificuldade e anotadas com seções e evidências esperadas. A avaliação combinou métricas de recuperação, similaridade textual e julgamento automatizado por LLM. Os resultados indicam que pipelines mais controlados, especialmente o Guarded RAG, melhoram a recuperação de evidências e a fundamentação das respostas, embora com maior custo computacional. Também se observou que a qualidade do modelo gerador permanece decisiva em perguntas complexas.Referências
Garcia, G. L., Paiola, P. H., Correia, J. V. M., Rodrigues, D., and Papa, J. P. (2026). Retrieval-augmented generation for clinical question answering in Portuguese drug leaflets: Benefits and limitations. In Souza, M., de Dios-Flores, I., Santos, D., Freitas, L., Souza, J. W. d. C., and Ribeiro, E., editors, Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026) - Vol. 2, pages 112–120, Salvador, Brazil. Association for Computational Linguistics.
Garg, M., Raza, S., Rayana, S., Liu, X., and Sohn, S. (2026). The rise of small language models in healthcare: A comprehensive survey. Computer Science Review, 62:100999.
Kim, J., Hur, M., and Min, M. (2025). From rag to qa-rag: Integrating generative ai for pharmaceutical regulatory compliance process. Proceedings of the 40th ACM/SIGAPP Symposium on Applied Computing.
Navarro, L. C., Mutz, F., Paixão, T. M., Zanetti, G. G., Badue, C., Souza, A. F. D., and Oliveira-Santos, T. (2025). Ragpharma: A rag-based chatbot for medicine leaflets with a dual-dataset evaluation framework. J. Braz. Comput. Soc., 31:1137–1149.
Pingua, B., Sahoo, A., Kandpal, M., Murmu, D., Rautaray, J., Barik, R., and Saikia, M. (2025). Medical llms: Fine-tuning vs. retrieval-augmented generation. Bioengineering, 12.
Scalercio, A., Bertotto, E., Jesus, S., Finatto, M. J., and Paes, A. (2026). Annotation guidelines and challenges for automatic simplification of Portuguese drug leaflets. In Souza, M., de Dios-Flores, I., Santos, D., Freitas, L., Souza, J. W. d. C., and Ribeiro, E., editors, Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026) - Vol. 2, pages 121–127, Salvador, Brazil. Association for Computational Linguistics.
Sohn, J., Park, Y., Yoon, C., Park, S., Hwang, H., Sung, M., Kim, H., and Kang, J. (2025). Rationale-guided retrieval augmented generation for medical question answering. In Chiruzzo, L., Ritter, A., and Wang, L., editors, Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 12739–12753, Albuquerque, New Mexico. Association for Computational Linguistics.
Taylor, N., Ghose, U., Rohanian, O., Nouriborji, M., Kormilitzin, A., Clifton, D. A., and Nevado-Holgado, A. (2024). Efficiency at scale: Investigating the performance of diminutive language models in clinical tasks. Artificial intelligence in medicine, 157:103002.
Thirunavukarasu, A. J., Ting, D. S. J., Elangovan, K., Gutierrez, L., Tan, T. F., and Ting, D. S. W. (2023). Large language models in medicine. Nature Medicine, 29(8).
Xiong, G., Jin, Q., Lu, Z., and Zhang, A. (2024). Benchmarking retrieval-augmented generation for medicine. In Ku, L.-W., Martins, A., and Srikumar, V., editors, Findings of the Association for Computational Linguistics: ACL 2024, pages 6233–6251, Bangkok, Thailand. Association for Computational Linguistics.
Zhang, G., Xu, Z., Jin, Q., Chen, F., Fang, Y., Liu, Y., Rousseau, J. F., Xu, Z., Lu, Z., Weng, C., and Peng, Y. (2025). Leveraging long context in retrieval augmented language models for medical question answering. NPJ Digital Medicine, 8.
Garg, M., Raza, S., Rayana, S., Liu, X., and Sohn, S. (2026). The rise of small language models in healthcare: A comprehensive survey. Computer Science Review, 62:100999.
Kim, J., Hur, M., and Min, M. (2025). From rag to qa-rag: Integrating generative ai for pharmaceutical regulatory compliance process. Proceedings of the 40th ACM/SIGAPP Symposium on Applied Computing.
Navarro, L. C., Mutz, F., Paixão, T. M., Zanetti, G. G., Badue, C., Souza, A. F. D., and Oliveira-Santos, T. (2025). Ragpharma: A rag-based chatbot for medicine leaflets with a dual-dataset evaluation framework. J. Braz. Comput. Soc., 31:1137–1149.
Pingua, B., Sahoo, A., Kandpal, M., Murmu, D., Rautaray, J., Barik, R., and Saikia, M. (2025). Medical llms: Fine-tuning vs. retrieval-augmented generation. Bioengineering, 12.
Scalercio, A., Bertotto, E., Jesus, S., Finatto, M. J., and Paes, A. (2026). Annotation guidelines and challenges for automatic simplification of Portuguese drug leaflets. In Souza, M., de Dios-Flores, I., Santos, D., Freitas, L., Souza, J. W. d. C., and Ribeiro, E., editors, Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026) - Vol. 2, pages 121–127, Salvador, Brazil. Association for Computational Linguistics.
Sohn, J., Park, Y., Yoon, C., Park, S., Hwang, H., Sung, M., Kim, H., and Kang, J. (2025). Rationale-guided retrieval augmented generation for medical question answering. In Chiruzzo, L., Ritter, A., and Wang, L., editors, Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 12739–12753, Albuquerque, New Mexico. Association for Computational Linguistics.
Taylor, N., Ghose, U., Rohanian, O., Nouriborji, M., Kormilitzin, A., Clifton, D. A., and Nevado-Holgado, A. (2024). Efficiency at scale: Investigating the performance of diminutive language models in clinical tasks. Artificial intelligence in medicine, 157:103002.
Thirunavukarasu, A. J., Ting, D. S. J., Elangovan, K., Gutierrez, L., Tan, T. F., and Ting, D. S. W. (2023). Large language models in medicine. Nature Medicine, 29(8).
Xiong, G., Jin, Q., Lu, Z., and Zhang, A. (2024). Benchmarking retrieval-augmented generation for medicine. In Ku, L.-W., Martins, A., and Srikumar, V., editors, Findings of the Association for Computational Linguistics: ACL 2024, pages 6233–6251, Bangkok, Thailand. Association for Computational Linguistics.
Zhang, G., Xu, Z., Jin, Q., Chen, F., Fang, Y., Liu, Y., Rousseau, J. F., Xu, Z., Lu, Z., Weng, C., and Peng, Y. (2025). Leveraging long context in retrieval augmented language models for medical question answering. NPJ Digital Medicine, 8.
Publicado
19/10/2026
Como Citar
FERNANDES, Sílvio R.; ERNESTO, Pablo; SOUSA, Joás G. Barros de; ARAÚJO, Sérgio R. F..
FarmacIA: A RAG-Based Pharmaceutical Assistant for Brazilian Portuguese Medicine Leaflets. In: ENCONTRO NACIONAL DE INTELIGÊNCIA ARTIFICIAL E COMPUTACIONAL (ENIAC), 23. , 2026, Cuiabá/MT.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2026
.
p. 1946-1957.
ISSN 2763-9061.
DOI: https://doi.org/10.5753/eniac.2026.31468.
