Skip to content
Review Open access

Legalyze: An Open‐Source Structure‐Aware Agentic RAG Platform for High‐Precision Legal Intelligence

Sep 2026 · Expert systems · Vol 43 · 0 citations · 31 references

TL;DR

Results show that structure‐aware retrieval combined with targeted information extraction can improve the reliability of AI systems for legal research and analysis.

Abstract

The integration of Large Language Models into the legal domain is constrained by a reliability gap, where models can generate incorrect or unsupported information in specialized reasoning tasks. This issue is especially important in jurisdictions such as Pakistan, where legal texts have strong structural dependencies and require accurate grounding. This research introduces Legalyze, an open‐source and modular five‐tier system designed to support legal analysis. The system uses Structure‐Aware Hierarchical Indexing (SAHI) and a dual‐stream retrieval pipeline that combines lexical and semantic search using Reciprocal Rank Fusion. It also includes a component called Legal Wisdom of Extraction, which identifies key legal entities such as petitioners, respondents, court names and referenced laws from the text. By preserving the structure of legal documents and grounding responses in retrieved evidence, the system substantially improves the grounding of generated outputs. Evaluation on a 1.2 million‐token corpus of Pakistani statutes and case law, comprising five statutory and case‐law sources with 67 legal queries assessed by three independent legal reviewers under a reviewer‐blinded evaluation protocol (Fleiss' κ=0.743$$ \kappa =0.743 $$ , substantial agreement), showing a reduction in pooled hallucination rates from 54.7% in a zero‐shot baseline to 5.5%, outperforming standard retrieval‐based approaches. The improvement over both baselines is statistically significant across all pairwise comparisons (Cochran's Q=37.57$$ Q=37.57 $$ , p=6.93×10−9$$ p=6.93\times {10}^{-9} $$ ; McNemar exact: Zero‐Shot vs. Legalyze p=5.40×10−9$$ p=5.40\times {10}^{-9} $$ ). A seven‐configuration offline retrieval ablation further demonstrates that an offline surrogate of the Legalyze architecture achieves Recall@5 of 65.0%, compared to 45.0% for flat lexical retrieval, confirming the retrieval gains attributable to structure‐aware indexing. These results show that structure‐aware retrieval combined with targeted information extraction can improve the reliability of AI systems for legal research and analysis. Legalyze represents a promising prototype for delivering trustworthy, jurisdiction‐specific legal intelligence as a research and decision‐support tool in professional environments.

Read PDF

Similar papers

#artificial intelligence Open access Nov 2026

A Hybrid Knowledge-Enhanced Legal AI System for Construction Contract Disputes

A domain-specific legal artificial intelligence system for construction contract disputes via hybrid knowledge integration based on the retrieval-augmented generation (RAG) paradigm, integrating five core legal texts and 500 adjudication cases within a dual-engine architecture is proposed.

Ying Lu, Xin-Yun Shen, Yujing Wang et al. · 0 citations
Book Open access Aug 2026

A Multi-Agent LLM Pipeline for Legal Argument Mining

Results show that cascading errors substantially degrade downstream performance, making the first stages of the pipeline a significant bottleneck, and highlight the importance of evaluating modular LLM systems in their end-to-end behavior in addition to individual task performance.

S. Banihashemi, Giulia Grundler, Andrea Galassi · 0 citations
Open access Aug 2026

Leveraging LLM agents and knowledge models for automated legal reasoning

This paper introduces SARA, an LLM‐powered platform deployed in a Brazilian court, which demonstrates significant efficiency and quality gains through the integration of LLM agents with knowledge models on jurisprudential and basic legal concepts.

V. Pinheiro, Francisco C. J. Bonfim, S. Silva et al. · 0 citations
Conference Aug 2026

Automated Argument Mining and Entity Recognition in Sri Lankan Legal Judgments Using Large Language Models

Access to legal information remains a significant challenge in low-resource jurisdictions, where judicial documents are often lengthy, unstructured, and difficult to interpret. This paper presents a unified framework for automated argument mining and named entity recognition in Sri Lankan legal judgments using Large La...

Sathmi Sansiluni Jayaratne, Ruvan Weerasinghe · 0 citations
Open access Aug 2026

Executable explanation traces for legal LLM predictions via retrieval-augmented codification

Explainability is particularly challenging in legal prediction, where decisions are expected not only to be accurate but also to be justified under explicit legal norms and open to external scrutiny. Legal reasoning therefore provides one of the most demanding settings for explainable AI because a legal determination o...

Haoyang Chen, K. Tanaka-Ishii · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.