Inspiration
Most people sign legal documents they don’t fully understand — leases, freelance contracts, NDAs, and terms of service are often written for lawyers, not the people bound by them. I’ve personally stared at contracts wondering, “Is this normal, or am I getting screwed?”
Legal review is expensive, and not everyone can afford a lawyer for every agreement. PlainLegal was built to give regular people a fighting chance: a tool that reads the fine print and explains, in plain English, what a document actually says — and where the risks are hiding.
What it does
PlainLegal analyzes legal documents — leases, contracts, NDAs, and terms of service — and breaks them into clear, human-readable insights.
- For each document, the app provides:
- Plain English translations of complex legal clauses
- Risk flags with severity ratings (low, medium, high, critical)
- Key legal terms explained in simple language
- An overall risk score for quick evaluation
After the initial analysis, users can ask follow-up questions in a chat interface (e.g., “Can I negotiate this clause?” or “What happens if I terminate early?”). The AI responds based on the actual content of the uploaded document.
To lower friction, the app also includes sample legal documents so users can try the experience immediately.
How we built it
PlainLegal uses a modern full-stack architecture:
- Frontend: React + TypeScript
- Backend: Express.js
- Database: PostgreSQL
- AI engine: DigitalOcean Gradient AI with Llama 3.3 70B Instruct (OpenAI-compatible API)
- UI: Tailwind CSS + Framer Motion
Core flow:
- User uploads a legal document
- Backend sends the text to Gradient AI
- The model returns structured JSON containing:
- clause translations
- risk flags
- key terms
- overall risk assessment
- Output is validated with strict Zod schemas
- Results are stored and rendered in the UI
- Follow-up chat sends user questions plus document context back to Gradient AI
Special attention was given to keeping the UI clean and non-intimidating for non-lawyers, with dark mode, smooth animations, and a layout that keeps the analysis front and center.
Challenges we ran into
- Structured JSON reliability Legal documents vary widely in format and length, and the model occasionally returned malformed or inconsistent JSON. This was mitigated through:
- strict Zod schema validation
- tighter prompt engineering
- defensive parsing strategies
- Context window management Long documents combined with chat history can exceed model limits. To maintain reliability, we implemented truncation strategies for both:
- document text
- chat history This preserved important context while keeping requests within limits.
Accomplishments that we're proud of
Built a full end-to-end legal analysis pipeline powered by Llama 3.3 70B
- Achieved consistent structured outputs using Zod validation
- Delivered risk detection that surfaces subtle contractual red flags
- Created a clean, approachable UX for non-lawyers
- Implemented document-aware follow-up chat grounded in the user’s actual contract
- Shipped sample documents for instant user onboarding
Most importantly, PlainLegal turns intimidating legal text into something everyday people can actually understand.
What we learned
Working with DigitalOcean Gradient AI was smoother than expected — the OpenAI-compatible API made integration straightforward, and Llama 3.3 70B performs strongly on legal analysis, often catching subtle risks a casual reader would miss.
We also learned that for legal AI tools, trust > raw capability. The difference between “it works” and “users believe it” is huge. Clear risk ratings, transparent explanations, strong validation, and follow-up Q&A all significantly improve user confidence.
What's next for PlainLegal
Planned improvements include:
- Side-by-side contract comparison (original vs. amended)
- Exportable analysis reports for lawyers
- Saved document library with search
- Multi-language support
- PlainLegal’s goal is to become the default “second brain” people use before signing anything important.
Built With
- digitalocean-gradient-ai
- express.js
- llama-3.3-70b
- postgresql
- react
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.