Trusted Publishing Platform
Serving Researchers Since 2012

Agentic AI For Legal Assistance

DOI : 10.17577/IJERTCONV14IS060084
Download Full-Text PDF Cite this Publication

Text Only Version

Agentic AI For Legal Assistance

Dev Shah, L Adithi, Prathik S

Department of Computer Science and Engineering (Emerging Technologies)

SRM Institute of Science and Technology Chennai, India

devns1904@gmail.com, ladithi08@gmail.com, prathiks783@gmail.com

Sowmiya V

Department of Computer Science and Engineering (Emerging Technologies)

SRM Institute of Science and Technology Chennai, India sowmiyav3@srmist.edu.in

AbstractAccess to justice is still a major challenge worldwide due to complicated processes, high legal fees, and low public awareness of available resources. Most current legal aid systems and chatbots are scattered, providing limited contextual understanding and minimal personalization. This paper presents Agentic AI for Legal Assistance, a framework aimed at simplifying legal processes using Artificial Intelligence (AI). The system automates key tasks including legal triage, outcome prediction, and document creation. By leveraging Natural Language Processing (NLP) and Machine Learning (ML), it analyzes and interprets legal narratives provided by users with high accuracy. Text undergoes linguistic preprocessingincluding tokenization, lemmatization, and stop-word removalto ensure clarity and consistency. A transformer-based sentiment analysis model then detects emotional and contextual details in the input. The refined narrative is converted into sentence embeddings and assessed using a multinomial logistic regression model, which predicts the likely outcome of the case, its chances of success, and its overall complexity. A Recommendation Engine improves user experience by suggesting relevant pro bono or legal aid providers, while a Document Generator creates personalized legal documents such as affidavits through automated templates. A Security Layer guarantees that all user data and generated documents are encrypted end-to-end. This structure demonstrates how agentic intelligence can independently interpret, predict, and act in the legal field, providing intelligent, privacy-focused, and accessible legal support.

KeywordsArtificial Intelligence (AI), LegalTech, Natural Language Processing (NLP), Machine Learning (ML), Legal Triage, Case Outcome Prediction, Document Automation, Sentiment Analysis, Encryption, Pro Bono Recommendation, Agentic AI, Legal Assistance.

  1. INTRODUCTION

    The growing complexity of modern legal systems, combined with a lack of affordable professional help, has created a significant gap in access to justice. People with limited legal knowledge often find it hard to understand their rights, navigate court processes, or find useful resources. Existing digital platforms, while numerous, typically offer only basic information or simple question-and-answer setups lacking contextual understanding and proactive reasoning.

    Agentic AI for Legal Assistance addresses these problems by combining several AI-driven features into a unified, self-sufficient framework. The systems NLP Processor interprets and refines user narratives, extracting important linguistic and emotional cues. The Triage Module uses predictive modeling techniquesincluding logistic regression and sentence embeddingsto determine likely outcomes and evaluate case complexity. A Recommendation Engine identifies appropriate legal aid or pro bono service providers based on case type and location. A Document Generator automates the creation of standardized legal forms, reducing manual labor and minimizing human error. The Security Layer uses encryption to secure sensitive information throughout the process.

    By merging contextual language understanding, predictive analytics, and independent task management, this agentic AI framework transforms the traditional legal aid process into an intelligent, interactive, and privacy-focused system. The result is a scalable solution that empowers individuals to make informed legal decisions while substantially lowering the time and cost barriers linked to traditional legal processes.

  2. LITERATURE REVIEW

    The current literature shows the transformative potential of AI, ML, and intelligent chatbots in improving efficiency in the legal sector and making justice more accessible. Research examines practical uses such as legal summarization and information retrieval through conversational AI [1]. This builds on earlier work on creating improved self-help systems to enhance public access to legal services [2]. Recent studies have introduced functional real-world tools, including the Bettercall AI-based legal assistant [4] and an Assistance System for Online Dispute Resolution (ODR) [5]. Wyawahare et al. [3] provide important insights by comparing Generative and Intent-based Chatbots for judicial advice. K.R A et al.

    [7] detail the creation of ML-powered chatbots for structured legal solutions.

    A strong focus exists on using AI to improve access to justice and legal literacy for the public. Works such as the AI Legal Companion [6, 10] highlight how technology can simplify complex legal information. However, this rapid advancement requires close examination of its social impact. K.R et al. [8] discuss ethical and legal issues surrounding AI chatbots, emphasizing the need for strong frameworks on data privacy, professional responsibility, and algorithmic bias. Rana et al. [9] focus on AI applications in the Indian judicial system, illustrating the unique opportunities and obstacles different national judicial systems face when adopting these technologies.

  3. METHODOLOGY

    The proposed Agentic AI for Legal Assistance framework has a modular, agent-driven setup that combines Natural Language Processing (NLP), Machine Learning (ML), Explainable AI (XAI), intelligent recommendation systems, document

    automation, and cryptographic security to provide clear, adaptable, and privacy-focused legal support. The system uses a multi-stage process where autonomous agents work together to transform unstructured legal narratives into understandable predictions, actionable recommendations, and organized legal documents.

    1. Data Acquisition

      This study uses over one hundred separate datasets of written cases across many domains. The datasets include privately written legal case narrative text in the areas of employment, family law, contract, and tort. Each dataset contains three separate data fields: case_text (user-provided legal narrative), outcome_label (outcome categories: Won, Settled, Dismissed, or Needs More Evidence), and complexity (difficulty levels: Low, Medium, or High) determined by narrative characteristics.

      The dataset is structured to support an agentic framework with specialized AI agents: a Triage Agent, Complexity Analysis Agent, and Explainability Agent. It contains an approximately equal number of cases by complexity level (18 Low, 20 Medium, and 12 High) to ensure robustness and generalizability across legal environments. Text preparation includes normalizing and enriching data through tokenization, lemmatization, stop-word removal, sentiment labeling, and dense vector representations via a SentenceTransformer model.

    2. Data Preprocessing

      The NLP Agent manages preprocessing to convert raw legal narratives into structured, meaningful representations. All text is first converted to lowercase to eliminate case discrepancies. The text then undergoes tokenization to identify individual words, stop-word removal to eliminate non-informative content, and lemmatization to reduce words to their base form, ensuring consistent representatio.

      The NLP Agent additionally uses transformer semantic processing to improve text-based context understanding. The agent generates contextual word embeddings that reflect the specific context in which each word was used, and also performs sentiment analysis to establish the sentiment polarity (positive, negative, or neutral) associated with the case. This information is appended as a feature to provide a measure of emotional intensity and urgency, significantly improving the quality of input for all subsequent modules.

    3. Case Representation and Outcome Prediction

      Legal narratives in processed form are fed through a SentenceTransformer neural model (all-MiniLM-L6-v2) that outputs dense semantic vector representations. These embeddings provide semantic context, allowing the system to identify relationships between legal cases even when stated differently.

      The Triage Agent uses the embeddings to drive a multinomial classification modelsuch as logistic regression or a transformer-based classifierwhich predicts the most likely outcome from four possible classes: (1) Dismissed, (2) Settled, (3) Won, or (4)

      Needs More Evidence. The Complexity Analysis Agent classifies legal case complexity into (1) Low, (2) Medium, or (3) High using a combination of heuristic rules and learned linguistic patterns.

      To promote transparency, the Explainability Agent is embedded within the prediction pipeline with the following functions:

      • Highlighting key phrases in the input that significantly influence model predictions

      • Producing a confidence score for the predicted legal outcome

      • Providing feature-level explanations associated with the models predicted outcome

    4. Legal Resource Recommendation and Document Automation

      Using a hybrid recommendation model, the Recommendation Agent connects users to applicable legal service providers through a structured dataset of legal aid providers. It employs:

      • Rule-based filtering (e.g., by case type and location)

      • Similarity-based ranking (embedding similarity and context relevance)

      • Priority weighting (such as urgency and complexity level)

        The Document Automation Agent streamlines production of legal documents such as affidavits, petitions, and applications using a JSON template system with dynamic placeholders filled based on user input and modeling. Documents are generated contextually with proper structure and case-specific alignment, reducing manual labor and minimizing errors.

    5. Encryption Mechanism and System Architecture

    The system provides complete data confidentiality and integrity through Fernet symmetric encryption to protect user narratives, predictions, and generated documents. All sensitive data is encrypted before being stored or transmitted, and only authorized agents can decrypt and process the data.

    The system architecture is modular with separated agent responsibilities for flexibility, scalability, and maintainability. It comprises four layers:

    1. Frontend Layer User Interaction: A web interface and chatbot through which users submit legal narratives and receive predictions, explanations, recommendations, and downloadable documents in real time.

    2. Agentic Processing Layer AI Agents: Specialized agents including the NLP Agent (Text Preprocessing and Embedding), Triage Agent (Outcome Prediction), Complexity Agent (Case Difficulty Determination), and XAI Agent (Interpretations and Explanations).

    3. Recommendations and Automation Layer Legal Agent: The Recommendation Agent (Matching Legal Services to Users) and Document Automation Agent (Creating Legal Drafts).

    4. Security Layer Privacy Protection: The Security Agent encrypts all sensitive data and ensures secure data transfer between components, providing compliance with applicable data protection regulations.

    Fig. 1. Architecture Diagram

  4. EXPERIMENTAL RESULTS

    1. Model Comparis

      Figure 2 illustrates the confusion matrix of the Legal Triage Model, showcasing how accurately the system classifies various legal case outcomes. The matrix compares true labels (actual case outcomes) with predicted labels generated by the machine learning classifier. The diagonal cells represent correct predictions, while off-diagonal entries indicate misclassifications. The model demonstrates particularly strong performance in identifying Settled cases (12 correct predictions), followed by Dismissed cases (11 correct predictions). A few misclassifications occur between Won and Needs More Evidence categories, indicating some overlap in linguistic or contextual patterns between those case types.

      Fig. 2. Correlation Heatmap

      Figure 3 illustrates the predicted probability distribution across four possible legal outcomesDismissed, Settled, Won, and Needs More Evidencefor a given user case. The bar chart shows that the system assigns the highest probability to Needs More Evidence (~0.39), followed by Settled (~0.28), Won (~0.21), and Dismissed (~0.13). This probabilistic approach ensures transparency and interpretability in automated decision-making.

      Fig. 3. Outcome Prediction Probability

    2. Interactive Legal Assistance and Docume Automation

      Figure 4 showcases the web-based AI Legal Aid demo interface, where users input their legal issues in natural language. The system analyzes the narrative using NLP and ML modules, predicting case outcome, complexity level, and suggesting an appropriate pro bono legal service provider. For example, for the input I am forcefully being evicted by my landlord, despite him making me pay extra for no reason, the model predicted the outcome as Settled (34% chance) with low complexity, and recommended Legal Aid Society as a suitable organization.

      Fig.4. User Interaction and Case Analysis Interface

      Figure 5 illustrates the Explainable AI (XAI) component, which enhances transparency by providing interpretable insights into model predictions. The interface presents the predicted case outcome with a confidence score, followed by a detailed probability distribution across all possible outcome classes. By combining probabilistic outputs with human-readable explanations, the XAI layer improves user trust and supports informed decision-making.

      Fig. 5. XAI Feature

      Figure 6 illustrates the document automation capability. Based on the analyzed case, the platform generates a legally formatted affidavit containing the users details and case description. The affidavit draft is created dynamically using a JSON-based template system and can be downloaded as a text file for legal use. This automation reduces manual drafting time, minimizes human error, and ensures professional, consistent document formatting.

      Fig. 6. Automated Legal Document Generation

    3. Inference

    The findings signify that the proposed Agentic AI for Legal Assistance approach accurately understands legal narratives submitted by usersincluding predicted outcome probabilitiesand generates results in real time in a structured format. The classification accuracy and probabilistic chart validation confirm the models trustworthiness across distinct classification systems. The demo interface and completed affidavit generation demonstrate strong real-world aplicability. Overall, Agentic AI for Legal Assistance provides a scalable, secure, and reliable means of democratizing access to legal aid through intelligent technology.

  5. FUTURE WORK

    Future improvements should enhance the current systems capability and usability. The next phase will include support for multiple languages and dialects to make the system more inclusive. Connecting to live court and legal databases would provide immediate access to cases and statutes, improving the quality of legal decisions. Integrating Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) will enable better contextual understanding of legal documents with accurate and factual responses. On the security side, encrypted cloud infrastructure and blockchain-based verification will provide improved data protection and document integrity.

  6. CONCLUSION

The Agentic AI for Legal Assistance framework is an innovative approach to making justice accessible, equitable, and data-driven. This framework creates a connection between everyday citizens and legal services by using advanced natural language processing, predictive modeling, and automated documentation. Through research and experimental tests, the framework has proven highly reliable at predicting case outcomes, estimating case complexity, and generating essential legal documents through automation. With this intelligent privacy-protecting technology, complex legal workflows are streamlined while allowing individuals to seek timely and informed legal assistance, thereby creating a more inclusive and efficient justice system.

ACKNOWLEDGMENT

The authors would like to thank the Department of Computer Science and Engineering (Emerging Technologies) at SRM Institute of Science and Technology, Chennai, India, for their support and guidance in conducting this research.

REFERENCES

[1]J. S. Garlyal, B. Hariharan and A. K. Singh, An Analysis on Integrating Advanced Conversational AI in Legal Summarization and Information Retrieval, 2024 Second International Conference on Inventive Computing and Informatics (ICICI), Bangalore, India, 2024, pp. 4346, doi: 10.1109/ICICI62254.2024.00016.

[2]G. L. Mastarone and S. Feinberg, Access to Legal Services: Organizing Better Self-help Systems, 2007 IEEE International Professional Communication Conference, Seattle, WA, USA, 2007, pp. 15, doi: 10.1109/IPCC.2007.4464041.

[3]M. Wyawahare, S. Roy and S. Zanwar, Generative vs Intent-based Chatbot for Judicial Advice, 2024 IEEE International Conference on Interdisciplinary Approaches in Technology and Management for Social Innovation (IATMSI), Gwalior, India, 2024, pp. 16, doi: 10.1109/IATMSI60426.2024.10502550.

[4]M. Dhore, A. Vimal, A. Agrawal, R. Bajaj and R. Barde, Bettercall: AI based legal assistant, 2024 5th International Conference on Image Processing and Capsule Networks (ICIPCN), Dhulikhel, Nepal, 2024, pp. 248256, doi: 10.1109/ICIPCN63822.2024.00048.

[5]N. K. Sahu et al., Development of Assistance System for Online Dispute Resolution and Legal Advice Using AIML, 2025 ICCCIT, Indore, India, 2025, pp. 142146, doi: 10.1109/ICCCIT62592.2025.10927904.

[6]P. P. Patil et al., Ai-Driven Legal Assistant and Judicial Support System, 2025 IEEE ICACT, Tirupati, India, 2025, pp. 166171, doi: 10.1109/ICACT67549.2025.11351452.

[7]K. R A, K. S and R. R, Legal Solutions – Intelligent Chatbot using Machine Learning, 2023 ICCEBS, Chennai, India, 2023, pp. 16, doi: 10.1109/ICCEBS58601.2023.10448748.

[8]K. R et al., Ethical and Legal Implications Of AI Chatbots In Legal Sector, 2025 ICCRTEE, Virudhunagar, India, 2025, pp. 15, doi: 10.1109/ICCRTEE64519.2025.11053085.

[9]R. S. Rana et al., Unveiling the Future: Exploring AI Applications in the Indian Judicial System, 2023 11th ISED, Dehradun, India, 2023, pp. 15, doi: 10.1109/ISED59382.2023.10444600.

[10]D. Kurniawan and S. E. Hiererra, AI Legal Companion: Enhancing Access to Justice and Legal Literacy for the Public, 2024 ICISS, Bandung, Indonesia, 2024, pp. 16, doi: 10.1109/ICISS62896.2024.10751371.

[11]P. P. Patil et al., Ai-Driven Legal Assistant and Judicial Support System, 2025 IEEE ICACT,

Tirupati, India, 2025, pp. 166171, doi: 10.1109/ICACT67549.2025.11351452.

[12]A. A. Adain et al., Development of Multilingual AI Legal Assistants for Real-Time Legal Aid Delivery, 2025 ICCR, Dubai, UAE, 2025, pp. 17, doi: 10.1109/ICCR67387.2025.11292048.

[13]A. Garlapati, H. Koutharapu and N. Doddi, Enhancing Public Access to Legal Knowledge in India: A Legal Chatbot Using Legal BERT, GPT-2, and RAG, 2025 IEEE MPSec ICETA, Gwalior, India, 2025, pp. 16, doi: 10.1109/MPSecICETA64837.2025.11118538.

[14]M. V et al., LexBot: AI-Powered Legal Help, 2025 ICCAMS, Bangalore, India, 2025, pp. 14, doi: 10.1109/ICCAMS65118.2025.11234135.

[15]S. Jha et al., JusticeAI-Legal Chatbot: A Blockchain-secured Multilingual Legal Chatbot for Accessible Justice, 2026 ICNTE, Navi Mumbai, India, 2026, pp. 16, doi: 10.1109/ICNTE66387.2026.11437425.

[16]C. Christopher et al., AI-Based Legal Support System for Empowering Consumer Justice, 2026 IITCEE, Bangalore, India, 2026, pp. 15, doi: 10.1109/IITCEE67948.2026.11394311.

[17]K. Chikka et al., Legal Mitra: Simplified Legal Resources and Guidance Platform, 2025 INCET, BELGAUM, India, 2025, pp. 17, doi: 10.1109/INCET64471.2025.11140002.

[18]G. Prakash et al., Cytocol Online Law System, 2023 ICCPCT, Kollam, India, 2023, pp. 96100, doi:

10.1109/ICCPCT58313.2023.10244948.

[19]J. Hake et al., Personal Legal Counselor and Interpreter of the Law Using Generative AI, 2025 ICETCE, Jaipur, India, 2025, pp. 3237, doi: 10.1109/ICETCE66848.2025.11388872.