Case Study · Generative AI

Bilingual AI Legal Assistant for a Multi-Jurisdiction Law Firm

An Arabic/English AI assistant that drafts legal documents, retrieves precedents with semantic search and analyses case files, with each country's data isolated in its own region.

← All case studies
Client
Law firm · Confidential client
Industry
Legal
Research & drafting time
2–3 days → under 5 minutes

The client

A law firm practising across six jurisdictions needed one assistant that could draft documents, find judicial precedents, analyse uploaded case files and surface same-day legal news, in both Arabic and English. No off-the-shelf product handled right-to-left legal drafting, per-country data isolation and semantic legal search together.

The challenge

  • Research bottleneck: finding precedents for a single case took 2–3 days and several staff, because government legal portals only support keyword search.
  • No bilingual tooling: Arabic legal documents need correct RTL formatting and jurisdiction-specific templates, and machine translation is not legally reliable.
  • Fragmented knowledge: specialists worked in silos across hundreds of templates, and drafting could not start until research was finished.
  • Data sovereignty: each country's legal data had to be physically and logically isolated, while still running as one platform that could add countries without re-engineering.

What we built

  • A full-stack platform (React web, Flutter mobile and an admin panel) on a FastAPI backend. An intent router classifies each query and sends it to one of five workflows: document drafting, judgment search, document analysis, general Q&A and appeal automation.
  • A multi-tenant architecture with a separate PostgreSQL database for each country, hosted in its own AWS region. Adding a country is a configuration and data-upload step, not a code change.
  • A custom Arabic RTL pipeline that generates PDF and DOCX documents, seeded with 20,000 client documents.
  • Two retrieval-augmented generation (RAG) pipelines, one for judicial precedents and one for statutory articles, using multi-query reformulation against OpenSearch.
  • Real-time search across 20+ official government and legal sources, returning same-day judgments with source citations.
  • Token-based subscription billing with tiered plans, plus admin tools for user segmentation, notifications and content.

Why it matters

This is regulated, multi-jurisdiction, bilingual AI, where calling an LLM is only a small part of the job. Most of the engineering went into retrieval architecture, data isolation and workflow routing, and that is the work Adivi brings to clients.

Outcomes

Legal research and drafting per query
2–3 days → under 5 minutes
Jurisdictions with isolated data
6
Official sources searched live
20+
Free licences issued to law students
10,000

Technology

ReactFlutterFastAPIPostgreSQLAWS (multi-region)OpenSearchLLM + RAG

Have a similar challenge?

Talk to our team about what this could look like for your business.

Book an Appointment

Related case studies