MubtakaratMUBTAKARAT IT

How a legal AI agent can answer without inventing laws that don’t exist

· 4 min read · Mubtakarat IT

The most dangerous thing about legal AI is citing an article that does not exist, or a ruling that was never issued, in a confident tone. In law, an unsupported answer is worse than no answer.

Why does the model invent?

A language model has learned what legal text looks like, not what is in force today. Asked without being given the text, it may compose an answer that sounds right, and may mix an old version of a law with an amended one.

The answer: retrieve, then generate

Instead of answering from memory, the agent goes through five steps:

  1. Understanding the question: identifying the field, such as employment, companies or civil transactions, and the country.
  2. Retrieval: text and semantic search across the law library brings back the most relevant articles, from versions in force only.
  3. Generation: the model receives these articles with strict instructions: no ruling without an article, and no answer from outside the texts.
  4. Automatic checking: every article cited in the answer is checked against what was retrieved; otherwise the sentence is removed.
  5. Presentation: the answer comes with cards for each cited article, which the reader can open and verify.

Rules of behaviour that matter just as much

How we measure quality

With a test set of questions written by lawyers, with their correct answers, run on every update. The standard is not only a correct answer, but a correct citation every time, and not a single invented article.

This is how we build our free Legal Library. The platform provides general legal information and is not a substitute for advice from a lawyer.

Want to apply this in your organisation?

We help you design and run the solution.

Contact us