Vakil — A Virtual Assistant for Knowledge in Indian Law
Manjunath S¹, Marilingappa², Likith Reddy N³, J. Soundar Balaji⁴, and Shivaranjini C⁵
¹²³⁴ Department of CSE, Sir M. Visvesvaraya Institute of Technology, VTU, Bengaluru, India
⁵Assistant Professor, Department of CSE, Sir M. Visvesvaraya Institute of Technology,
VTU, Bengaluru, India
Abstract — We present VAKIL, a domain-focused virtual assistant for Indian law created by fine-tuning Microsoft’s Phi-3 Mini (4K Instruct) model with Low-Rank Adaptation (LoRA). The training corpus comprised curated Supreme Court judgments, constitutional provisions, statutory legislation, and other authoritative legal texts. Fine-tuning was performed on a RunPod RTX A6000 instance for 18 hours across two epochs, yielding a marked decrease in training loss and improved domain alignment.
To ensure responses are factually grounded, VAKIL integrates a Retrieval-Augmented Generation (RAG) pipeline: documents are chunked, tokenized, embedded, and indexed using a FAISS semantic vector store to enable high-precision retrieval. For relational and precedent-style reasoning, we construct a Neo4j AuraDB knowledge graph representing cases, statutes, and legal doctrines, and we apply a Graph Neural Network (GNN) over this graph to capture cross-document relationships and citation structure.
We evaluate VAKIL through intrinsic measures (loss curves, perplexity, and reductions in hallucination) and extrinsic tasks (legal question answering, statutory interpretation, and judgment summarization). Compared to the unadapted Phi-3 base, our fine-tuned model shows improved accuracy, stronger domain specificity, and greater interpretability. The final model is released on the Hugging Face Hub and served via a serverless vLLM runtime on RunPod to support low-latency API access. A chat-based interface was implemented to support learners, researchers, and legal practitioners.
VAKIL offers a reproducible workflow for building regionally focused legal assistants that balance retrieval, graph-based reasoning, and model fine-tuning. It is designed as an educational and research aid—not as a substitute for professional legal advice—and provides a transparent foundation for future enhancements.
Key Words: Legal AI, RAG, LoRa, Phi-3, Knowledge Graph, GNN, Indian Law, FAISS, Legal QA, Judgment Summarization.