Saltar al contenido
República del Perú · Observatorio de la producción científica universitaria
OApol.org Observatorio de Inteligencia Científica Universitaria del Perú
OApol.org
Inicio Universidades Publicaciones Investigadores
Repositorios
Tesis y trabajos académicosRevistas
Indicadores
Ranking trimestralRanking por carreraObjetivos de Desarrollo SostenibleReporte OCDERed neuronal 3D
Acerca
MetodologíaPrivacidad

Intelligent Query System for Consumer Protection Regulations in Perú Using Hierarchical Vector Databases

Cárdenas-Martínez F.; Arroyo-Paz A. · Communications in Computer and Information Science (2026) · DOI: 10.1007/978-3-032-20322-9_9

Resumen

This paper presents the design and implementation of an intelligent query system for the Consumer Protection and Defense Code of Peru (Law No. 29571). The system enables users to ask questions in natural language and receive legally grounded answers. A hierarchical vector database is employed, structured into chapters, subchapters, articles, and content, and indexed using semantic embeddings. The implementation integrates technologies such as ChromaDB with a SQLite backend and a Retrieval-Augmented Generation (RAG) pipeline, leveraging the GPT-4o-mini model, which was selected for its high efficiency and low token consumption. During validation, 60 representative queries were evaluated using the LLM-as-a-Judge technique, with faithfulness and answer relevancy metrics assessed via DeepEval. A comparative analysis among generative models (GPT-4o-mini, Claude 3 Haiku, and GPT-3.5-turbo) revealed that GPT-4o-mini provided the best balance between computational cost and semantic performance. The results confirm the system’s effectiveness in making legal information accessible to users without legal expertise. This approach contributes to the democratization of legal knowledge in everyday scenarios. © The Author(s), under exclusive license to Springer Nature Switzerland AG 2026.

Instituciones: Universidad Nacional de San Agustín de Arequipa