Retrieval-Augmented Large Language Model Using FAISS for Stock Recommendation on LQ45 Index Based on Technical and Fundamental Analysis
DOI:
https://doi.org/10.52436/1.jutif.2026.7.4.5610Keywords:
FAISS, Investment Recommendation, Large Language Model, LQ45 Stocks, Retrieval-Augmented Generation, Stock AnalysisAbstract
The analysis of Indonesian stock markets is inherently complex due to market volatility, heterogeneous financial indicators, and the need to integrate both technical and fundamental information. Traditional analytical approaches often struggle to provide transparent and consistent investment recommendations, while Large Language Models (LLMs) may suffer from hallucination when applied to structured financial prediction tasks. This study proposes a Retrieval-Augmented Generation (RAG) framework based on the LLaMA model and FAISS to enhance the reliability of stock investment recommendations for LQ45-listed companies. Historical OHLCV data and fundamental financial reports are collected from Yahoo Finance and preprocessed into a structured knowledge base using embedding representations. Relevant information is retrieved using a top-k similarity search mechanism and integrated into a structured prompt engineering scheme to generate BUY, HOLD, or SELL recommendations. Experimental results demonstrate that the proposed approach achieves an F1-score of 0.76 for classification performance, with regression-based error metrics of MAE 299.38 and MAPE 10.06%. In addition, text-based evaluation using ROUGE yields a high score of 0.9906, indicating strong alignment between generated explanations and reference analyses. The findings suggest that the RAG framework significantly reduces hallucination by grounding LLM outputs in retrieved financial data, thereby improving the interpretability and robustness of AI-driven stock analysis. This research contributes to the field of informatics by providing a practical and extensible RAG-based framework for structured financial prediction tasks.
Downloads
References
S. A. S. Purwandhani, A. A. N. Sajiatmoko, and C. S. K. Aditya, “Optimizing Indonesian Banking Stock Predictions with DBSCAN and LSTM,” J. Tek. Inform., vol. 6, no. 3, pp. 1173–1188, 2025, doi: 10.52436/1.jutif.2025.6.3.4439.
I. A. A. Saputra, M. R. Sidiq, S. S. Guritno, and H. D. Cahyono, “Stock Prediction Performance Optimization: Enhancing Covariance Matrix With Knn,” J. Tek. Inform., vol. 5, no. 6, pp. 1561–1567, 2024, doi: 10.52436/1.jutif.2024.5.6.2399.
Y. Li, S. Wang, H. Ding, and H. Chen, “Large Language Models in Finance: A Survey,” ICAIF 2023 - 4th ACM Int. Conf. AI Financ., pp. 374–382, 2023, doi: 10.1145/3604237.3626869.
J. Cornelissen, M. A. Höllerer, E. Boxenbaum, S. Faraj, and J. Gehman, “Large Language Models and the Future of Organization Theory,” Organ. Theory, vol. 5, no. 1, pp. 1–5, 2024, doi: 10.1177/26317877241239056.
G. Sperlì and M. A. Sichinolfi, “Empowered stock market forecasting using Large Language Model on social media content,” Eng. Appl. Artif. Intell., vol. 162, no. July, 2025, doi: 10.1016/j.engappai.2025.112727.
A. H. Nasution, A. Hanafiah, W. Monika, R. Sokkalingam, M. S. Mohamad, and A. Alamsyah, “Assessing Lag-Llama in Probabilistic Time Series Forecasting for the Indonesian Stock Market,” Adv. Artif. Intell. Mach. Learn., vol. 5, no. 2, pp. 3809–3833, 2025, doi: 10.54364/AAIML.2025.52216.
A. Naliath, “FinRAG : A Retrieval-Based Financial Analyst”.
A. Fernandez, “Artificial Intelligence in Financial Services,” SSRN Electron. J., no. January, 2019, doi: 10.2139/ssrn.3366846.
Q. Chen, “A Two-Stage Framework for Stock Price Prediction: LLM-Based Forecasting with Risk-Aware PPO Adjustment,” J. Comput. Commun., vol. 13, no. 04, pp. 120–139, 2025, doi: 10.4236/jcc.2025.134008.
B. G. Esma, B. Marie, I. Louis, G. C. Esma, C. A. Esma, and M. L. Esma, “LEVERAGING LARGE LANGUAGE MODELS IN FINANCE : AUTHORS :”.
S. Zhao, Z. Jin, S. Li, and J. Gao, “FinRAGBench-V: A Benchmark for Multimodal RAG with Visual Citation in the Financial Domain,” pp. 4215–4249, 2025, doi: 10.18653/v1/2025.emnlp-main.211.
Q. Chen, “Stock Price Prediction with LLM-Guided Market Movement Signals and Transformer Model,” FinTech Sustain. Innov., vol. 00, no. July, pp. 1–7, 2025, doi: 10.47852/bonviewfsi52025703.
J. Kunz, “Train More Parameters But Mind Their Placement: {Insights} into Language Adaptation with {PEFT},” Proc. Jt. 25th Nord. Conf. Comput. Linguist. 11th Balt. Conf. Hum. Lang. Technol. (NoDaLiDa/Baltic-HLT 2025), pp. 323–330, 2025, [Online]. Available: https://aclanthology.org/2025.nodalida-1.35/
Z. Han, C. Gao, J. Liu, J. Zhang, and S. Q. Zhang, “Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey,” Trans. Mach. Learn. Res., vol. 2024, pp. 1–25, 2024.
N. Malali, “The Role of Retrieval-Augmented Generation (RAG) in Financial Document Processing: Automating Compliance and Reporting,” Int. J. Manag. Technol., vol. 12, no. 3, pp. 26–46, 2025, doi: 10.37745/ijmt.2013/vol12n32646.
J. Cui et al., “An Automated Retrieval-Augmented Generation LLaMA-4 109B-based System for Evaluating Radiotherapy Treatment Plans,” pp. 1–16, 2025, [Online]. Available: http://arxiv.org/abs/2509.20707
J. Wang, W. Ding, and X. Zhu, “Financial Analysis: Intelligent Financial Data Analysis System Based on LLM-RAG,” Appl. Comput. Eng., vol. 145, no. 1, pp. 182–189, 2025, doi: 10.54254/2755-2721/2025.22221.
J. Wang and F. Ino, “A General-Purpose K-Nearest Neighbor Method with an Efficient Pruning Strategy for GPUs,” J. Parallel Distrib. Comput., vol. 207, no. November 2024, p. 105187, 2026, doi: 10.1016/j.jpdc.2025.105187.
Y. Kong et al., “Large Language Models for Financial and Investment Management: Applications and Benchmarks,” J. Portf. Manag., vol. 51, no. 2, pp. 162–210, 2024, doi: 10.3905/jpm.2024.1.645.
A. P. Gema, P. Minervini, L. Daines, T. Hope, and B. Alex, “Parameter-Efficient Fine-Tuning of LLaMA for the Clinical Domain,” Clin. 2024 - 6th Work. Clin. Nat. Lang. Process. Proc. Work., pp. 91–104, 2024, doi: 10.18653/v1/2024.clinicalnlp-1.9.
Y. Liang, Y. Liu, B. Zhang, C. D. Wang, and H. Yang, “FinGPT: Enhancing Sentiment-Based Stock Movement Prediction with Dissemination-Aware and Context-Enriched LLMs,” 2024, [Online]. Available: http://arxiv.org/abs/2412.10823
B. Bohnet et al., “A Comparative Analysis of LLM Adaptation: SFT, LoRA, and ICL in Data-Scarce Scenarios,” pp. 1–14, 2025, [Online]. Available: http://arxiv.org/abs/2511.00130
S. Lopez-Joya, J. A. Diaz-Garcia, M. D. Ruiz, and M. J. Martin-Bautista, “The blueprint of a new fact-checking system: A methodology to enrich RAG systems with new generated datasets,” Comput. Electr. Eng., vol. 128, no. PB, p. 110746, 2025, doi: 10.1016/j.compeleceng.2025.110746.
S. X. A. Yan and T. Zhu, “CreditLLM: Constructing Financial AI Assistant for Credit Products using Financial LLM and Few Data,” Proc. - Int. Conf. Comput. Linguist. COLING, pp. 141–152, 2025.
O. Lithgow-Serrano et al., “Assessing RAG System Capabilities on Financial Documents,” pp. 124–147, 2025, doi: 10.18653/v1/2025.finnlp-2.9.
Y. Xiao, E. Sun, D. Luo, and W. Wang, “TradingAgents: Multi-Agents LLM Financial Trading Framework,” pp. 1–38, 2025, [Online]. Available: http://arxiv.org/abs/2412.20138
G. Phillips-Wren and A. Håkansson, “Towards Using Prompt Engineering in Large Language Models to Assist Decision Making,” Procedia Comput. Sci., vol. 270, pp. 5225–5238, 2025, doi: 10.1016/j.procs.2025.09.650.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Murtiyoso, Imam Tahyudin, Berlilana

This work is licensed under a Creative Commons Attribution 4.0 International License.

</a



