NNile Builds AI
← Blog
Legal AI

Generating a Demand Letter in 90 Seconds with GPT-4o

A two-step pipeline that takes structured matter data and produces a first-draft demand letter with inline source citations and attorney review flags — no blank page, no manual cross-referencing.

The demand letter is one of the most templated documents in personal injury law. The structure rarely changes: facts of the incident, liability, injuries and treatment, itemized damages, the demand amount. Every PI attorney has written hundreds of them.

And yet it still takes hours. Not because the writing is hard, but because you have to pull the same information from five different places — the police report, the medical records, the wage verification letter, the intake notes — and cross-reference them while you write. Miss a figure or cite the wrong document and the whole letter is at risk.

I built a pipeline that does the assembly work. You upload your case documents — police report, medical records, wage verification — and it produces a first-draft letter with inline source citations in about 90 seconds. You review, adjust the tone, and send.


The pipeline

Three steps: extract the facts from your documents, draft the letter, then resolve citations.

Demand letter generation pipeline

Separating drafting from citation is intentional. If you ask the model to draft and cite simultaneously, it tends to write around what it can easily cite rather than what the letter actually needs. Draft the letter first as if all the facts are known, then do a second pass specifically to anchor each claim to a source document.


Step 1: Draft the letter

The first prompt takes the extracted case facts and generates the letter body. The tone is professional and firm — close to what a PI attorney would write — but deliberately conservative on the demand amount so you review it before finalizing.

Step 1 — Draft Letter
You are a legal writing assistant helping a solo personal injury attorney draft a demand letter.

Using the matter data below, write a complete demand letter with the following sections:
1. RE line (case name and claim type)
2. Opening paragraph identifying client and purpose
3. Facts of the incident (2-3 sentences, objective tone)
4. Injuries and treatment (what happened, how long, current status)
5. Itemized damages table (medical costs, lost wages, total specials)
6. Demand amount (3x special damages if liability is Strong, 2x if Moderate — flag this multiplier for attorney review)
7. Response deadline and closing

Tone: professional, factual, firm. Do not be inflammatory. Do not make legal arguments — state facts.
Format: plain text, suitable for letterhead.

Leave placeholder markers like [CITATION NEEDED] after any factual claim that should reference a specific document. The next step will resolve these.

Matter data:
{matter_json}

The [CITATION NEEDED] markers are the key. They act as a handoff to step 2 — instead of asking the model to juggle drafting and sourcing simultaneously, you get a clean first draft with clearly marked gaps.


Step 2: Resolve citations

The second prompt takes the draft with markers and the list of uploaded documents, then replaces each marker with the specific document and page reference.

Step 2 — Resolve Citations
You are a legal citation assistant. Below is a demand letter draft with [CITATION NEEDED] markers and a list of available source documents with their contents.

For each [CITATION NEEDED] marker:
1. Find the most relevant source document for the factual claim immediately before the marker
2. Replace the marker with: [Source: filename · page/section reference]
3. If no source document supports the claim, replace the marker with: [UNVERIFIED — attorney review required]

Do not change any other text in the letter. Return only the complete letter with resolved citations.

Draft letter:
{letter_draft}

Available documents:
{document_list}

Any claim that can't be sourced comes back as [UNVERIFIED]. That becomes part of the review flag list — you either find the document or remove the claim.


Try it

The demo runs both steps on the Torres v. Midland matter from the intake pipeline post. Hit Generate Letter to see the full output including the review flags and the formatted letter with citation tags.

▶ Demand Letter GeneratorMock data — no API calls
1 Parse matter facts
2 Draft letter body
3 Add source citations
4 Run review pass
Matter Facts

The letter renders in a document view so you can see how it reads, and the copy button exports it as plain text ready to paste into Word or your practice management system.


The review markers

Every factual claim in the letter comes back with one of two tags:

[Source: filename · section] — the citation resolved. The claim is anchored to a specific document and section. You can verify it in seconds.

[UNVERIFIED — attorney review required] — no source document supported the claim. Either find the document or remove the claim before sending.

The goal isn't to replace attorney review — it's to make the review faster by telling you exactly where to look.


Where this breaks down

Multi-defendant cases. If liability is shared across defendants, the letter structure gets more complex than a single template handles. The pipeline works but you need to adapt the prompts for each defendant's exposure separately.

Soft tissue claims without strong documentation. If the medical records are thin or the diagnosis is subjective, the model will draft the treatment section conservatively — which might actually be appropriate, but know that it won't advocate beyond what the documents support.

Jurisdiction-specific language. The letter template uses neutral language. Some jurisdictions have specific demand letter requirements (California's UM demand rules, Florida's pre-suit requirements under the medical malpractice statute). Always verify the format against your state's requirements before sending.


Pair it with the intake pipeline

This post and the intake pipeline post describe two stages of the same workflow:

  1. Intake — turn messy phone notes into structured matter data
  2. Demand — turn structured matter data into a first-draft letter

The output of stage one is the input to stage two. If you build both, a new PI intake call goes from raw notes to a reviewable demand letter draft in about three minutes of actual work — the rest is GPT-4o.


Generate from your own case documents

Upload your case files below — police report, medical records, wage verification, anything you have. Free to run — 10 times per day, no account needed.

▶ Generate from your case documents5 free runs/day · no account needed
Case documents
Upload police report, medical records, wage verification, etc. (.pdf, .docx, .txt)
1 Extract case facts
2 Draft letter
3 Resolve citations
Free · 5 runs/day
Want to talk?
I'm building NileLegal — a product that runs these pipelines automatically, without the API key setup. If you want to see it on your actual case files, have questions about the pipeline, or want to discuss a custom build, book a call.
Book a callSee demo
Newer →Building a Legal Intake Pipeline with GPT-4o