AI Legal Assistant Using RAG and LLMs

Authors

  • Mrs T. Aruna Jyothi Author
  • Mahesh Karva Author
  • K. Madhumitha Author

DOI:

https://doi.org/10.62643/ijerst.2026.v22.n2(2).3021

Keywords:

Artificial Intelligence, Large Language Models, Retrieval-Augmented Generation, Legal Document Analysis, Conversational AI, Natural Language Processing, LangChain, ChromaDB, Con-tract Drafting, Legal Chatbot

Abstract

Access to legal assistance remains a significant challenge for individuals who cannot afford pro - fessional lawyers or navigate the complexity of legal documentation independently. This paper presents an AI-powered legal assistant designed to help users draft, understand, and retrieve information from legal documents through a conversational interface. The system is developed as a full-stack web application built with Flask for the backend, LangChain for orchestration, ChromaDB as a vector database, and the Ollama large language model for inference. The platform enables users to upload legal documents in PDF or DOCX format, after which the system processes and indexes their contents using a Retrieval-Augmented Generation pipeline. Document chunks are embedded and stored in ChromaDB, allowing the system to retrieve contextually relevant passages in response to natural language queries. The large language model then uses these retrieved passages as context to generate precise, grounded answers rather than relying on parametric knowledge alone. Beyond question answering, the system provides several intelligent features including clause extraction, AI-driven contract and agreement drafting, advocate search by location and specialty, automated formal letter generation, and downloadable PDF document output. The platform also includes user authentication, a personal dashboard, and an admin management interface for retraining and dataset management. By integrating large language model capabilities with a retrieval-augmented architecture and an interactive web interface, the system assists users in understanding legal documents, reducing dependence on costly legal consultations, and accessing accurate legal information in real time. The proposed platform aims to democratize legal assistance by making intelligent, documentgrounded legal support accessible to a broad audience.

Downloads

Published

04-05-2026

How to Cite

AI Legal Assistant Using RAG and LLMs. (2026). International Journal of Engineering Research and Science & Technology, 22(2(2), 221-230. https://doi.org/10.62643/ijerst.2026.v22.n2(2).3021