Skip to main content

Agentic AI in the Legal Domain: Enhancing Ethical Decision-Making through Specialized AI Agent

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

Agentic AI in the Legal Domain: Enhancing Ethical Decision-Making through Specialized AI Agent

Dept. of Data Science UMIT, SNDT University Mumbai 400076, India

Abstract Artificial Intelligence (AI) is increasingly transforming the legal domain by enabling automated analysis, decision support, and intelligent assistance for complex legal workflows. Despite recent advancements in Large Language Models(LLMs),manyexistingAI-basedlegaltoolslackstructured validation mechanisms, explainability, and seamless integration within scalable web-based systems, limiting their practical adoption. This paper presents the design and implementation of RemoteCLO,an AI-powered legal advisory platform developed to deliver structured, context-aware, and accessible legal guidance through modular full-stackarchitecture. Thesystemintegrates a FastAPIbackendwithaNext.jsfrontendtofacilitateefficientuser interaction and reliable API communication. Legal queries are analyzed using Google Gemini LLM orchestrated via LangChain, enabling controlled reasoning and response generation. To enhance contextual relevance and ensure up-to-date information, Tavily Web Search is incorporated for real-time retrieval of legal references and supporting data. A Pydanticbased validation layer enforces structured input–output processing, improving reliability and consistency across system components. Experimental evaluation demonstrates stable systemperformance,coherentresponsegeneration,andeffective frontend–backend interoperability. The RemoteCLO framework highlights the potential of combining modern web technologies with AI reasoning models to develop scalable, explainable, and user-centric legal advisory systems suitable for real-world deployment.

Keywords Legal AI, AI Legal Advisory System, Large Language Models (LLMs), Legal Query Answering, WebBasedLegalAssistance.

I. INTRODUCTION

The rapid expansion of digital services and online platforms has significantly increased the demand for accessible legal information across individuals, startups, and small organizations. As regulatory environments evolve and legal frameworks become increasingly complex, users are required to interpret statutes, compliance requirements, contractual obligations,andjurisdiction-specificregulationswithout always having direct access to professional legal assistance.Despitetechnologicaladvancementsinother domains,accesstoreliablelegalguidanceremainscostly, time-consuming, and often inaccessible to non-expert

users[1],[14]

Traditional legal services are primarily designed for enterprises and established organizations, where professionalconsultation costs are sustainable within operational budgets.

For individuals and small-scale entities, however, obtaining timely legal clarification can be prohibitively expensive. Existing alternatives such as static legal information websites or template-based services provide limited contextual understanding and fail to adapt to user-specific scenarios. Meanwhile, generic AI chatbots powered by large language models frequently generate responses lacking structured validation, jurisdictional awareness, or explainable reasoning, raising concerns regarding reliability and ethical usage in legalcontexts[2].

Recent advances in Artificial Intelligence, particularly Large Language Models (LLMs), have demonstrated promising capabilities in legal reasoning, document understanding, and automated question answering. Research has explored specialized legal language models,intelligentconversationalagents,andAI-driven legalassistantsaimedatimprovingaccesstojusticeand enhancing legal research efficiency [13],[9],[3]. Additionally,emergingstudieshighlighttheimportance of modular architectures and collaborative AI frameworks to improve reasoning consistency and scalabilityinlegalapplications[5],[8].However,several challenges remain insufficiently addressed, including the integration of AI reasoning within full-stack web systems, structured validation of legal outputs, and the incorporationofreal-timelegalinformationretrievalto maintainresponserelevance.

To address these challenges, this paper introduces RemoteCLO, an AI-powered legal advisory platform designed to provide structured, context-aware legal assistancethrough amodularweb-basedarchitecture. RemoteCLOintegratesaNext.jsfrontendwithaFastAPI backend to enable seamless interaction between users

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

and AI-driven reasoning modules. Legal queries are processed using the Google Gemini Large Language Model orchestrated through LangChain, while Tavily WebSearchenablesreal-timeretrievalofrelevant legal information and supporting references to enhance contextual accuracy. A Pydantic-based validation layer ensures consistent data handling and reliable system behavioracrosscomponents.

The proposed system aims to bridge the gap between advancedAI reasoning capabilities and practical legal accessibility by delivering explainable, scalable, and user-friendly legal assistance through modern web technologies. By combining structured backend validation with real-time informationretrieval and interactive frontend design, RemoteCLO demonstrates a practical approach toward deploying AI- assisted legal advisory systems in real-world environments.Theremainderofthispaperisorganized asfollows.Section II presents a review of existing AIdriven legal systems that contextualize RemoteCLO within current research. Section III describes the system architecture and methodology.

Section IV details implementation and evaluation resultsobtainedduringthe developmentstage.Finally, SectionVconcludesthestudyandoutlinesdirectionsfor futurework.

II. LITERATURE REVIEW

The application of artificial intelligence to legal practice has a rich and rapidly evolving research history. The following review synthesises fifteen relevant research works, organised thematically, to establishtheintellectualcontext forRemoteCLO.

A. LLM Hallucination and Legal Knowledge Accuracy

A significant challenge in applying Large Language Models (LLMs) to legal applications is hallucination, wheremodels generate responses that appear legally valid butlackfactualaccuracyorverifiablegrounding. Because legal decision-making requires precision and accountability,suchinconsistenciesreducetrustinAIgeneratedlegalguidance andlimitreal-worldadoption [5],[13].

To improve reliability, researchers have explored structured methods that enhance legal knowledge grounding.Frameworks such as ChatLaw incorporate knowledge graphs and role- based collaborative reasoning to reduce incorrect outputs and improve response consistency [5]. Similarly, domain-adapted

models like Lawyer LLaMA demonstrate that training on specialized legal corpora improves contextual understandingandreducesfabricatedlegalreferences [9].

Another challenge involves processing lengthy legal documents that exceed the context limits of conventional language models. Architecture such as Lawformerenablesefficienthandlingoflonglegal texts,improvingcomprehensionofstatutesandcase materials [16]. While these approaches strengthen model capabilities, they largely focus on model improvements rather than deployable system integration,motivatingsolutionslikeRemoteCLOthat combine structured validation with real-time legal informationretrieval.

B. Real-Time Information Retrieval in Legal Question Answering

Reliablelegalquestionansweringrequiresaccesstoupto- date and verifiable information, as static model knowledgemaybecomeoutdatedorincompleteovertime. Traditional Large Language Models rely primarily on parametric knowledge learned during training, which limits their abilitytoreferencerecentlegaldevelopments orjurisdiction- specificupdates.Priorresearchhighlights theimportanceofintegratingexternalknowledgesources to improve factual grounding and reduce inaccuracies in AI-generatedlegalresponses[13],[4].

Several studies demonstrate that augmenting language models with retrieval mechanisms significantly improves response reliability. Research on AI legal assistants shows that providing models with relevant statutory contextor supporting documents enhances reasoning accuracyand reduces misleading outputs [13]. Similarly, hybrid legal information retrieval approaches combining semantic embeddings withtraditionalsearchtechniquesimproveprecisionin identifying relevant precedents and legal materials, emphasizingtheroleofdynamicinformation accessin legalAIsystems[4].

Inspired by these findings, the RemoteCLO system incorporates Tavily Web Search to enable real-time retrieval of relevant legal references and contextual information during query processing. Instead of relying solely on pre- trained model knowledge, the system supplementsuser querieswithcurrentweb-sourcedlegal data before response generation. This approach improves contextual relevance while maintaining lightweight and deployable architecture, demonstrating a practical

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

alternative to complex retrieval pipelines for real-world legaladvisoryapplications.

C. Multi-Agent Legal Reasoning

Recentresearchhasexploredmulti-agentarchitectureas a method for handling complex legal reasoning by distributing tasks across specialized AI components. Studies indicate that single-agent legal systems often struggle with transparency, reasoning consistency, and adaptability across diverse legal contexts. Yang et al. [8] argue that collaborative multi-agent frameworks improve explainabilityandtaskcoordinationbyenablingstructured interactionbetweenreasoningmodules,therebyenhancing trustworthinessinlegalAIapplications.

Further advancements highlight the role of human–AI collaboration within multi-agent legal workflows. Meng et al. [11] proposes a multilingual legal terminology mapping framework in which multiple AI agents perform repetitive reasoning tasks while human experts validate outputs for semantic accuracy. This hybrid approach addresses challenges associated with linguistic diversity and domain-specific terminology, demonstrating how coordinated agent systems can improve reliability in specializedlegalenvironments.

Complementary research by Gray et al. [7] introduces human-in-the-loop methodologies where AI systems assistinidentifyingandrefininglegalfactorsfromjudicial opinions. Their findings show that collaborative AI workflows can uncover patterns and insights beyond manually curated legal analyses. While such multi-agent approaches enhance reasoning depth and scalability, they often introduce architectural complexity. In contrast, RemoteCLO adopts a streamlined single-agent orchestration approach using LangChain, prioritizing deployability and real-time usability while remaining extensibleforfuturearchitecturalenhancements.

D. Access-to-Justice Chatbots and Low-Resource Legal AI

AgrowingareaoflegalAIresearchfocusesonimproving accesstolegalinformationforunderservedusersthrough conversational systems. Legal chatbots have been proposed as scalable tools for providing preliminary guidance while reducing reliance on expensive legal consultation. Pardhi et al, highlights the importance of continuous testing, regulatory compliance, and privacy safeguardstoensuretrustworthydeploymentandprevent misinformation.

Studies addressing low-resource environments demonstrate that effective legal assistance can be achievedevenwithlimiteddatasets.Queudotetal.[14] develop an access-to- justice chatbot using publicly available legal information, showing reliable performance despite sparse training data. Similarly, Mowbray et al. [12] propose sustainable rule-based legal decision-support systems integrated with live legal corpora to provide accessible legal assistance withoutheavyinfrastructurerequirements.

Amato et al. [3] further show that semantic-searchbased conversational agents can support legal dispute resolution, though dataset diversity remains a key challenge for reliability. Building on these insights, RemoteCLO adopts a web-based advisory approach combining LLM reasoning with real-time information retrievaltoprovideaccessibleandcontext-awarelegal assistance.

E. AI Governance, Bias, and Predictive Analytics in Law

Beyond technical performance, researchers have raised important governance concerns regarding the use of AI in legal decision-making. Jain et al. [2] highlightchallengesrelatedtoalgorithmicbias,lackof transparency, and data privacy risks, arguing that explainability and accountability must be embedded into system design rather than introduced after deployment.Theseconsiderationsinfluencetheethical designprinciplesadoptedinRemoteCLO.

Research on predictive legal analytics further reveals limitations associated with unstructured legal data and restrictedtrainingresources.Kumaretal.[1]demonstrate that litigation outcome prediction models often struggle with generalization due to inconsistent data representation,emphasizingtheneedforstructuredlegal datasetsandstandardizedevaluationpractices.

Complementary work by Gray et al. [7] proposes semiautomated methods for identifying legal factors from judicial texts, enabling more structured analysis for predictive modeling. Together, these studies underline the importance of transparency, structured data handling, and responsibleAIdeployment,whichmotivate thedevelopmentapproachfollowedinRemoteCLO.

F. Research Gaps Addressed by RemoteCLO

Synthesizing the research works reviewed in the previous section reveals several consolidated gaps in

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

currentAI-drivenlegalassistancesystemsthatmotivatethe developmentofRemoteCLO.

First, many existing legal AI systems rely primarily on pre-trained model knowledge or static datasets, limiting theirabilitytoprovideup-to-datelegalinformation.While retrieval-based approaches improve grounding and accuracy [13], most studies evaluate models using fixed legal corpora rather than dynamically incorporating currentlegalresources.Consequently,real-timeintegration of web-sourced legal information within deployable advisory platforms remains insufficiently explored. RemoteCLOaddressesthisgapbyincorporatingTavilyWeb Search to retrieve relevant legal references during query processing,improvingcontextualrelevance.

Second, existing legal AI solutions often focus either on model-level improvements or conversational interfaces without emphasizing full-stack system integration. Prior work has explored legal question-answering agents and conversational assistants independently [3], [14], yet seamless coordination between frontend interaction,backendvalidation,andAIreasoningpipelines is rarely demonstrated in practical implementations. RemoteCLO bridges this gap through a modular architecture integrating a Next.js frontend with aFastAPI backendandstructuredAPI-basedcommunication.

Third, many legal AI applications target either professional legal practitioners or public assistance scenarios, leavingbroaderaccessibility challenges insufficientlyaddressed [12]. Systems designed for expert environments may lack usability for non-specialist users, while lightweight public-facing tools often sacrifice reasoning transparency. RemoteCLO aims to balance accessibility and reliability by providing structured, explainable legal responses within anintuitiveweb-based interface.

Fourth, governance concerns such as explainability, bias mitigation,andaccountabilityremainunderrepresentedat the architectural level of legal AI systems. Research emphasizes the importance of embedding ethical safeguardsdirectlyintosystemdesignratherthantreating them as post-processing considerations [2]. RemoteCLO incorporates structured validation through Pydantic models and controlled reasoning orchestration via LangChaintopromoteconsistentandtransparentoutputs.

Collectively, these gaps highlight the need for scalable, explainable, and deployable AI-driven legal advisory systems. RemoteCLO is designed to address these

2026, IRJET | Impact Factor value: 8.315 |

challengesbycombiningreal-timeinformationretrieval, modularsystemarchitecture,andstructuredvalidation mechanismswithinapracticalweb-basedframework.

III. METHODOLOGY

A. Research Design

This research follows a design science methodology, in which the primary artefact the RemoteCLO AI Legal Advisory System is designed, implemented, and iteratively refined through practical development and evaluation. The methodology integrates system architecture design, backend–frontend implementation, and qualitative assessmentof system functionality. The study focuses on developing aworkingprototypethatdemonstrates how large language models can support ethical and explainable legal assistance through structured workflows and real-time information retrieval. As the project is currently at an advanced prototype stage, large-scale quantitative benchmarking is reserved forfuturework.Thepresentmethodologyemphasizes architecturaldecisions,implementationstrategies,and functional validation to establish a strong foundation for subsequent performance evaluation and system enhancement.

B. System Architecture Overview

The proposed RemoteCLO system follows a modular client–server architecture that integrates a web-based frontend with an AI-driven backend for legal query processing. The frontend, developed using Next.js and React, enables users to submit legal questions and view structuredresponsesthroughaninteractiveinterface.The backend, implemented using FastAPI, manages API routing, request handling, and communication with AI services. An AI integration layer orchestrated by LangChain coordinates interactions with the Google Gemini large language model[6] and Tavily Web Search[15] to obtain relevant and up-to-date legal information.Input and output data are validated using Pydantic models to ensure structured and reliable processing.Thislayeredarchitecturepromotesscalability, maintainability, and efficient communication between system components while supporting explainable legal responsegeneration.

C. Data Sources and Retrieval Strategy

RemoteCLO does not rely solely on the static knowledge embedded within pre-trained language models; instead, it enhances response generation

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

through real-time information retrieval. When a user submits a legal query, the system utilizes Tavily Web Searchtodynamicallyretrieverelevantinformationfrom reliableonlinelegalresources,publicregulatory portals, and verified legal information sources. The retrieved contextual data is incorporated into the reasoning workflow managed by LangChain[10], where it is combinedwiththeuserquerybeforebeingprocessedby theGoogleGeminilargelanguagemodel.Thisintegration enables the system to generate responses grounded in current and contextually relevant information rather than relying exclusively on previously learned model parameters. By incorporating real-time external knowledge during inference, RemoteCLO improves response accuracy, contextual relevance, and practical usability while maintaining a lightweight, scalable, and deployable architecture suitable for web-based legal advisoryapplications.

D.

LLM Backend

The system interfaces with the Google Gemini Large Lan- guage Model through an API to perform natural language understanding and legal response generation. User queries, together with contextual information retrieved via Tavily Web Search, are incorporated into a structured prompt managed by LangChain. The prompt defines the system role as a legal advisory assistant and guides the model to generate clear, context-aware responsestailoredtotheuser’slegalquery.

The prompting strategy encourages step-by-step reasoning and structured output generation to improve clarityandreliability.Byintegratingretrievedcontextual information with the user query, the system reduces dependence on static model knowl- edge and improves responserelevance.Themodelisfurtherguidedtoavoid unsupported claims and produce explanations aligned withtheprovidedcontext,helpingmitigatehallucina-tion risks commonly associated with general-purpose languagemodels[5],[9].

E. Prototype Evaluation Approach

The developed prototype was evaluated through structuredfunctionaltestingandqualitativewalkthrough sessionstoassesssystemperformanceandusability.Test users interacted with the RemoteCLO interface by submitting representative legal queriescovering general legal guidance, compliance- related questions, and regulatory information requests. The evaluation focused on response relevance, clarity of explanations, and the system’sabilitytoprovidestructuredandunderstandable legalinsightsthroughthewebinterface.

Systemperformancewasfurtherexaminedbyvalidating back- end API responses using FastAPI Swagger documentation and frontend interaction testing. Evaluation criteria included response consistency, contextualaccuracy,andoverallusercomprehensionof generated outputs. These qualitative obser- vations provide an initial assessment of system effectiveness, while comprehensive quantitative benchmarking is reserved for future work. Results and discussion are presentedinSectionVI.

F. Proposed Framework

The proposed AI Legal Advisory System follows a modular client–server architecture designed to enable

Fig.1. BackendInterface
Fig.2. DFDLevel0:AgenticAILegalSystem
Fig.3. DFDLevel1:AgenticAILegalSystem

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

efficient interaction between users, backend services, and AI reasoning components. The framework is organized into interconnected functional layers that collectivelyprocessuserqueriesandgeneratestructured legalguidance.

G. Retrieval and Reasoning Layer

The Retrieval and Reasoning Layer forms the core intelligence component of the proposed legal advisory system. When a user submits a legal query through the frontend interface, the request is transmitted to the FastAPIbackend,whereitundergoesstructuredvalidation using Pydantic models to ensure correctness and completeness of input data. The validated query is then forwarded to the AI orchestration pipeline managed by LangChain.

Instead of relying on static legal datasets, the system retrieves relevant and recent legal information using TavilyWebSearch.Tavily dynamicallygatherscontextual legal references, guidelines, and publicly available legal resources related to the user’s query. This retrieved information is combined with the original user input to provide contextual grounding before reasoning is performedbytheLargeLanguageModel.

Google Gemini LLM processes the enriched queryusing structured prompts designed to generate clear, stepby-step legal explanations. The model focuses on producing logically organized and understandable responses rather than deterministic legal judgments. The generated output is then formatted into structured JSON responses and returned to the frontend, ensuring transparency, readability, and consistency in legal guidancedelivery.

H. Query Processing and Legal Reasoning Layer

The core functionality of the proposed RemoteCLO system lies in its query processing and legal reasoning layer, which enables users to obtain structured legal guidancethroughanAI-assistedworkflow.Whenauser submits a legal query through the web interface, the input is transmitted to the FastAPI backend as a structured JSON request containing the legal question andoptionalcontextualparameters.

The backend first validates the request using Pydantic modelstoensuredataconsistencyandcorrectness.The

validated query is then forwarded to the AI orchestration pipeline managed through LangChain, which coordinates interaction with external services and the Large Language Model. To enhance contextual relevance, the system retrieves up-to-date legal information using Tavily Web Search, allowing the modeltoaccessrecentlegalreferences,guidelines,and publiclyavailablesources.

The enriched query is processed by Google Gemini LLM, which performs contextual understanding and generates a clear, step-by-step legal explanation. The responseisformattedintoastructuredJSONoutputand returned to the frontend, where it is displayed as readablelegalguidance. Thislayeredapproachensures reliable processing, improved response clarity, and transparent interaction between user input, external knowledgeretrieval,andAIreasoning.

I. User Interaction and Interface Layer (Frontend Layer)

The User Interaction Layer serves as the primary accesspointthroughwhichuserscommunicatewiththe AI Legal Advisory System. Unlike voice-based systems, the proposed platform operates through a web-based interface developed using Next.js and React, enabling userstosubmitlegal queriesandreceivestructuredAIgeneratedresponsesthroughabrowserenvironment. Users enter legal questions along with optional contextualparameterssuchasjurisdictionandresponse preferences. The frontend manages user input validation, interface rendering, and asynchronous communicationwithbackendAPIsusingHTTPrequests. Reactcomponentsandcustomhookshandleapplication state,ensuringsmoothinteractionanddynamicdisplay ofresultswithoutrequiringpagereloads.

Once a query is submitted, the interface presents AIgeneratedoutputsinastructuredandreadableformat, including step- by-step explanations and referenced information. The design focuses on usability, clarity, and accessibility, allowing users to easily understand legal guidance while maintaining transparency in system responses. This layer bridges backend intelligencewithintuitiveuserexperience,transforming complex AI processing into a practical legal advisory webapplication.

J. Orchestration and Safety Architecture (Rewritten for Your System)

The system employs a centralized orchestration workflow managed by the FastAPI backend, which

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

coordinates communication between the frontend interface, AI integration layer, and external services. When a user submits a legal query through the RemoteCLO web interface, the backend manages sessionhandling,validatesrequestparametersusing Pydantic models, and routes the query to the appropriate AI processing pipeline. This orchestration ensures structured data flow, reliable API communication, and consistent response generationacrosssystemcomponents.

To promote responsible AI usage, the system incorporatesbasicsafetyandvalidationmechanisms during processing. Input validation ensures that incomplete or malformed queries are filtered before reaching the AI model, while structured prompt formatting guides the Large Language Model to generateinformationalandcontext-awareresponses rather than definitive legal advice. Additionally, responses are formatted with explanatory context and supporting references retrieved through Tavily Web Search, improving transparency and reducing misleadingoutputs.Thesesafeguardssupportethical deployment principles highlighted in prior legal AIresearchconcerningexplainability,accountability, andresponsible use ofAIinlegalassistancesystems [4][10].

K. Framework Architecture Diagram

Figure 4 illustrates the high-level data flow of the proposed RemoteCLO framework. A user submits a legalquerythroughtheweb-basedfrontendinterface developedusingNext.js. The query is transmitted as a structured JSON request totheFastAPIbackend, whichactsasthecentralorchestrationcomponentof thesystem.

Uponreceivingtherequest,thebackendvalidatesthe inputusingPydanticmodelsandforwardsthe query totheAIprocessingpipelinemanagedbyLangChain. Thesystemretrievesrelevantcontextualinformation throughTavilyWebSearch,whichgathersup-to-date legal references and supporting in- formation from reliable online sources. The enriched query is then processed by the Google Gemini Large Language Modeltogenerateacontext-awarelegalresponse. The generated output is formatted into a structured response bythebackendandreturnedtothefrontend interface, where it is displayed to the user as clear andreadablelegalguidance.Thisarchitectureenables efficient interaction between user input, real-time information retrieval, AI reasoning, and response

presentation within a modular and scalable webbasedframework.

IV. RESULTS AND DISCUSSIONS

A. MVP Prototype Overview

TheRemoteCLOsystemiscurrentlyimplementedasa functional minimum viable product (MVP) focusing on AI- driven legal query processing and ethical response generation. The developed prototype integrates a FastAPI-based backend with Large Language Model reasoning powered byGoogle Geminiand orchestrated through LangChain. Real-time con- textual information retrievalissupportedusingTavilyWebSearch,enabling the system to generate context-aware legal responses groundedinup-to-dateinformationsources. The backend implementation has been successfully tested through API validation and structured query execution, demon- strating reliable processing of user inputs and consistent response generation. The frontend interface, developed using Next.js and React, is currently under active development to provide an intuitiveweb-basedinteractionlayer.

B. Query Answering Performance

During qualitative evaluation, users submitted legal queriesrelated to general legal guidance, compliance requirements,andregulatoryunderstanding.Thesystem generated structured and understandable responses

Fig.4. ArchitectureWorkflowDiagram

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

using Google Gemini LLM supported by contextual information retrieved through Tavily Web Search. In mostcases, responses were relevant, clearlyexplained, andaccessibletonon-expertusers.

Consistent withfindings in priorlegal AIstudies[13], response quality improved when relevant contextual information was successfully retrieved. For highly specific or ambigu- ous queries, the system provided generalizedinformationalguidanceandindicatedtheneed for professional consultation, supporting responsible AI usage practices . Some limitations were observed for queries involving unclear or mixed legal contexts, highlightingareasforfutureimprovementconsistentwith challengesidentifiedinlegalAIresearch[8].

C. Accuracy Evaluation of the System

To evaluate the effectiveness of the proposed RemoteCLO legal advisory system, a structured evaluation was conducted using a curated dataset of representative legal queries. The evaluation dataset

consisted of 30 legal questions covering multiple legal domains including corporate law, intellectual property law, contract law, compliance regulations, and general legalinformationrelevanttostartupsandindividuals. Each query was submitted through the RemoteCLO web interface, which processes user inputs through Next.js frontend and FastAPI backend and generates responses using the Google Gemini Large Language Model augmented with contextual information retrieved through Tavily Web Search.

TheTavilyintegrationallowsthesystemtoaccessrelevant and up-to-date legal information from trusted web sources, thereby improving the reliability of generated responses.

The generated outputs were manually evaluated by comparing them with reliable legal references such asgovernment portals, legal documentation, and verified legal information repositories. Each response was classifiedintothreecategories:

Correct – the response accurately explained the legal conceptandalignedwithauthoritativesources

Partially Correct – the response contained generally validinformationbutlackedcontextualcompleteness

Incorrect – the response contained misleading or irrelevantlegalinformation

Since large language model responses may contain partially correct explanations that still provide useful guidance, a weighted evaluation metric was used to measureoverallsystemperformance.Inthisevaluation approach, correct responses were assigned a score of 1.0, partially correct responses were assigned 0.5, and incorrectresponseswereassigned0.

Out of the 30 evaluated queries, 25 responses were categorized as correct, 4 responses were partially correct, and 1 response was incorrect. Using the weighted evaluation method, the RemoteCLO system achieved an overall accuracy of approximately 90 percentage.

The results demonstrate that integrating a large language model with real-time legal information retrieval significantly improves the reliability and contextualrelevanceofAI-generatedlegalexplanations. Thesystemperformsparticularly well for general legal information queries, while some limitations were observed for highly jurisdiction-specific questions or ambiguouslegalphrasing.

Fig.5. Frontend Interface
Fig.6. ChatBot Interface

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

TABLEIACCURACY EVALUATION OF THE REMOTECLOSYSTEM

Metric Value

TotalQueriesEvaluated 30

CorrectResponses 25

PartiallyCorrectResponses 4

IncorrectResponses 1

WeightedAccuracy 90%

The weighted accuracy was calculated using the followingformula:

Substitutingtheobservedevaluationvalues:

Fig.7. Distributionofcorrect,partiallycorrect,and incorrectresponses generatedbytheRemoteCLOsystem duringevaluation.

The distribution shown in the pie chart highlights that most responses generated by RemoteCLO were accurate and con- textually relevant. Only a small proportion of responses were partially correct or incorrect, indicating that the integration of large language models with realtimeinformationretrievalim-provesthe reliabilityof AIassistedlegalinformationsystems.

V. LIMITATIONS AND FUTURE WORK

Several limitations of the current MVP are acknowledged.First,systemevaluationhasprimarilybeen qualitative, and quantitative benchmarking using standardized legal QA datasets has not yet been conducted. Future work will involve constructing an annotated evaluation dataset to enable objective measurementofresponseaccuracyandreliability.Second, the system currently relies on real-time web retrieval through Tavily, which, while effective, does not yet incorporate advanced retrieval mechanisms such as Retrieval-AugmentedGeneration(RAG).Integrating RAGbased retrieval and vector indexing is planned to further improvecontextualgroundingandresponseconsistency. Additionally,thepresentimplementationfocusesontextbased interaction and legal query answering. Future development will extend the platform with document analysis and generation capabilities to assist users in reviewinglegalcontentanddraftingstandarddocuments. A multilingual voice interface is also envisioned to improve accessibilityanduserinteraction.Finally,largescale user feedback and real-world deployment will be essentialtoidentifyedge cases,enhancerobustness,and evolvethesystemintoafullyfunctionalAI-poweredlegal advisoryplatform.

VI. CONCLUSIONS

This paper presented RemoteCLO, an AI-powered legal advisory system designed to assist users in understanding legal information through contextawareandethicallyalignedresponses. The proposed platform integrates a Next.js-basedfrontendwitha FastAPI backend, combining Large Language Model reasoning through Google Gemini with LangChain orchestrationandreal-timecontextualretrievalusing Tavily Web Search. The system demonstrates how modernAItechnologiescansupportlegalinformation accessbygeneratingstructured,understandable,and explainable responses within a web-based environment.

Thedevelopedprototype,currentlyattheMVPstage, successfully implements the core workflow of legal query processing, contextual information retrieval, and AI-assisted reasoning. Qualitative evaluation indicates that the system provides relevant and accessible legal explanations while maintaining transparencyandresponsibleAIusagepractices.The modular architecture enables scalable deployment andsupportsseamlessinteractionbetweenfrontend interfacesandbackendintelligencecomponents.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072

Although promising, the current system has limitations,including the absence of quantitative benchmarkingand restricted feature coverage. Future work will focuson integrating RetrievalAugmented Generation (RAG) techniques for stronger contextual grounding, expandingcapabilities toward document analysis and generation, and introducing multilingual voice interaction to improve accessibility. These enhancements aim to evolve RemoteCLO into a fully functional AI-powered legal advisory platform. Overall, this work demonstrates the potential of responsibly designed AI systems to improve accessibility to legalinformation.Bycombining real-time knowledge retrieval with explainable AI reasoning, RemoteCLO contributes towardbridging the gap between complex legal knowledge and everyday users, supporting more informed decision-makinginan increasinglydigitallegalecosystem.

REFERENCES

[1]Benjamin Alarie, Anthony Niblett, and Albert H Yoon. How artificial intelligence will affect the practice oflaw. University of Toronto Law Journal, 68(supplement1):106–124,2018.

[2]MohammadAli. Exploringtherole ofaiinmodern legalpractice: Opportunities,challenges,andethical implications. J. Electrical Systems, 20(6s):3040–50, 2024.

[3]Flora Amato, Mattia Fonisto, Marco Giacalone, and Carlo Sansone. Anintelligentconversationalagent forthelegaldomain. Information, 14(6):307,2023.

[4]Jhanvi Arora, Tanay Patankar, Alay Shah, and Shubham Joshi. Artificial intelligence as legal research assistant. In Fire (working notes), pages 60–65,2020.

[5]Jiaxi Cui, Munan Ning, Zongjian Li, Bohua Chen, Yang Yan, Hao Li,BinLing,YonghongTian,andLi Yuan. Chatlaw: A multi-agent collaborative legal assistantwithknowledgegraphenhancedmixtureof- experts large language model. arXiv preprint arXiv:2306.16092,2023.

[6]Google AI. Google ai studio documentation. https://aistudio.google. com/, 2024. Accessed: Mar.2026.

[7]Morgan Gray, Jaromir Savelka, Wesley Oliver, and KevinAshley. Using llms to discover legal factors. arXiv preprint arXiv:2410.07504,2024.

[8]Changqin Huang, Yihua Zhong, Xizhe Wang, Zhongmei Han, and Tongquan Wei. From singleagent to multi-agent: motivational learning activities design and empirical study supported by llm-based agents. Journal of East China Normal

University (Educational Sciences), 43(5):44,2025.

[9]QHuang,MTao,CZhang,ZAn,CJiang,ZChen,ZWu, andYFeng.Lawyerllama:Enhancingllmswithlegal knowledge.arXivpreprintarXiv:2305.15062,2023.

[10] LangChain. Langchain documentation. https://python.langchain.com/ docs/, 2024. Accessed:Mar.2026.

[11] Lingyi Meng, Maolin Liu, Hao Wang, Yilan Cheng, Qi Yang, and Idlkaid Mohanmmed. Building from scratch: a multi-agent framework with human-inthe-loop for multilingual legal terminology mapping. Artificial Intelligence and Law, pages 1–40,2025.

[12] Andrew Mowbray, Philip Chung, and Graham Greenleaf.Utilisingaiinthelegalassistancesector testing a role for legal information institutes. ComputerLaw&SecurityReview,38:105407,2020.

[13] John J Nay, David Karamardian, Sarah B Lawsky, Wenting Tao, Meghana Bhat, Raghav Jain, Aaron TravisLee,JonathanHChoi,andJungoKasai.Large language models as tax attorneys: a case study in legal capabilities emergence. Philosophical Transactions of the Royal Society A, 382(2270):20230159,2024.

[14] Marc Queudot, E´ ric Charton, and Marie-Jean Meurs. Improving access to justice with legal chatbots.Stats,3(3):356–375,2020.

[15] Tavily AI. Tavily web search api documentation. https://docs.tavily.com/, 2024. Accessed: Mar. 2026.

[16] ChaojunXiao,XueyuHu,ZhiyuanLiu,CunchaoTu, and Maosong Sun. Lawformer: A pre-trained languagemodelforchineselegallongdocuments.AI Open,2:79–84,2021.

Turn static files into dynamic content formats.

Create a flipbook
Agentic AI in the Legal Domain: Enhancing Ethical Decision-Making through Specialized AI Agent by IRJET Journal - Issuu