Submitted:
11 July 2026
Posted:
13 July 2026
You are already at the latest version
Abstract
Keywords:
1. Introduction
1.1. Motivation and Research Opportunity
1.2. Proposed Approach
- 1.
- Automated CSV Processing: Multi-stage preprocessing pipeline with format detection, type inference, date normalization, duplicate removal, and K-Nearest Neighbors imputation for missing values
- 2.
- AI-Driven KPI Generation: LLM-based KPI suggestion with user validation, dynamic code generation for calculations, three-tier security validation (syntax, pattern matching, semantic checks), and sandboxed execution with timeout enforcement
- 3.
- Interactive Dashboard Creation: Automated generation of HTML dashboards with Plotly visualizations, temporal organization, year-over-year comparisons, and responsive layouts
- 4.
- Contextual Training Delivery: Structured KPI documentation, natural language question answering, and concept explanation grounded in hotel management contexts
- 5.
- Adaptive Assessment: Multi-format question generation (true/false, multiple-choice, open-ended, situational), automated evaluation with LLM-based rubric scoring, and personalized feedback with improvement suggestions
1.3. Contributions
- 1.
- Integrated Architecture: A complete system design combines conversational AI, data processing, generative models, visualization, and training within a unified framework, demonstrating how these components can work together securely and effectively
- 2.
- Secure Code Generation Methodology: A novel approach to LLM-driven code generation with multi-tier validation and sandboxed execution that maintains security while enabling flexibility in KPI definition and calculation
- 3.
- Automated CSV Processing Pipeline: A robust preprocessing system achieving 100% success across heterogeneous formats with automatic handling of common data quality issues
- 4.
- Domain-Specific AI Application: Demonstration that generative AI can be effectively applied to specialized business analytics domains (hospitality management) with appropriate architectural patterns and validation mechanisms
- 5.
- TRL 4 Validation Results: Comprehensive experimental validation establishing technical feasibility through 91.5% functional success rate, acceptable performance characteristics, and effective training/assessment capabilities
1.4. Related Work
1.4.1. Large Language Models and Generative AI
1.4.2. Code Generation with Language Models
1.4.3. Data Processing and Analytics Automation
1.4.4. Visualization and Dashboard Generation
1.4.5. Intelligent Tutoring and Assessment Systems
1.4.6. Research Gaps and Positioning
2. Methods
2.1. System Architecture and Design
2.1.1. Architectural Overview
2.1.2. Design Principles
2.1.3. Presentation Layer: Conversational Interface
2.1.4. Business Logic Layer: Orchestration
- 1.
- main.py: Entry point with authentication, session initialization, and message routing
- 2.
- analisis.py: CSV preprocessing, KPI generation, and dashboard creation
- 3.
- formar.py: Training content delivery and LLM-based tutoring
- 4.
- evaluar.py: Question generation and assessment for individual KPIs
- 5.
- examen.py: Global examination system with multi-format questions
- 6.
- callbacks.py: Event handlers for user actions (button clicks, responses)
- 7.
- utils.py: Shared utilities for button generation and workflow orchestration
- 8.
- opciones.py: Configuration of all available user options and workflows
2.1.5. Data Processing Layer
CSV Preprocessing Pipeline
KPI Suggestion and Validation
Automated KPI Calculation
- Process Isolation: Separate process prevents direct memory access to main application
- Timeout Enforcement: 30-second timeout via the timeout parameter of subprocess.run(). TimeoutExpired exception terminates execution if exceeded.
- Output Capture: Both stdout and stderr are captured (stdout=PIPE, stderr=PIPE) for error reporting
- Temporary File Cleanup: The temporary script is deleted via os.remove(tmp_path) after execution regardless of success or failure
2.1.6. Visualization Layer: Dashboard Generation
2.1.7. AI Inference Layer: LLM Integration
- Gemini 2.5 Flash (config["model_cuadro2"]): Used for KPI suggestion from CSV data and code generation for KPI calculation
- Gemini 2.0 Flash (config["model_name"]): Used for data analysis queries, training content explanations, and evaluation feedback
2.1.8. Training and Evaluation Subsystem
- 1.
- PROMPT_FORMAR_PREGUNTA_VF: True/False assertions about KPI concepts
- 2.
- PROMPT_FORMAR_PREGUNTA_OPCIONES: Multiple-choice with 3-4 options and plausible distractors
- 3.
- PROMPT_FORMAR_PREGUNTA_ABIERTA: Open-ended questions requiring explanatory responses
- 4.
- PROMPT_FORMAR_PREGUNTA_SITUACION: Situational scenarios requiring decision-making
- Objective Questions: True/false and multiple-choice questions use exact string matching against stored answer keys for instant, deterministic scoring
- Open-ended Questions: Evaluated using PROMPT_EVAL_PREGUNTA_ABIERTA, which instructs the LLM to compare the user’s response against the expected answer, provide explanatory feedback, and assign a score in format "Puntos: X/10"
- Situational Questions: Evaluated using PROMPT_EVAL_SITUACION with similar structure, assessing the appropriateness of the user’s decision-making approach
2.1.9. Infrastructure and Deployment
2.2. Implementation Details
2.2.1. Technology Stack
2.2.2. CSV Preprocessing Implementation
Preprocessing Pipeline
- 1.
- Format Detection: The first line of the file is inspected to determine the field delimiter using a priority-based heuristic. Tab characters are preferred when present; otherwise, semicolon or comma delimiters are selected based on frequency analysis. Files are read using UTF-8 encoding with tolerant error handling. When heuristic detection fails, Python’s csv.Sniffer is applied to a fixed-size byte sample.
- 2.
- Data Loading: The dataset is loaded into a pandas DataFrame using the detected delimiter.
- 3.
- Missing Value Filtering: For each column, the fraction of missing values is computed. Columns exceeding a missing value threshold of are removed.
- 4.
- Numeric Imputation: Remaining numeric columns are imputed using K-Nearest Neighbors imputation with neighbors, applied jointly across numeric features.
- 5.
- Temporal Detection: Temporal information is identified using a combination of regular expression matching (for explicit year, month, or date columns) and heuristic parsing of object-type columns using date parsing with fuzzy matching. When a date column is detected, year and month components are extracted.
- 6.
- Temporal Normalization: Year and month values are converted to numeric representations, interpolated when partially missing, clipped to valid ranges, and normalized. Month values are mapped to standardized Spanish month names.
- 7.
- Categorical Filtering: Columns identified as categorical —either through object type or low numeric cardinality— are removed, preserving only continuous numeric measures.
- 8.
- Finalization: The resulting DataFrame is reordered to place temporal columns first and stored as a preprocessed CSV file for reuse within the session.
K-Nearest Neighbors Imputation
Categorical Detection via Uniqueness Ratio
2.2.3. LLM-Driven KPI Generation
Prompt Construction
Code Validation
Sandboxed Execution
2.2.4. Interactive Dashboard Generation
Chart Generation
Responsive Layout
2.2.5. Training and Evaluation Implementation
Question Generation
Automated Scoring
2.2.6. Implementation Considerations
2.2.7. Error Handling
2.3. Validation Methodology
2.3.1. Test Environment Configuration
- Compute: AWS Elastic Container Service (ECS) using Fargate tasks (0.25 vCPU, 0.5 GB RAM)
- LLM Service: Gemini 2.0 Flash and Gemini 2.5 Flash through Google Gemini API under standard rate limits
- Storage: Local and temporary file storage for datasets and generated outputs
- Monitoring: Execution logs and manual inspection of outputs
2.3.2. Dataset Preparation
- Multiple delimiter types (comma, semicolon, tab)
- Diverse date formats (ISO 8601, MM/DD/YYYY, DD-MM-YYYY)
- Missing values at varying rates, including datasets with no missing values and others with sparse missing entries
- Numeric columns with mixed precision
- Categorical columns with inconsistent capitalization
- Duplicate rows at varying frequencies
2.3.3. Test Case Design
- 1.
- CSV Preprocessing (TC-P): Evaluation of format detection, schema inference, temporal normalization, and missing value handling
- 2.
- KPI Suggestion (TC-K): Assessment of relevance, structural correctness, and output formatting
- 3.
- KPI Calculation (TC-C): Validation of code generation, security checks, and execution robustness
- 4.
- Dashboard Generation (TC-D): Verification of visualization correctness, layout integrity, and interactivity
- 5.
- Training Delivery (TC-T): Evaluation of documentation retrieval and explanatory adequacy
- 6.
- Evaluation Assessment (TC-E): Validation of question generation, scoring logic, and feedback delivery
3. Results
3.1. Functional Validation Results
3.1.1. CSV Preprocessing Performance
3.1.2. KPI Generation and Calculation Results
3.1.3. Dashboard Generation Quality
3.1.4. Training and Evaluation Results
3.2. Performance Benchmarking
3.2.1. Response Time Analysis
3.2.2. Throughput and Resource Utilization
3.3. Error Analysis and Failure Modes
3.4. Summary of Validation Results
4. Discussion
4.1. Interpretation of Results
4.1.1. Strengths and Capabilities
4.1.2. Challenges and Failure Modes
4.2. Limitations and Threats to Validity
4.3. Practical Implications
4.4. Lessons Learned
4.5. Comparison with Alternative Approaches
4.6. Limitations
- Single-Vendor LLM Dependency: Although two Gemini models are employed, reliance on a single LLM provider introduces vendor-specific dependencies. Supporting multiple providers would improve system robustness and deployment flexibility.
- Laboratory-Only Validation: Experimental evaluation was conducted under controlled conditions with simulated interactions and synthetic datasets. Real-world deployment may surface additional technical, organizational, and usability challenges.
- Functional Evaluation Focus: Validation emphasized functional correctness rather than user satisfaction, workflow efficiency, or business impact. These dimensions require dedicated user-centered studies.
- Domain Specificity: The system is tailored to hospitality management. Generalization to other application domains will require further investigation and adaptation.
4.7. Future Work
4.7.1. Near-Term: TRL 5 Advancement
4.7.2. Medium-Term Research
4.7.3. Long-Term Vision
5. Conclusion
5.1. Summary of Contributions
5.2. Key Findings
5.3. Closing Remarks
References
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention Is All You Need. In Advances in Neural Information Processing Systems 30 (NIPS 2017); 2017; pp. 5998–6008.
- Brown, T.B.; Mann, B.; Ryder, N.; Subbiah, M.; Kaplan, J.; Dhariwal, P.; Neelakantan, A.; Shyam, P.; Sastry, G.; Askell, A.; et al. Language Models Are Few-Shot Learners. In Advances in Neural Information Processing Systems 33 (NeurIPS 2020); 2020; pp. 1877–1901.
- McKinney, W. Data Structures for Statistical Computing in Python. In Proceedings of the 9th Python in Science Conference; 2010; pp. 56–61.
- Harris, C.R.; Millman, K.J.; van der Walt, S.J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N.J.; et al. Array Programming with NumPy. Nature 2020, 585, 357–362.
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research 2011, 12, 2825–2830.
- Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL-HLT 2019); 2019; pp. 4171–4186.
- Ouyang, L.; Wu, J.; Jiang, X.; Almeida, D.; Wainwright, C.L.; Mishkin, P.; Zhang, C.; Agarwal, S.; Slama, K.; Ray, A.; et al. Training Language Models to Follow Instructions with Human Feedback. In Advances in Neural Information Processing Systems 35 (NeurIPS 2022); 2022; pp. 27730–27744.
- Achiam, J.; Adler, S.; Agarwal, S.; Ahmad, L.; Akkaya, I.; Aleman, F.L.; Almeida, D.; Altenschmidt, J.; Altman, S.; Anadkat, S.; et al. GPT-4 Technical Report. arXiv 2023, arXiv:2303.08774.
- Gemini Team; Anil, R.; Borgeaud, S.; Wu, Y.; Alayrac, J.-B.; Yu, J.; Soricut, R.; Schalkwyk, J.; Dai, A.M.; Hauth, A.; et al. Gemini: A Family of Highly Capable Multimodal Models. arXiv 2023, arXiv:2312.11805.
- Wei, J.; Wang, X.; Schuurmans, D.; Bosma, M.; Ichter, B.; Xia, F.; Chi, E.; Le, Q.; Zhou, D. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. In Advances in Neural Information Processing Systems 35 (NeurIPS 2022); 2022; pp. 24824–24837.
- Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Küttler, H.; Lewis, M.; Yih, W.-t.; Rocktäschel, T.; et al. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. In Advances in Neural Information Processing Systems 33 (NeurIPS 2020); 2020; pp. 9459–9474.
- Bommasani, R.; Hudson, D.A.; Adeli, E.; Altman, R.; Arora, S.; von Arx, S.; Bernstein, M.S.; Bohg, J.; Bosselut, A.; Brunskill, E.; et al. On the Opportunities and Risks of Foundation Models. arXiv 2021, arXiv:2108.07258.
- Liu, P.; Yuan, W.; Fu, J.; Jiang, Z.; Hayashi, H.; Neubig, G. Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing. ACM Computing Surveys 2023, 55, 1–35.
- Chen, M.; Tworek, J.; Jun, H.; Yuan, Q.; Pinto, H.P.d.O.; Kaplan, J.; Edwards, H.; Burda, Y.; Joseph, N.; Brockman, G.; et al. Evaluating Large Language Models Trained on Code. arXiv 2021, arXiv:2107.03374.
- Bostock, M.; Ogievetsky, V.; Heer, J. D³: Data-Driven Documents. IEEE Transactions on Visualization and Computer Graphics 2011, 17, 2301–2309.
- Satyanarayan, A.; Moritz, D.; Wongsuphasawat, K.; Heer, J. Vega-Lite: A Grammar of Interactive Graphics. IEEE Transactions on Visualization and Computer Graphics 2017, 23, 341–350.
- VanLehn, K. The Relative Effectiveness of Human Tutoring, Intelligent Tutoring Systems, and Other Tutoring Systems. Educational Psychologist 2011, 46, 197–221.
- FastAPI. FastAPI Framework Documentation. 2023. Available online: https://fastapi.tiangolo.com (accessed on 11 December 2024).
- ISO 8601-1:2019. Date and Time—Representations for Information Interchange—Part 1: Basic Rules; International Organization for Standardization: Geneva, Switzerland, 2019.
- Python Software Foundation. ast—Abstract Syntax Trees. Python 3.11 Documentation. 2023. Available online: https://docs.python.org/3/library/ast.html (accessed on 11 December 2024).
- Python Software Foundation. subprocess—Subprocess Management. Python 3.11 Documentation. 2023. Available online: https://docs.python.org/3/library/subprocess.html (accessed on 11 December 2024).
- Python Software Foundation. tempfile—Generate Temporary Files and Directories. Python 3.11 Documentation. 2023. Available online: https://docs.python.org/3/library/tempfile.html (accessed on 11 December 2024).
- Python Software Foundation. Python 3.11 Documentation. 2023. Available online: https://docs.python.org/3.11 (accessed on 11 December 2024).
- Mankins, J.C. Technology Readiness Assessments: A Retrospective. Acta Astronautica 2009, 65, 1216–1223.

| Component | Technology | Version |
|---|---|---|
| Programming Language | Python | 3.11 |
| ASGI Hosting | FastAPI | 0.128.0 |
| Conversational Interface | Chainlit | 2.9.4 |
| LLM Integration | Google Gemini API | 2.0 / 2.5 Flash |
| Data Processing | Pandas | 2.3.0 |
| Numerical Computing | NumPy | 2.3.1 |
| Machine Learning Utilities | scikit-learn | 1.6.0 |
| Visualization | Plotly | 5.22.0 |
| Category | Total | Passed | Failed | Success Rate |
|---|---|---|---|---|
| CSV Preprocessing | 43 | 43 | 0 | 100.0% |
| KPI Suggestion | 43 | 40 | 3 | 93.0% |
| KPI Calculation | 40 | 40 | 0 | 100.0% |
| Dashboard Generation | 40 | 40 | 0 | 100.0% |
| Training Delivery | 20 | 20 | 0 | 100.0% |
| Evaluation Assessment | 20 | 20 | 0 | 100.0% |
| Overall | 206 | 203 | 3 | 98.5% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).