Inspiration
We've all been there — staring at a rental lease or a freelance contract, nodding along like we understand every clause, when really we have no idea what we're agreeing to. Hiring a lawyer to check a simple contract can cost hundreds of dollars, which just isn't realistic for most renters, freelancers, or first-time employees. We wanted to build something that gives everyday people a fighting chance before they sign on the dotted line — for free.
What it does
LexLens AI lets you upload a contract (PDF or pasted text) and get back a clear, color-coded breakdown of what's actually risky in it. Every flagged clause shows the exact sentence from your document, a plain-English explanation of what it really means for you, and a suggested counter-negotiation you can literally copy and send. We also added support for Telugu and Hindi, with audio playback, so the tool isn't limited to people who read English comfortably.
How we built it
The backend runs on FastAPI. We built a hybrid detection system — first, a local pattern matcher checks contract text against 27 known risky-clause patterns pulled from real legal datasets (CUAD, UnfairToS, and MAUD), catching common issues instantly with zero AI cost. Anything the patterns don't recognize gets sent to an LLM (we use Groq and Gemini, with multiple API keys rotating automatically to avoid rate limits). The frontend is a single-page interface that talks to the backend, renders the findings as risk cards, and uses the browser's built-in speech API for the audio playback. Everything is deployed together as one service.
Challenges we ran into
Getting the hybrid pipeline right took a few iterations — we had bugs where our own pattern-matching regex was silently breaking on legal punctuation, which we only caught because our own tests flagged inconsistent results. Multilingual support brought its own challenge: we had to be careful that only the plain-English explanations got translated, never the actual contract quote, since that has to stay exactly as written for legal accuracy. We also hit some frustrating deployment issues getting Railway to correctly find and serve both our backend and frontend folders together.
Accomplishments that we're proud of
We're proud that this isn't just a mockup — every part of it actually works end-to-end, from a real PDF upload to a real AI-generated explanation. We're especially proud of the multilingual + audio feature, since it turns this from "another AI tool for English speakers" into something that could genuinely help someone who can't read English, or can't read at all, understand what they're about to sign.
What we learned
We learned a lot about designing AI systems that don't just throw everything at an LLM — building the pattern-matching layer taught us how to balance cost, speed, and reliability. We also learned how much attention multilingual accuracy requires, especially when legal text is involved, since a mistranslation could genuinely mislead someone.
What's next for LexLens AI
We'd like to expand language support beyond Telugu and Hindi, add more clause patterns from additional legal datasets, and explore letting community organizations (like tenant unions or legal aid groups) contribute verified patterns of their own. We'd also like to build out a proper document history feature for people who want to track multiple contracts over time.
Built With
- ai
- cuad-dataset
- fastapi
- gemini-api
- groq
- html
- javascript
- legal-tech
- natural-language-processing
- pdfplumber
- python
- railway
- speechsynthesis-api
- tailwindcss
Log in or sign up for Devpost to join the conversation.