[CASE STUDY 03]

Golegal AI Legal Workspace

A consumer legal platform for drafting, review, signing, obligation tracking and access to regulated solicitors. I built five modules end to end.

Role
Full-Stack & AI Engineer — five modules, end to end
Timeline
Dec 2024 – Jan 2026
Status
Live
Stack
Nest.js, Next.js, PostgreSQL +4
The Go Legal AI document editor: a confidentiality agreement open with track changes, beside the Copilot review panel showing traffic-light analysis, a document health score and the individual clause findings behind it

Golegal: cover

[AT A GLANCE]

OWNED
Five modules end to end: document creation and RAG · e-signature and obligation extraction · legal pathways · tasks, calendar and notes · the services marketplace
ALSO BUILT
Payments and the token-metered usage module the paid plans run on
NOT MINE
The legal content and the regulated advice — Go Legal Ai is not a law firm, and the services are delivered by independent regulated firms
PRODUCT
Free · Power Up £19/mo · Pro £49/mo, metered in AI credits per action
REACH
England & Wales for instructed services; document generation across 150+ jurisdictions

[STACK]

  • Nest.js
  • Next.js
  • PostgreSQL
  • OpenAI
  • Agentic RAG
  • React Flow
  • Plate.js

[01] The problem

Generic chat can’t be trusted with legal text

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

Why a better prompt was never the answer

  1. Plausible is not good enough

    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.

  2. Every AI action costs real money

    Drafting, review and extraction cost per call and are sold as credits. Accuracy improvements had to justify their effect on unit economics.

  3. The legal steps cannot be skipped, only made lighter

    Drafting, review, signing and obligation tracking have real dependencies. The interface could simplify the sequence but not remove its controls.

[03] The approach

How it was built

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.

[KEY DECISIONS]

  1. [01]Chunked documents by clause hierarchy so retrieved passages retain their context.
  2. [02]Routed document types to dedicated agents with focused tools and validation schemas.
  3. [03]Modelled legal matters as pathway graphs of drafts, AI steps, services and court forms.
  4. [04]Extracted dated obligations from signed documents into the user’s calendar.
Golegal agentic RAG pipeline: documents chunked along their own clause hierarchy so each chunk keeps its ancestry, embedded into PostgreSQL, retrieved with that context intact, then routed by a classifier to a per-document-type agent with its own tools and validation schema

* RETRIEVAL THAT KEEPS THE DOCUMENT SHAPE

Golegal: Retrieval that keeps the document shape

[04] The trade-offs

What accuracy cost

  1. [01]

    Sell AI work as credits, priced per action

    Instead of
    One flat unlimited subscription, the way most SaaS is sold
    What it cost
    Customers must understand credits, and plan pages must explain each action’s price.
    What it bought
    Usage stays tied to model cost, protecting margins without making light users subsidise heavy ones.
  2. [02]

    Tune retrieval for precision, not coverage

    Instead of
    Retrieve generously and let the model decide what is relevant
    What it cost
    Chunking and routing require more work, and an occasional relevant passage may not surface.
    What it bought
    Fewer confident but misleading answers, the more dangerous failure in legal text.
  3. [03]

    One working surface for drafting, review and signing

    Instead of
    A wizard with a page per step, which is easier to build and easier to reason about
    What it cost
    One screen carries more state and requires stricter component boundaries.
    What it bought
    Users remain in the document instead of crossing multiple abandonment points.

[05] The build

The five modules

  • [01]

    Retrieval that keeps the document’s shape

    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.

Golegal: a classifier routes each document to a dedicated agent for contracts, filings or correspondence; each agent has its own tools and validation schema and draws on clause-aware retrieval; validated fields feed the editor and review, and signed documents feed obligations into the calendar; every AI action is metered in credits

One agent per document type

[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.

The Legal Pathway builder: a React Flow canvas with a Start node branching into an action, a smart template, an asset-tracing service, an AI step and a court form, connected by dependency edges

Legal pathways, as a graph you can see

[03]

Legal pathways, as a graph you can see

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.

A fully signed document in Go Legal AI showing both signers with timestamps, alongside the Extract obligations action and the signing certificate

Signature, and what the signature commits you to

[04]

Signature, and what the signature commits you to

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

The Tasks and Deadlines module: a calendar view with counters for upcoming deadlines, pending and overdue tasks, and reminders, plus notes and integrations tabs

The deadlines the documents created

[05]

The deadlines the documents created

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

The Legal Services catalogue: fifteen priced services across consultation, contracts, disputes, document services, intellectual property, investigations and property, each with a fixed fee plus VAT

When the AI is not enough, order a person

[06]

When the AI is not enough, order a person

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

What Golegal measured

  • 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

[HOW THESE WERE MEASURED]

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

Honestly

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]

Multi-Role Fintech Platform

Read the case study →

AVAILABLE FOR SENIOR ENGINEERING WORK + REACT + NEXT.JS + NODE.JS + PYTHON + RAG + AGENTIC AI