Skip to content
Projects

DocuLaw AI

Frontend / June 2025

Translates dense legal contracts into plain English with a side-by-side diff view and AI chat.

  • React
  • Next.js
  • Tailwind CSS
  • TypeScript
DocuLaw AI interface

Overview

Legal documents are intentionally dense. Regular people sign things they don't understand every day - lease agreements, employment contracts, terms of service. The complexity isn't a bug, it's a feature that serves one side of the table.

I wanted to build the tool I wish existed the first time I signed a lease and had no idea what I was agreeing to. Upload any contract, get a plain-English breakdown clause by clause, with a diff view showing exactly what changed between versions.

Features

Upload any contract
PDF, DOCX, or paste raw text. The system handles formatting and structure detection.
AI parses clause by clause
Each section gets identified, categorized, and analyzed for obligations, rights, and conditions.
Plain-English breakdown
Every clause gets a human-readable summary alongside the original legal text.
Diff view for revisions
Upload two versions and see exactly what changed - additions, removals, and modifications highlighted.

Why plain English isn't enough

Early prototypes just ran each clause through a summarizer. The result was technically accurate but useless - you'd read the summary and still not understand what it means in context. A clause that says "Party A may terminate with 30 days notice" means different things depending on whether you're Party A or Party B.

The key insight was structure over simplification. The tool needs to show you how clauses relate to each other - which definitions apply where, which obligations cascade, which conditions gate other conditions.

The dashboard

The main view is a two-column layout: original legal text on the left, plain-English summary on the right. Color-coded highlighting links obligations (red), rights (green), and conditions (amber) across both columns. Clicking a clause expands the context - what other clauses reference it, what definitions apply.

Complexity as a feature

The difficulty level indicator at the top isn't decorative - it uses the Flesch-Kincaid readability score to show you how hard the original document is to read. Most contracts score at a college reading level or above. The goal isn't to hide that complexity, it's to make it navigable.

System design

Processing pipeline
  1. UploadPDF / DOCX / text
  2. Parsestructure detection
  3. Analyzeclause-by-clause AI
  4. Simplifyplain English
  5. Diffversion compare

Structure detection

The hardest part wasn't the AI summarization - it was parsing the document structure. Legal contracts use inconsistent formatting: some number clauses with Roman numerals, some with letters, some nest arbitrarily deep. The parser uses a combination of regex patterns and LLM-assisted section detection to build a reliable clause tree.

Takeaways

Went with clause-level granularity instead of paragraph-level. Finer granularity means more accurate summaries but slower processing. For a typical 10-page contract, the full analysis takes 8-12 seconds - acceptable for a tool you use a few times, not great for real-time editing.

The diff view compares at the clause level, not character level. This means it catches moved or reworded sections that a simple text diff would miss, but it can't highlight individual word changes within a clause.

Next steps

Adding support for multi-party contracts where obligations differ per signatory. Also exploring a comparison mode against standard templates - so you can see where a contract deviates from industry norms.