← Back to HAQQ Blog

What Happens Before a Legal AI Answers Your Question

By Stephane Boghossian · · Updated · 7 min read · Ai-legal-tech

Many legal AI products pass your prompt straight to a general model. What a system does before that call shapes the answer. The architecture, and four demo tests.

Key facts

Every lawyer evaluating legal AI eventually asks the same question, usually about eight minutes into a demo: how is this different from using ChatGPT?

Vendors tend to answer with training data, a proprietary corpus or a fine-tune. Those claims are hard to check and often sit away from where the difference lives. The answer we give is architectural, and it comes down to where the thinking happens.

A large share of legal AI products work like this. You type a question. The product wraps it in a prompt template (instructions to act as a helpful legal assistant, perhaps a few examples) and forwards it to a general-purpose model. The model answers, and the product formats the answer.

That can be useful. It also means the product's quality is mostly the model's quality, and your opposing counsel can buy the same model on a consumer subscription.

For a buyer, the hard part is that you cannot tell from the interface. A wrapper and a purpose-built engine both show a text box, a streaming response and some citations underneath. The difference sits upstream, out of sight, which is why vendors are rarely pressed on it.

What should happen before the model is called?

When a question reaches HAQQ, it first goes through a step we own, whose job is to work out what the request is and to configure everything that follows.

That step settles what a competent associate would establish before starting work, and it records the result as structured data:

The general-purpose model runs after all of that, and it starts prepared: the relevant capabilities loaded, the facts extracted, the jurisdiction identified and the scope decided.

The model runs last, on work that has already been sorted.

Why does that produce better answers?

Two mechanisms, and the second one surprised us more.

Attention is a budget

A model's context window is finite, and everything in it competes for attention. The research above shows what happens as context grows: retrieval gets worse in the middle of long inputs (Liu et al.) and reliability falls with length even on easy tasks (Chroma). Loading every capability a system has into every request spends that budget before the lawyer's document arrives. Loading only the relevant ones leaves room for the contract, the statute and the facts.

Structured facts spare the model a parsing job

This is the larger effect. Handed a paragraph of prose, a model spends part of its effort working out what the paragraph contains. Handed structured facts (these parties, this governing law, this obligation, this date), it can spend that effort on the legal question.

That is the effect we design for: the same general-purpose model doing better legal work because of what it was handed. We have not published a controlled comparison of the same model inside and outside our engine, so treat this as our design rationale, supported by the context research above.

Two components that rarely appear in a sales deck, and both decide whether the product works on a normal Tuesday.

Document intake. Much legal work arrives as a photograph of a stamped page, a scan of a fax or a PDF that was printed and re-scanned crooked. We treat reading those as a core engineering problem. If a clause number is misread on the way in, no downstream reasoning recovers it, and the system will reason carefully about the wrong number.

Memory as structure. The engine keeps the relationships between your matters over time and draws on them when a question calls for it. Pasting your last twenty messages back into the prompt is a different thing. Structured memory is what lets the system know that the counterparty in the NDA you are reviewing today is the same company from a dispute two months ago.

What does good architecture not fix?

We would rather say this than have you find it out.

It does not eliminate error. Any system built on a language model can produce a wrong answer, and the figures in the key facts above apply to every tier of the market. Good architecture makes errors rarer and easier to catch: claims generated against retrieved sources, citations you can open, and explicit flags where the law is unsettled. Our hallucination audit tracks what happens when nobody checks.

It does not remove the lawyer. Everything here assumes a professional reviews the output and signs it. That assumption shaped the architecture from the start.

It does not make coverage universal. Quality varies by jurisdiction, by how well the source law is digitised and by how much of it is public. If a vendor quotes a single global coverage number, ask what it counts. We would rather answer that question about your jurisdiction than give you one figure.

You do not need anyone's architecture diagram. Four tests, about ten minutes, and they work on every vendor in the category, us included. For a longer checklist, see 45 red flags in a legal AI vendor evaluation.

1. Ask it something outside law

A general model in a legal prompt will usually answer a medical or financial question, because underneath it is a general model. A system that establishes intent before generating should decline and say why.

2. Ask the same question in two languages

Write the same legal question once in English and once in Arabic or French, each in your own words. If the substance of the answer changes, language is being handled after the reasoning.

3. Give it a bad scan

Photograph a document at an angle, in poor light, and upload it. In our experience this is the most predictive test in the demo, because it is the most common real input and the least demoed one.

4. Ask what it does not know

Push it toward an unsettled or thinly sourced area of law. A system tuned to always produce an answer will produce one. A system built for professional work will tell you the ground is uncertain and show you why.

If a vendor is comfortable with all four, the architecture is probably real. If the demo steers around them, that tells you something too. You can run the same four against HAQQ's legal AI chat.

Key takeaways

FAQ

What is an AI orchestration layer in legal software?

The term has two meanings. In most legal software it means workflow routing: sending a matter to the right person for approval. The narrower technical meaning is the layer that decides what happens before an AI model is called: the intent, jurisdiction, facts and scope of the request. When a vendor says orchestration, ask which one they mean, because only the second changes the quality of the answer.

Is HAQQ a ChatGPT wrapper?

A general-purpose model performs the final generation in HAQQ. Before that model is called, HAQQ's engine, Justinian, resolves what the request is: the intent, the jurisdiction, the language of the governing law, the facts as structured data and the scope. In a wrapper, the question goes to the model with a prompt template around it and little or no work beforehand.

How do I tell whether a legal AI product is a wrapper?

Run four tests in a demo. Ask something outside law: a wrapped general model will usually answer a medical or financial question. Ask the same legal question in two languages in your own words: if the substance changes, language is handled after the reasoning. Upload a crooked, badly lit scan. Then push toward an unsettled area of law, where a professional system should say the ground is uncertain.

Why does doing work before the model call improve the answer?

A model's context window is finite, and research shows reliability falls as input grows: Liu et al. (TACL 2024) found accuracy drops when relevant information sits in the middle of a long context, and Chroma's July 2025 Context Rot study found all 18 models tested degraded with longer inputs. Loading only what a question needs, and passing facts as structured data, leaves more attention for the legal question.

Does better architecture stop legal AI from hallucinating?

No. Any system built on a language model can produce a wrong answer. A preregistered Stanford study found leading legal research tools hallucinated on 17% to 33% of test queries, and HAQQ's June 2026 run found 24% of 3,000 frontier-model answers cited law that did not support the claim. Good architecture makes errors rarer and easier to catch through retrieved sources, openable citations and explicit uncertainty flags.

Why does document scanning quality matter for legal AI?

Much legal work arrives as a photographed stamped page, a faxed scan or a PDF re-scanned crooked. If a clause number or date is misread at intake, nothing downstream recovers it: the system reasons carefully about the wrong number and presents the result with confidence. That is why a bad scan is one of the most useful tests to run in any legal AI demo.