THE BLUEPRINT, MARKED UP AGAINST THIS CASE

A five-layer AI legal-advisor architecture — checked against People v. Cuellar / 2026-00034514

Verdict: the architecture is correct. The stack choices are real and current. A few layers are

over-built for a 227-page case, and two things that decide actual outcomes are missing.

Measured facts used here (not assumed): the case folder is 49 files / 205 MB / 227 PDF pages.

Every page fits inside a modern context window. mcp.courtlistener.com returns 200.

/api/rest/v4/citation-lookup/ returns 401 — i.e. it exists and wants a free token.

---

LAYER BY LAYER

Layer 1 — Case Vault / RAG · OVER-BUILT, CUT IT

Blueprint says: Qdrant or ChromaDB, BGE-M3 embeddings, BM25 hybrid, structural chunking.

At 227 pages, vector search is engineering a problem you don't have. Retrieval-augmented

generation earns its keep at thousands of pages. Here the entire file fits in one context window,

so the highest-fidelity retrieval is simply grep + read the whole thing — and it never

mis-ranks.

Change: skip Qdrant, Chroma, embeddings and chunking entirely for now. Keep the folder

structure and the immutable metadata idea (doc_name, date, bates/page, party) — that part

is right and it's what Layer 5 needs. Add RAG later only when the file outgrows the window.

Revisit at roughly 800–1,000 pages.

Layer 2 — Statutory & Rule Corpus · RIGHT, AND THE HIGHEST-VALUE LAYER

This is the best idea in the document and it costs nothing. Statutory text is stable, short and

quotable — the one thing an LLM genuinely cannot hold reliably from memory.

For this case the corpus is small and specific: Veh. Code § 23152(a)/(b) · § 13353.2 (the

four APS elements) · § 13557–13559 (writ review) · Gov. Code § 11507.6, 11513, 11524

(discovery, evidence, continuance/judicial-review window) · 13 CCR § 115.05 · **Title 17

§§ 1219–1220.1 (blood collection/preservation) · NHTSA DWI Detection & SFST manual** (the FST

standard) · and the DMV's own APS Hearing Officer Manual § 2.102 (the grantable-continuance list).

Note: §§ 11524 / 11507.6 and the H.O. manual are the administrative rules — the layers most

self-represented people never load, and exactly where a DMV hearing is won or lost.

Layer 3 — Live Precedent & Verification · RIGHT. Wire it — it's cheap and free

The core insight is correct and it is the one that fixes the failure you've already seen: **do not

trust model weights for case citations.**

Verified working: /api/rest/v4/search/ (filter by court) and /api/rest/v4/citation-lookup/.

A free Free Law Project token gets ~3,000 v4 queries/day — far more than one case needs.

Reality check from this matter: a handful of genuinely load-bearing opinions is the whole

shelf — Hughey v. DMV (235 Cal.App.3d 752), Phillips v. Gordon, Gerwig v. Gordon,

Helmandollar, Mosier, Cruz, Beltran, Coffey. Those are **already downloaded and

verified in caselaw/. CourtListener then serves as the verifier**, not the primary source.

⚠ Already-documented pitfall: CourtListener's opinion PDFs sit behind CloudFront and throw

intermittent HTTP 202/403 with a 0-byte body. Retry with backoff, or use the

storage.courtlistener.com/harvard_pdf/<id>.pdf mirror. A naive fetcher will look "broken" when

it is merely being throttled.

Layer 4 — Four adversarial agents · PARTLY OVER-BUILT

Running all four as separate infrastructure (n8n / LangGraph) is heavy for 227 pages. They are

mostly four prompts, not four services.

Keep as real separations — they genuinely fight the agreeableness problem:

narrative; injured YES at scene vs NO at booking; "lenses: NONE" against a mandatory

corrective-lens restriction).

are the DMV; destroy this draft."* Run it last, on a finished draft, never merged with drafting.

Fold the other two into the prompts: the procedural gatekeeper is a checklist, and the drafter

is the same model with a different instruction.

Skip n8n unless you want the web UI. Python + cron already runs here.

Layer 5 — Citation & Audit Gate · RIGHT, AND IT FIXES A REAL, ALREADY-SEEN FAILURE

The [Exhibit B, p. 4] provenance requirement is the most valuable single rule in the document —

because it is the exact failure this case has already produced. Reading image-only scans by eye

generated phantom discrepancies (a "40152 vs 46152" kit split and a "four different identifiers"

claim) that survived until checked against native text.

Make the gate hard: strip any reporter citation that fails citation-lookup; require a verbatim

quote plus [form, page] for every factual assertion; and mark anything read from an image-only

page as unconfirmed until traced to text.

---

THE TWO REAL GAPS

1. Nothing in the blueprint has a clock

Every layer is retrieval. None is time. A flawless brief filed late loses. This matter has a

hearing date, a 10-working-day judicial-review window, and a pending criminal date. **A deadline

watcher that pushes T-7/T-3/T-1/day-of is not optional — it is the layer that decides outcomes.**

2. Nothing sends anything

citation-lookup validates a draft; it does not file, mail or serve. The single most urgent

act in this case right now — the written continuance request — dies in an outbox. **Layers 1–5

produce documents; a mail layer makes them exist.**

---

THE HONEST HEADLINE FOR THIS CASE

**The blueprint optimises litigation — motions, briefs, filings, judges. Your live event is a

DMV APS hearing: three elements, a preponderance standard, no judge, no brief, no motion.** For

the next four days, Layers 3–5 barely help.

So the sequencing is:

1. Now → 18 Nov: the cheap version wins. Case folder + Layer 2 statutes + a deadline clock +

the two agents (fact auditor, red-team). No vector DB, no n8n, no brief.

2. Then build the court-facing version (Layers 3–5, RAG when the file grows) for the criminal

matter, which is the longer and bigger exposure.

Build the blueprint — but don't let building it cost you the hearing.

*(The blueprint's own closing note is correct and worth keeping: AI is not licensed counsel, creates

no attorney–client privilege, and local rules on AI-assisted filings vary. Assume disclosure-when-asked.)*

Linked from: DUI Case