Legal · documents · OCR

Filings drafted from the case's own documents

A client arrives with an armful of scans and bank statements, and a long stretch of someone's day goes by before that becomes a filing. Generic AI tools do the same work in minutes, and they write a date that is not in the file with the same confidence, so the text cannot go to a client. I build a system for law firms that drafts from your own approved filings, checks every date and amount against the case documents and gives the client nothing until a lawyer approves it.

The problem

Where a firm's time goes

A law firm loses more time preparing to write than writing. Generic AI tools have not solved that part, and they have added a new round of checking to it.

Drafting only starts after a long stretch of other work

Someone has to read scans of varying quality one by one, pull out the dates and amounts and find the legal basis before the text can be written in the form the court expects.

All of this happens before the first sentence of the filing. As the number of cases grows, this is the part that puts deadlines at risk and takes a lawyer away from the work only a lawyer can do.

If a client sent phone photos, or a duplicate or irrelevant document is in the pile, it often comes out only at the end that part of the effort went on something unrelated to the case.

A tall stack of scanned pages and bank statements on a desk
Figure 1 The reading that comes before any drafting

Well written and wrong

Generic AI tools produce fluent text in minutes, and they write a date that is not in the file with the same confidence. The text looks right, and the mistake does not show at a glance.

So a lawyer has to check every date and amount against the documents again, and part of the time that was meant to be saved gets spent anyway.

Heavy immigration and translation documents

Immigration cases need bank statements, asset records and proof of income compared by hand, and the work starts again with every new document.

Certified-translation offices struggle with the same paperwork: a poor scan mixing Persian and English does not survive ordinary OCR, and in the end someone types it again.

How I work

How a case moves through the system

From the moment a client opens a case to the moment the result reaches them, every stage has its place and every output passes under a lawyer's hand.

A separate pipeline for each service

The client opens a case and uploads the documents. Inputs are checked before anything else, from volume and duplicates to handwriting and the wrong document. Text in PDF and Word is read directly, and a vision model reads scans and photos once and keeps the result.

Each service the firm offers, such as a Mandamus application or a memorandum of argument in the Federal Court of Canada, has its own pipeline. It extracts the facts from the documents, finds the legal basis and drafts from models your own lawyer has already approved.

The legal basis comes from two places: a curated library of statutes, rulings and model filings given only to the step that needs it, and live research where every finding carries its source and date. A query containing a name or case identifier is not sent to research at all.

Three linked stations: a magnifying glass over a scan, a law book and a draft
Figure 2 Concept illustration: extract the facts, find the legal basis, draft from approved models

Every date and amount must be in the documents

Before the draft reaches a lawyer it is critiqued once more. Any date or amount that is not in the documents is refused, and statements attributed to the client are checked against what the client said.

Text inside a document is treated as data. If an instruction to the model is hidden in an image, the system does not act on it, and the system's own instructions cannot leak into a deliverable.

The case then lands on a shared review desk with the reason it was escalated. A lawyer claims it and keeps it through delivery, sees earlier versions and can ask for a rewrite. Nothing reaches the client until that lawyer approves it.

Threads linking lines of a draft to a source document
Figure 3 Concept illustration: a draft checked against the documents, and a line with no source refused

The rest of the firm's work is in the same place

Case and deadline management with due-date alerts, a client portal, billing and email and SMS notifications sit in the same system, and every event is logged.

The firm configures the intake form for each practice area. Any delivered document can also become a section-by-section lesson for junior lawyers.

The model is controlled like the rest of the system

Every AI version is evaluated and tested before it goes into use at the firm. The model and reasoning depth are chosen per step, and if a model's answer comes back cut off, nothing is delivered.

Staff sign in with two-step login. The system has been used in two court systems so far: immigration filings in the Federal Court of Canada and a civil-law court system.

Selected work

If your work is high-volume document processing

I built these two separately from the law-firm system, for offices whose main problem is the document itself.

Persian and English OCR

Reading poor Persian and English scans

For certified-translation offices I built a pipeline that turns poor Persian and English scans into clean, structured text. A page mixing the two scripts is hard for ordinary OCR because the writing direction and letterforms change on the same page.

Its engine has gone through several generations, from PaddleOCR to DeepSeek-OCR and Qwen2-VL, with Gemini tidying the text at the end. Documents are processed page by page, progress shows live, and other software connects through a C# client library.

A stained, skewed scan becoming a clean structured page
Figure 4 Concept illustration: a poor scan turned into clean, structured text

Comparing immigration financial documents

For the financial side of immigration cases I have a suite that scores the similarity of bank statements, asset records and proof of income and runs specific questions over each document. The output is a court-ready PDF, and a lawyer can carry the results into a brief.

Projects I have built

  1. Law Firm System

    AI drafting under lawyer review, from intake to a court-ready file.

    Law firms lose hours turning scattered client documents into a filing: reading scans, pulling out dates and amounts, finding the legal basis and drafting in the court's form. Generic AI tools draft fast but invent facts and cannot be trusted with a client. This system drafts from the firm's own approved models, refuses any date or amount that is not in the documents, and puts a lawyer's approval between the machine and the client.

    Project details →
  2. Persian–English OCR

    Certified-translation pipeline.

    Certified-translation offices drowned in manually retyping mixed Persian–English scans; quality and turnaround suffered. This pipeline extracts clean, structured text from low-quality, mixed-script documents automatically.

    Project details →
  3. Financial Documents Analysis

    AI similarity & analysis suite for immigration financial documents.

    Immigration cases drown in financial paperwork — bank statements, asset records, proofs of income — and lawyers compare them by hand. This AI suite scores similarity, runs structured questions over each document, and produces court-ready PDFs.

    Project details →

Questions I hear often

Is client data sent anywhere?

It does not have to be. The system can run on the firm's own server, and I choose the language model to fit your confidentiality policy. We sign an NDA before I see any document.

Does it replace the lawyer?

No. Drafting and extraction get faster, while decisions and signatures stay with the lawyer, and the system is built so it gives no output without that approval.

Does it work with our current software?

Usually, yes. Nothing has to be replaced wholesale; I connect the outputs to your case-management system or the folders you already use.

How does an engagement start?

You send a short technical brief and I reply in writing on whether I can help. If I can, we start with a pilot from $600.

Is legal or document work taking too long?

We start with a pilot from $600. Write which documents you handle, how you work with them today and where most of the time goes, and I will give you the scope and the final price in writing.