Secure Document Chat Rag Application

Read full text
Authors: Abhijit Borade
Cited by: 0
References: 4

Abstract

The exponential growth of digital documents in enterprise and academic environments has created an urgent need for intelligent, context-aware document retrieval and question-answering systems. This paper presents the design, development, and evaluation of RAG-GPT, a secure, full-stack document chat application built on the Retrieval-Augmented Generation (RAG) paradigm. The system enables users to upload PDF documents and interact with their content through a natural language conversational interface, powered by Google's Gemini 2.5 Flash large language model and the Qdrant vector database. The document ingestion and retrieval pipeline is constructed using the LangChain framework, which provides modular abstractions for PDF loading (PyPDFLoader), recursive text splitting (RecursiveCharacterTextSplitter), Google Generative AI embeddings (GoogleGenerativeAIEmbeddings), and Qdrant vector store integration — enabling rapid, composable RAG pipeline construction. A key contribution of this work is the integration of a robust security layer comprising bcrypt-hashed passwords, JSON Web Token (JWT) based session management, role-based access control (RBAC), and isolated per-user chat history stored in SQLite. To further enhance response accuracy, the system incorporates a smart query-rewriting module that reformulates ambiguous follow-up queries into precise, standalone search vectors using conversational context. Experimental evaluations demonstrate that the RAG pipeline significantly reduces hallucinations compared to standalone LLM inference, delivers semantically relevant answers from domain-specific documents, and maintains sub-second retrieval latency for typical document corpora. The proposed system operates entirely on a zero-cost API tier, making it accessible for researchers, students, and small enterprises. Results confirm that combining LangChain's composable tooling with dense vector retrieval and a state-of-the-art generative model yields a reliable, production-ready document intelligence platform.

Fields of Study & Subjects

Topic Modeling Information Retrieval and Search Behavior Natural Language Processing Techniques

Publication details

Journal / source
International Journal for Research in Applied Science and Engineering Technology
Volume
14
Issue
2
Pages
1216–1223
Publication date
24 February 2026
Language
EN