AI-Powered Contract Analyser
The Problem
Legal teams and founders spend hours manually reviewing contracts — NDAs, SaaS agreements, employment contracts — looking for risky clauses, unusual terms, and missing provisions. Junior team members often miss nuance; senior lawyers are expensive. Neither option scales.
The goal was a SaaS tool that could read any contract, extract structured information, flag risks in plain English, and surface questions the user should be asking their lawyer — in under 60 seconds.
Why a Long-Context Model
Contract analysis is a perfect fit for a long-context, strong-instruction-following model. A typical NDA runs 3,000–8,000 tokens; a complex MSA can be 40,000+. The model handles the full document in a single pass, maintaining coherent reasoning across the entire contract — whereas chunked approaches lose cross-reference context.
Reliability at following structured output schemas (returning valid JSON) without extensive prompt engineering was also critical for the data pipeline. The LLM layer is swappable — this isn't a single-provider dependency, just the model that best suited these constraints at build time.
Core Features
Technical Architecture
- Next.js App Router — server components for the analysis pipeline, client components for the interactive review UI. Streaming responses keep the UI live during long analyses.
- Supabase — Postgres for user data and analysis results, storage for uploaded PDFs, Auth for multi-tenant SaaS. Row-level security ensures users only access their own documents.
- Structured outputs — the model is prompted to return a typed JSON schema (TypeScript types shared between client and server via a shared package). Zod validates at runtime.
- PDF parsing — PDF.js on the client for rendering; pdf-parse server-side for text extraction. Scanned documents fall back to Textract OCR via AWS.
Outcome
Launched as a private beta to 120 users — primarily startup founders, freelancers, and small law firms. Retention at 30 days was 64%. Users report saving an average of 2–3 hours per contract review. Paid plan conversion at 18%.