Abdullah Omer Presentation
Case study · AI trust · Source attribution

Making a legal AI show its sources, down to the article.

Lawyers wouldn't act on an AI answer they couldn't check, so a fast answer still cost them an hour of research. I designed the system that lets every claim in Malakah's answers open the exact article of Saudi law it came from: the citation pattern lawyers see, the content model that makes article-level citations possible, and the tool the team uses to measure whether retrieval finds the right article.

AOAbdullah Omer·Product Designer, Stixor·8 min read
View the presentation Short on time? The whole story in 14 slides · PDF, 4.1 MB
Malakah workspace: a legal answer about rest breaks in the chat, a contract in the middle and the cited source document open in a third panel on the right
Where it ended up. The answer, the contract being worked on and the cited source, side by side.
RoleProduct Designer
CompanyStixor, for Malakah
Timeline2024–2026
UsersLawyers, plus the internal content and AI team
SurfacesLegal chat, legislation CMS, evaluation admin
LanguagesArabic (RTL) + English (LTR)
At a glance
Problem
10 of 12 lawyers said they would re-check any AI answer that didn't name its source. Unverifiable answers didn't save time; they moved it.
Reframe
Not “make the answer more accurate” but “make every claim cheap to check”. The thing to design was the path from a sentence to the law behind it.
What I designed
Four citation patterns, compared on how much checking each left to the lawyer; a legislation CMS that breaks laws into articles, annexes and amendments; an evaluation tool that scores retrieval with precision, recall, F1 and nDCG.
Key decision
Cite at the level of the article, not the law file, and open it beside the answer with the cited text highlighted and its version shown.
Outcome
The claim-to-source pattern carried into the shipped workspace. Malakah serves 1,000+ legal professionals; after launch one lawyer told us “It saves me 90% of my time.”
The problem

An answer you can't check is a research task, not an answer

Malakah answers legal questions in Arabic and English for Saudi legal teams. In 12 interviews with in-house counsel, law-firm associates and business approvers, the reason was simple: a lawyer is accountable for every piece of advice they give. If they can't see where a claim comes from, they look it up themselves.

10 of 12
would re-check any AI answer without a source
8 of 12
drafted in Arabic first
1,000+
legal professionals on the platform

Saudi law also changes. Articles are amended, extended and annexed, so “the law says” is only useful if you know which version said it.

The design goal: from any claim in an answer, reach the exact article it rests on, in its current version, in one click and without leaving the conversation.

Approach

A citation is only as good as the three layers under it

A source link in the chat is the visible part. It only works if the law is stored in pieces small enough to point at, and if retrieval reliably finds the right piece. So I treated it as one system with three layers, each with its own users.

1Structure the lawLegislation CMS. The content team breaks each law into chapters, parts, articles, annexes and amendments.Users: content team
2Measure retrievalEvaluation tool. The AI team runs test sets and sees whether the right articles come back, and in what order.Users: AI team
3Show the sourceLegal chat. Each claim links to its article, which opens beside the answer.Users: lawyers
Exploration

Four ways to show a source, and what each costs the lawyer

I judged every option by one question: how much work is left for the lawyer between reading a claim and trusting it?

ANo sources

Chat answer about rest breaks listing five numbered points that mention Articles 101 to 104, with no links to the law
The starting point. The answer mentions article numbers, but nothing links to them.

The answer reads well, but every article number is a claim the lawyer has to look up elsewhere. This is exactly the answer 10 of 12 said they would re-check.

BA list of law files

A Law Files side panel listing 20 documents, each titled Labor Law, next to the chat answer
Sources at the file level. Twenty files, all titled “Labor Law”.

Now the sources exist, but at the wrong level. The panel tells you which law, not which article, and every row looks the same. The lawyer still has to open a file and hunt for the passage, and nothing ties a given sentence to a given file.

CA link on every claim, opening the exact article

Each point in the answer ends with a View Law and Details link; the Labor Law panel is open beside it, scrolled to Article 104 with its text highlighted
Claim-level citations. “View Law & Details” after each point opens the law at that article, with the cited text highlighted.

This is the pattern that worked. The link sits on the claim itself, so the connection between sentence and source is never in doubt. The panel opens beside the answer, so reading the source doesn't mean losing the conversation, and the highlight shows the exact passage instead of a whole law.

DShow which version of the article

An Article 104 detail window over the law panel, showing the law name, the date 24/12/2024, the type of amendment and the initial version of the text
Version detail. Each cited article shows its date, the type of amendment and its earlier text.

A correct article in an outdated version is still wrong advice. An icon beside each cited article opens its history: the date, the type of amendment, and the text before it changed.

How the four options compare
OptionWhat the lawyer getsWork left to verify
A · No sourcesArticle numbers in proseFind and read each article elsewhere
B · File listThe right laws, not the right passagesOpen a file, search for the passage, match it to a sentence
C · Claim linksThe exact article, highlighted, beside the answerRead the highlighted text
D · + VersionThe article and when it last changedConfirm the version is current

What shipped

The claim-level pattern carried into the workspace. In the shipped version the source opens as a third panel next to the chat and the contract, at the right page, so a lawyer can check a claim while drafting without switching tools.

The trade-off I accepted

Simpler · not chosen
Cite whole laws. Easy to build and always “correct”, but it pushes the real work, finding the passage, back onto the lawyer.
Chosen
Cite articles. Far more work behind the scenes, because every law has to be stored article by article and retrieval has to find the right one. That cost is what the next two sections are about.
Layer 1 · Content

Making the law addressable

You can only link to an article if the system knows where each article starts and ends. Saudi legislation isn't a flat list: articles sit inside parts and chapters, and laws carry annexes, extensions and amendments. So I designed a CMS where the content team rebuilds each law as a tree before it's published.

Legislation CMS file preview for the Saudi Labour Law: a nested tree of chapters, parts and articles, plus annexes, extensions and a form, each with Tags and Edit; menus offering Add Article, Add Annex, Add Extension and Add Amendment; and a metadata panel showing the legislative instrument, issuing decree, issue date, effective date and expiry
Legislation CMS. Each law becomes a tree of chapters, parts and articles, with annexes, extensions and amendments attached where they apply.
What I designed
Layer 2 · Quality

Measuring whether the right article comes back

Article-level citations raise the stakes: a wrong article, shown with confidence, is worse than no citation. The AI team needed a routine way to check retrieval quality, not a one-off script. I designed an evaluation tool inside the admin view.

Evaluation admin page: a results table with columns for file name, status, date, F1, recall, precision and nDCG, buttons for Run Scheduled Test and Manual Test, and an upload window for a CSV test set with a Run button
Evaluation tool. Upload a test set, run it now or on a schedule, and compare runs by precision, recall, F1 and nDCG.
What I designed
Why a designer worked on an internal tool. The citation a lawyer sees is the output of retrieval. Giving the AI team a clear view of retrieval quality was the most direct way to improve what lawyers would trust.
Measuring success

How I'd know it's working

The goal was trust you can measure, so the metrics follow the user's path from answer to verified answer. Retrieval scores are already tracked in the evaluation tool; the product metrics below are the set I'd put in place next.

Task successTime from answer to verifiedHow long between an answer appearing and the lawyer moving on, compared with answers that have no citation.
EngagementCitation open rateShare of answers where a source is opened. Too low may mean blind trust; falling over time with steady quality means earned trust.
HappinessThumbs-down rateNegative feedback on answers, split by whether the cited article was right.
QualitynDCG on the test setWhether the correct article ranks first, tracked run by run in the evaluation tool.
CoverageClaims with an article-level citationShare of answer points that link to an article rather than a whole law.
AdoptionWeekly active lawyersWhether legal teams come back to the chat for real work.
“It saves me 90% of my time.”Lawyer using Malakah, feedback after launch

One lawyer's own estimate, not a measured average.

Reflection

What I took from this

Trust is a path, not a badge. “Sources” as a feature didn't help until the path from a sentence to its article was one click long.

The visible pattern depends on invisible structure. The citation link was the easy part to draw. The CMS and the evaluation tool are what made it true.

Design for the people behind the AI too. The content team and the AI team were users of this system as much as the lawyers were.

Next, I'd test citation density. One link per point worked for short answers. For long answers I'd test grouping citations per section against keeping them inline, measured by time to verify.