[02]
One agent per document type
A classifier routes contracts, filings and correspondence to dedicated extraction agents. Each path has its own tools and validation schema for the fields that document type should contain.
A consumer legal platform for drafting, review, signing, obligation tracking and access to regulated solicitors. I built five modules end to end.

[01] The problem
Legal teams lose hours to reading, extracting, and reformatting the same document types. Generic LLM chat wasn’t accurate enough to trust with legal text — it hallucinated citations and lost document context.
[02] The constraints
A fluent but incorrect clause can create legal risk. The system had to ground claims in the user’s document and jurisdiction, making retrieval quality more important than a larger prompt.
Drafting, review and extraction cost per call and are sold as credits. Accuracy improvements had to justify their effect on unit economics.
Drafting, review, signing and obligation tracking have real dependencies. The interface could simplify the sequence but not remove its controls.
[03] The approach
The solution combined structure-preserving retrieval with document-specific extraction agents. Around that pipeline, I added credit metering and a single working surface for a legal flow a non-lawyer could complete.
* RETRIEVAL THAT KEEPS THE DOCUMENT SHAPE
[04] The trade-offs
[01]
[02]
[03]
[05] The build
[01]
Documents are chunked by section, clause and sub-clause, with ancestry attached to every chunk. Retrieved passages keep their meaning and no longer require the model to infer missing context.
[02]
A classifier routes contracts, filings and correspondence to dedicated extraction agents. Each path has its own tools and validation schema for the fields that document type should contain.

[03]
Pathways models each legal matter as ordered actions on a React Flow canvas, from drafting and waiting periods to AI steps, services and court forms. Users can see the current step and its dependencies.

[04]
After multi-party signing, the platform extracts notice periods, renewal windows and payment deadlines from the executed document so commitments remain actionable.

[05]
Extracted obligations become calendar entries with tasks, notes and reminders. The dashboard leads with overdue and upcoming work.

[06]
A priced services catalogue lets users order regulated legal work when AI is insufficient. Each service has a fixed fee plus VAT, jurisdiction is explicit, and the platform clearly states that it is not a law firm.
[06] The result
95%
Extraction accuracy
* on the evaluated set, Jan 2026
100+
Files / month
* in production, at handover
-30%
Manual document work
* reported by users, Jan 2026
50+
Active users
* legal professionals, Jan 2026
The 95% is exact-match accuracy on the evaluated set, not every accepted document type, and that set was too small; the reflection below covers why. The −30% is user-reported rather than instrumented. File and active-user counts are platform records from January 2026.
[07] What I’d do differently
I’d build the evaluation harness before the pipeline. Tuning by feel delayed clear decisions until a scored regression set existed.
Written by Faizan Amir
Role on Golegal: Full-Stack & AI Engineer — five modules, end to end
Last reviewed
Need something like this built?
Next case study [04]
Alfa
Multi-Role Fintech Platform
Read the case study →