Fact-Centric Legal Document Review with Custom AI Pipeline

mary_technology · Legal · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Legal document review for litigation

Mary Technology needed to automate legal document review for dispute-resolution teams without losing the nuance, provenance, fact disambiguation, and attorney verification required in low-fault-tolerance litigation workflows.

Constraints:

Architecture

Mary built a fact-first legal review pipeline. It ingests messy legal documents from email or existing systems, splits and structures bundled files, extracts entities, dates, events, gaps, leaks, timelines, and other key facts, resolves ambiguity such as abbreviations and people, attaches provenance and rationale, presents facts in a review dashboard, lets lawyers inspect source pages and build narratives, and only then pipes the verified fact layer into downstream AI tools such as drafting or analysis interfaces.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  document-intake["Document intake"] --> document-structuring-pipeline["Document structuring pipeline"]
  document-structuring-pipeline --> fact-manufacturing-pipeline["Fact manufacturing pipeline"]
  fact-manufacturing-pipeline --> entity-and-context-resolver["Entity and context resolver"]
  entity-and-context-resolver --> source-evidence-viewer["Source evidence viewer"]
  source-evidence-viewer --> fact-review-dashboard
  fact-review-dashboard --> lawyer-verification-loop["Lawyer verification loop"]
  fact-review-dashboard --> downstream-ai-interface["Downstream AI interface"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Document intake Collects case documents from email attachments or uploaded legal tools. Document structuring pipeline
Document structuring pipeline Splits messy bundled files, categorizes, renames, and organizes them back into workflows. Document intake, Fact manufacturing pipeline
Fact manufacturing pipeline Treats facts as first-class objects and extracts legally meaningful entities, dates, events, gaps, leaks, and timelines. Document structuring pipeline, Entity and context resolver, Fact review dashboard
Entity and context resolver Resolves ambiguous names, dates, abbreviations, repeated facts, conflicting facts, and provenance. Fact manufacturing pipeline, Source evidence viewer
Source evidence viewer Shows the exact document page and location supporting a fact. Entity and context resolver, Fact review dashboard
Fact review dashboard Lets lawyers review facts, relevance rationales, narratives, chronologies, and source evidence. Source evidence viewer, Lawyer verification loop, Downstream AI interface
Lawyer verification loop Lets legal teams verify, correct, and gain confidence before using facts in legal work. Fact review dashboard
Downstream AI interface Consumes the verified fact layer for drafting, analysis, or other LLM-powered workflows. Fact review dashboard

Data flow

Documents enter from email or uploaded tools, are scanned, split, categorized, renamed, and organized; the fact pipeline extracts entities, dates, timelines, gaps, and other key case details; each fact is corrected and rationalized with source provenance; lawyers review facts and narratives in a dashboard; then the trusted fact layer feeds downstream AI applications.

“We could take the attached documents in the email or find uploaded documents in the tools you already use, then scan and process them.”transcript, stated
“you need to then take this layer of facts that you can feel confident about and pipe it through to these downstream AI applications.”transcript, stated

Why this architecture

Mary rejects direct RAG or agentic extraction over raw legal documents because LLMs compress away nuance and cannot by themselves resolve legally meaningful facts. The platform instead creates an auditable fact layer first, then lets lawyers verify that layer and use it in downstream AI.

“Each layer of that compression removes meaning, and it's that meaning and nuance that's so important to law firms”transcript, stated
“the first thing you've got to do is treat facts as first class citizens.”transcript, stated

Models used: Custom fact model · Fact manufacturing pipeline · Document OCR/text extraction · Structured fact layer · Downstream LLM interfaces · RAG and agentic workflows as downstream consumers

Scale

Alternatives considered (roads not taken)

Direct LLM/RAG over legal documents.

Rejected because: Compression, chunking, and summarization remove the legal nuance and meaning needed for dispute work.

“The second problem, and maybe the biggest one, is that large language models are compression machines.”transcript, stated

Extract a text snippet and treat it as a ready fact.

Rejected because: Facts need entity resolution, date interpretation, relevance, fragmentation, conflict detection, and provenance.

“you can't just extract this piece of data and assume that it's ready in its current state to be used for downstream processing using AI.”transcript, stated

Generate a polished legal document directly.

Rejected because: Lawyers must be confident in the facts and narrative before filing or sending legal work.

“You can't because you need to, ultimately you have an obligation to whoever it is that you're representing”transcript, stated

Patterns

structured-output-contract (fact-first legal representation)

Mary represents facts as first-class structured objects with metadata, rationale, and provenance before downstream AI use.

“a fact review platform needs to have the best fact model”transcript, stated

human-in-the-loop-gate (legal verification)

Lawyers review the fact layer, source pages, rationales, and narratives before relying on generated legal work.

“this is where they go to review the facts that have come out, build their narratives and more.”transcript, stated

data-quality-loop (fact correction)

The pipeline corrects ambiguous facts such as PT/patient into named entities so downstream AI can use them reliably.

“we correct the fact as we go through that pipeline. We say Rowan McNamee”transcript, stated

Tradeoffs

How to make legal AI reliable.

Chose Process-heavy fact manufacturing over Generalized direct LLM answers.

Rationale: The specialized pipeline preserves legal nuance and evidence at the cost of being less general and more process-heavy.

“it's incredibly process heavy and it's not a generalized task, it's very specific.”transcript, stated

Where to use RAG or agentic workflows.

Chose After constructing a trusted fact layer over Using RAG or agents directly on the documents.

Rationale: Mary says direct RAG or agentic extraction is not good enough for legally meaningful fact extraction.

“we couldn't use what most people can, which is retrieval-augmented generation or agentic workflows to just go into the documents”transcript, stated

Gotchas (what bit them)

LLM compression removes legal meaning before downstream reasoning begins.

Root cause: Document processing collapses pages into images, text, tokens, embeddings, chunks, and summaries.

Resolution: Preserve and structure legal facts before using LLM-based downstream tools.

“Once it's turned that document into text, it then ultimately turns it into tokens and then into embeddings”transcript, stated

Legal facts are not equivalent to extracted strings.

Root cause: A fact may require disambiguating names, dates, relevance, fragmented mentions, conflicts, and provenance.

Resolution: Use a process-heavy fact model and manufacturing pipeline.

“What kind of document did it come from? If this is for example, a primary document”transcript, stated

A seemingly perfect generated legal document is not enough.

Root cause: Attorneys have obligations to verify facts and confidence before acting for clients.

Resolution: Design for fact review, evidence drill-down, and lawyer confidence rather than final-answer delivery.

“They actually need to feel really confident about those facts and the narrative that they're going to present”transcript, stated

Evaluation

Mary evaluates the platform through lawyer verification of facts, provenance drill-down, review-time reduction, customer adoption among large firms, and NPS.

Metrics: 75-85% document-review time reduction · 96/100 NPS · Evidence page/location drill-down · Fact relevance rationale · Customer adoption among large law firms

“I'm able to dive deeper if I think it might have some relevance. You can see I can pull up the actual document on the exact page and space”transcript, stated
“Across all of our customers, we have achieved a 75 to 85% reduction in time spent”transcript, stated

Outcomes

The source describes global law-firm adoption, large document corpora such as 4,000 documents, review reduced from hours/days to minutes for case grip, and customer metrics across all customers.

“so anyone can get a firm grip on a case in minutes, even if they've never seen it before.”transcript, stated
“The platform is being used by many of the largest law firms in Australia, including A&O Shearman (one of the largest law firms globally with presence in Australia, UK, and elsewhere).”summary, stated