Abstract
The traditional approaches for managing leaves involve form-driven procedures and processes, resulting in high levels of admin workload, delays, and low levels of flexibility for users. In this paper, we introduce a novel Natural Language Driven Leave Management System where employees are able to ask their requests about leaves through natural language. The introduced framework uses the capabilities of LangChain agents, Gemini large language models, few-shot learning, and MongoDB to translate natural language into NoSQL operations. A mechanism of validation and fallback is used to guarantee schema, data consistency, and query reliability. The framework architecture includes four layers that enable to implement automation of leave processing and notification management. An experiment was performed for testing the framework by applying a number of representative queries in leave management. Configurations include Zero-Shot, Few-Shot, and Few-Shot with Validation cases. According to the results obtained, the developed framework achieved Intent Accuracy of 91%, Field Extraction Accuracy of 88%, NoSQL Query Accuracy of 87% and Fallback Success Rate of 93%.References
- J. Gajda, “Employee Absence Management in Modern Organization,” Journal of US-China Public Administration 2015, vol. 12, no. 7, 540-547.
- Crave InfoTech, “Case Study: Conversational AI for Leave Management – Helped Boost Efficiency,” 2022. https://www.craveinfotech.com/blogs/case-study-conversational-ai-for-leave-management-helped-boost-efficiency/
- M.Vikash, S.V.Pirathik, Mrs.M.Gayathri Devi. “AI Powered Institutional Management System For Leave Request Processing”. International Journal of Sciences and Innovation Engineering 2025, vol. 2, no. 5, 498-501.
- Aayush Bhaskarwar, Akshat Dhanuka, Ziyaad Parkar, S.P. Shintre, “Multitenant Leave System,” International Journal of Innovative Research in Technology (IJIRT) 2025, vol. 11, no. 12, 8663-8672.
- V. Shanker, M. A. Khan, I. Karovalia, H. A. Shaikh, and A. Jha, “Natural Language SQL Querying via LangChain and AI Agent,” International Journal of Creative Research Thoughts (IJCRT) 2025, vol. 13, no. 4, 723-731.
- Zhong, Victor, Caiming Xiong, and Richard Socher. "Seq2sql: Generating structured queries from natural language using reinforcement learning." arXiv preprint arXiv:1709.00103 (2017).
- Huang, Po-Sen, Chenglong Wang, Rishabh Singh, Wen-tau Yih, and Xiaodong He. "Natural language to structured query generation via meta-learning." Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies 2018, vol 2, 732-738.
- Lee, Dongjun, Jaesik Yoon, Jongyun Song, Sanggil Lee, and Sungroh Yoon. "One-shot learning for text-to-sql generation." arXiv preprint arXiv:1905.11499 (2019).
- Yin, Wenpeng. "Meta-learning for few-shot natural language processing: A survey." arXiv preprint arXiv:2007.09604 (2020).
- Katsogiannis-Meimarakis, George, and Georgia Koutrika. "A survey on deep learning approaches for text-to-SQL." The VLDB Journal 2023, vol. 32, no. 4, 905-936.
- Nan, Linyong, Yilun Zhao, Weijin Zou, Narutatsu Ri, Jaesung Tae, Ellen Zhang, Arman Cohan, and Dragomir Radev. "Enhancing few-shot textto-sql capabilities of large language models: A study on prompt design strategies." arXiv preprint arXiv:2305.12586 (2023).
- Sun, Ruoxi, Sercan O. Arik, Rajarishi Sinha, Hootan Nakhost, Hanjun Dai, Pengcheng Yin, and Tomas Pfister. "Sqlprompt: In-context text-to-sql with minimal labeled data." In Findings of the Association for Computational Linguistics: EMNLP 2023, 542-550.
- Jain, Divyansh, and Eric Yang. "Context-Aware SQL Error Correction Using Few-Shot Learning--A Novel Approach Based on NLQ, Error, and SQL Similarity." arXiv preprint arXiv:2410.09174 (2024).
- Liu, Fengchen, and Gary Jung. "Exploring Few-Shot Learning: Fine-Tuning vs. In-Context Learning and Parameter-Efficient Adaptations." In Practice and Experience in Advanced Research Computing: The Power of Collaboration 2025, 1-4.
- Pandya, Keivalya, and Mehfuza Holia. "Automating Customer Service using LangChain: Building custom open-source GPT Chatbot for organizations." arXiv preprint arXiv:2310.05421 (2023).

Journal of Artificial Intelligence and Capsule Networks