Building a Multilingual AI Legal Assistant Using Retrieval-Augmented Generation: A Case Study on the Legal System of Kazakhstan

This study presents the development of an Artificial Intelligence (AI)-based legal assistant using the Retrieval-Augmented Generation (RAG) architecture to provide legal assistance to citizens of the Republic of Kazakhstan. The proposed solution is designed to generate accurate, evidence-based responses to user queries using the regulatory legal acts of the Republic of Kazakhstan as the primary source of information. A legal corpus comprising 101,000 legislative documents and court decisions, with approximately 77 million tokens in Kazakh and Russian, was constructed to support the retrieval component of the system. To identify the most effective semantic retrieval method, three multilingual embedding models—Multilingual-E5-Large, BGE-M3, and KazEmbed-V5—were evaluated for vector search. The experimental results showed retrieval accuracies of 87.6%, 76.8%, and 83.3%, respectively. The GPT-5.4 and Llama-4-Scout-17B-16E-Instruct large language models were used to generate legal reasoning and responses based on documents retrieved through semantic search. The quality of the generated responses was evaluated using two complementary approaches. First, legal experts assessed the factual correctness and legal validity of the answers. Second, automatic evaluation was performed using word-level F1, BLEU, ROUGE, and BERTScore-F1 metrics. Among all evaluated configurations, GPT-5.4 combined with Multilingual-E5-Large achieved the highest overall accuracy (88.5%), whereas Llama-4-Scout-17B-16E-Instruct combined with KazEmbed-V5 achieved an accuracy of 83.6%. Based on the proposed architecture and the selected semantic retrieval and language models, an AI legal assistant was developed and integrated into the “Adal Azamat” legal services platform providing users in Kazakhstan with practical access to AI-assisted legal consultation.

Authors

Institutions

Publication Details

Journal
Computers
Published
2026-08-25
DOI
https://doi.org/10.3390/computers15090556
Primary Topic
Artificial Intelligence in Law
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Building a Multilingual AI Legal Assistant Using Retrieval-Augmented Generation: A Case Study on the Legal System of Kazakhstan

Ainur Аkhmediyarova, Нуржан Мукажанов, Zhibek Alibiyeva, Nurzhol Yerbolat et al.
Computers
Artificial Intelligence in Law
article

Building a Multilingual AI Legal Assistant Using Retrieval-Augmented Generation: A Case Study on the Legal System of Kazakhstan

Ainur Аkhmediyarova, Нуржан Мукажанов, Zhibek Alibiyeva, Nurzhol Yerbolat, Maksat Kanat, Bauyrzhan Ashirbekov
article en

Abstract

This study presents the development of an Artificial Intelligence (AI)-based legal assistant using the Retrieval-Augmented Generation (RAG) architecture to provide legal assistance to citizens of the Republic of Kazakhstan. The proposed solution is designed to generate accurate, evidence-based responses to user queries using the regulatory legal acts of the Republic of Kazakhstan as the primary source of information. A legal corpus comprising 101,000 legislative documents and court decisions, with approximately 77 million tokens in Kazakh and Russian, was constructed to support the retrieval component of the system. To identify the most effective semantic retrieval method, three multilingual embedding models—Multilingual-E5-Large, BGE-M3, and KazEmbed-V5—were evaluated for vector search. The experimental results showed retrieval accuracies of 87.6%, 76.8%, and 83.3%, respectively. The GPT-5.4 and Llama-4-Scout-17B-16E-Instruct large language models were used to generate legal reasoning and responses based on documents retrieved through semantic search. The quality of the generated responses was evaluated using two complementary approaches. First, legal experts assessed the factual correctness and legal validity of the answers. Second, automatic evaluation was performed using word-level F1, BLEU, ROUGE, and BERTScore-F1 metrics. Among all evaluated configurations, GPT-5.4 combined with Multilingual-E5-Large achieved the highest overall accuracy (88.5%), whereas Llama-4-Scout-17B-16E-Instruct combined with KazEmbed-V5 achieved an accuracy of 83.6%. Based on the proposed architecture and the selected semantic retrieval and language models, an AI legal assistant was developed and integrated into the “Adal Azamat” legal services platform providing users in Kazakhstan with practical access to AI-assisted legal consultation.

ComputersVol. 15(9)
Satbayev University (KZ), Narxoz University (KZ)
Peace, Justice and strong institutions
Openalex Percentile: Top 3%
Artificial Intelligence in Law
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.