WHAT IT DOES ClearPath turns any legal document into something a person can actually understand. Upload a lease, employment contract, loan agreement, or terms of service — and in under 10 seconds, ClearPath delivers: Plain-English Clause Breakdown — Every clause in the document is extracted, labeled by type (Payment, Termination, Liability, Privacy, etc.), and rewritten at an 8th-grade reading level. A side-by-side view shows the original legal text next to the simplified version, so you always know exactly what you're reading. Red Flag Detector — ClearPath automatically identifies clauses that are statistically unusual, legally risky, or heavily favor the other party. Each red flag includes a plain-English explanation of what it means, why it matters to the person signing, and the specific question to raise with the other party before signing. Flags are severity-rated: Minor, Review Before Signing, or Serious — Seek Legal Advice. Risk Score Dashboard — An overall fairness score from 0 to 100, with breakdowns across four categories: Payment Risk, Privacy Risk, Exit Risk, and Liability Risk. Color-coded indicators make the risk immediately legible without any legal knowledge required. Document Q&A Chat — Ask any question in plain English and get an answer grounded strictly in the uploaded document. "Can they raise my rent without notice?" "What happens if I leave early?" "Do they own work I create on my own time?" ClearPath cites the exact clause it's drawing from in every answer.
THE PROBLEM WE SOLVE 78% of Americans have signed a legal document they didn't fully understand (ABA survey). The average lease is written at a 14th-grade reading level. The average American reads at an 8th-grade level. That gap has real consequences:
Renters unknowingly sign leases with illegal clauses or terms that waive their rights Gig workers accept employment contracts with non-compete traps that cost them future income First-gen immigrants and non-native speakers sign agreements in their second language with no comprehension aid Consumers agree to loan terms with compounding penalty structures buried in dense legalese
Legal aid is inaccessible for most people — $200–$500/hr minimum, long wait times, limited scope. General AI tools like ChatGPT can explain text, but they provide no structure, no risk scoring, no purpose-built interface, and no guarantee the answer is grounded in the actual document. ClearPath fills that gap. It's the legal literacy tool that everyone needs but almost no one has had access to — until now.
HOW WE BUILT IT Frontend: Next.js 15 (App Router) + TypeScript + Tailwind CSS. Drag-and-drop PDF upload, real-time streaming clause cards, animated risk gauge, side-by-side clause viewer, and integrated chat panel. Backend: FastAPI (Python) handling document ingestion, AI orchestration, and SSE streaming. Document Parsing: PyMuPDF for PDF text extraction, with regex-based clause segmentation that handles numbered sections, paragraph breaks, and structural legal formatting. AI Pipeline: A multi-stage Anthropic Claude pipeline:
Each clause segment is sent to Claude with a structured prompt requesting: clause type classification, plain-English simplification, red flag assessment with severity 1–3, and key term extraction — all returned as structured JSON. All clause-level risk assessments are aggregated and sent to a second Claude call that synthesizes the overall risk score with category breakdowns. User questions are answered using RAG: the question is embedded, matched against ChromaDB-indexed clause chunks, and the top 3 relevant chunks are injected into Claude's context with strict grounding instructions.
Streaming: Server-Sent Events deliver clause analysis results to the frontend in real time as each clause is processed — no waiting for the full document to be analyzed before results appear. Vector Store: ChromaDB for document chunk indexing and semantic search, enabling the grounded Q&A feature. Deployment: Vercel (frontend) + Railway (FastAPI backend).
CHALLENGES WE RAN INTO Clause segmentation is harder than it looks. Legal documents vary enormously in structure — some use numbered sections, some use paragraph breaks, some have no clear delimiters at all. We built a multi-strategy segmenter that tries numbered-section splitting first, falls back to paragraph boundary detection, and merges short fragments with their neighbors to ensure every chunk has enough context for meaningful analysis. Keeping Claude grounded in Q&A. Without strict prompt engineering, the model would supplement document answers with outside legal knowledge — which could be wrong for the specific jurisdiction or contract. We solved this with explicit system instructions and RAG-constrained context that prohibits the model from drawing on anything outside the provided chunks. Making risk scores meaningful, not arbitrary. A single number means nothing without context. We iterated on the category breakdown — Payment, Privacy, Exit, Liability — until it reflected the dimensions that actually matter to the person signing the document, not abstract legal dimensions.
ACCOMPLISHMENTS WE'RE PROUD OF We built a complete, working, production-deployable legal document analysis tool in under 24 hours — with real AI analysis, streaming output, semantic search, and a polished UI that any person could pick up and use without instructions. More importantly: we tested it on real leases and contracts with known predatory clauses, and it caught every single one. The red flag detector correctly identified an illegal no-notice entry clause, a mandatory arbitration waiver, an auto-renewal trap with penalty, and a unilateral amendment clause — in four different document types — with accurate severity ratings and actionable guidance. That's not a demo trick. That's the tool working as intended.
WHAT WE LEARNED Legal documents are dense, but their risk patterns are actually highly predictable. The same clause archetypes — arbitration waivers, unilateral amendment rights, penalty traps — appear across lease agreements, employment contracts, and consumer terms of service. That predictability makes AI-powered risk detection extremely viable. We also learned that streaming output is not just a UX nicety for this use case — it's essential. A 30-clause lease takes 45–60 seconds to fully analyze. Without streaming, users would see a blank loading screen and abandon the session. With streaming, they watch results appear clause by clause and stay engaged the entire time.
WHAT'S NEXT FOR CLEARPATH Multilingual output — Spanish, French, Arabic, and Hindi translations of the simplified clause text and red flag explanations. Many of the people who need this tool most are non-native English speakers. Comparison mode — Upload two versions of the same contract (e.g., an original and a revised draft) and see exactly what changed, highlighted and explained. Negotiation suggestions — For each red flag, auto-generate counter-proposal language that the user can send back to the other party. Browser extension — Analyze any Terms of Service page directly in the browser without leaving the site. API for legal aid organizations — Make ClearPath's analysis available to tenant advocacy groups, non-profit legal clinics, and immigrant services organizations that work with the populations who need this most.
Built With
- 15
- anthropic
- chromadb
- claude
- css
- events
- fastapi
- next.js
- pymupdf
- python
- railway
- server-sent
- tailwind
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.