
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.
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
Technology
Have a similar challenge?
Talk to our team about what this could look like for your business.