Case study / General Legal

Breaking down
the fine print

Years of contract work, locked in a digital filing cabinet. We turned it into a searchable clause library — and then a drafting machine.

Client
General Legal
Discipline
Applied AI · Semantic search · Document pipelines
Engagement
Startup-style R&D partnership
01 The brief

Nobody drafts from scratch

Lawyers write a lot of contracts, and they end up rewriting the same clauses over and over. General Legal was sitting on a goldmine of past deliverables — scattered, unorganized, and completely unsearchable.

Finding one clause sample meant a manual treasure hunt. Redundant work was the norm and years of hard-won language sat idle in a digital filing cabinet.

They didn't need a search bar. They needed an intelligent reading assistant — because legal teams don't draft entire contracts, they build them clause by clause. So we built for the clause, not the document.

1 100s
The ingestion ratio
One contract in. Hundreds of individually parsed, tagged, semantically searchable clauses out.
Custom one-to-many Python pipeline
02 The build

The clause deconstructor

Three moves, each one useless without the other two: take the archive apart, make every piece findable, then let the found pieces write the next draft.

/ 01

The pipeline

Historical contracts broken into individual clauses, then tagged and categorized automatically — with the model proposing the taxonomy, since there was no seed data to inherit.

Ingest · Parse · Tag
/ 02

The search app

A sleek internal portal where lawyers find the exact clause they mean by describing it — dense vector search over the whole archive, behind their existing single sign-on.

Semantic search
/ 03

The generator

Not a chatbot. Search the clauses you like, tick a few boxes, hit Generate — a fresh, context-aware draft grounded in the firm's own precedent. AI with training wheels, on purpose.

Guided UI
03 The technical ledger
The brains
Claude, via Anthropic — running the backend inference pipeline and the frontend clause generation alike.
The library
Postgres on Google Cloud for source documents, paired with Elasticsearch and Jina embeddings for dense vector retrieval.
The portal
A custom Next.js application on Vercel, wired to Google Workspace OAuth for secure, seamless login.
The integration
Model Context Protocol — so the clause library is a plug-and-play foundation for every AI tool they add next, not a dead end.

The hard part was teaching a pipeline to read like a lawyer. Contracts are wildly inconsistent — nested lists, erratic numbering, formatting from three decades of habits. Off-the-shelf connectors are one-file-in, one-document-out. We wrote a pipeline that ingests one document, works out where each clause starts and stops, and emits dozens of clean records.

04 The difference

Not a vendor. An external innovation lab.

This was a fast, startup-style R&D engagement. Instead of holding a static plan hostage, we met weekly, traded ideas, and iterated through multiple working prototypes until one clearly fit how their lawyers actually work.

We also keep our eyes open for our partners. Mid-project we spotted a security vulnerability that left them exposed to a supply chain attack. We didn't wait for an SOW amendment — we helped them patch it.

What started as a proof of concept changed how General Legal sees its own data. Manual search is obsolete, the archive is richly structured, and the MCP layer means this library feeds their internal AI ecosystem for years — not just one app.

Recommended listening
"Harder, Better, Faster, Stronger" — Daft Punk. Manual drafting, turned into an assembly line: precise, mechanical, infinitely repeatable.
Sitting on an archive nobody can search? Let's take it apart.
Book a call