Inspiration
Startups sign contracts constantly. NDAs, SaaS agreements, vendor terms, employment agreements.
Most founders don’t fully understand what they’re signing. Legal review is expensive, slow, and often skipped entirely.
I wanted to build an AI system that makes contract intelligence accessible in seconds.
Contracts are structured risk documents. Each clause carries probabilistic downside:
$$ Risk \approx Probability(event) \times Impact(event) $$
Lexora was built to identify those risks automatically and explain them clearly.
If Stripe made payments programmable, I want to make legal reasoning programmable.
What it does
Lexora is an AI-powered contract copilot that:
- Analyzes uploaded contracts instantly
- Flags risky clauses (indemnification, liability caps, auto-renewals)
- Explains complex legal language in plain English
- Summarizes key obligations and timelines
- Highlights missing protections
Instead of reading 20 pages manually, users get structured intelligence in seconds.
How I built it
Frontend
- Next.js + TypeScript
- Clean document upload + analysis UI
- Structured risk dashboard
Backend
- Node.js API layer
- PostgreSQL + Prisma ORM
- Document parsing pipeline
AI Layer
- OpenAI API for clause extraction + reasoning
- Retrieval-Augmented Generation (RAG)
- Risk classification system
- Structured JSON schema outputs for reliability
Each document is converted into clause embeddings:
$$ Document \rightarrow Clauses \rightarrow Embeddings \rightarrow Risk\ Classification $$
This allows Lexora to perform targeted legal reasoning instead of generic summarization.
Challenges I ran into
1. Hallucination risk
Legal AI must be precise. I mitigated hallucinations by enforcing structured outputs and grounding responses in extracted clauses.
2. Clause variability
Legal language varies wildly across contracts. Building robust clause classification required schema refinement and prompt iteration.
3. Balancing simplicity and depth
Users want fast insights, but legal nuance matters. I optimized for clarity without oversimplifying.
Accomplishments that I'm proud of
- Built a working contract analysis pipeline
- Implemented clause-level risk detection
- Structured legal reasoning into reliable outputs
- Created an intuitive risk dashboard
- Deployed an end-to-end AI legal assistant
Most importantly: Lexora reduces contract review time dramatically.
What I learned
- AI systems perform best when constrained by structure.
- RAG significantly improves reliability over naive prompting.
- Legal reasoning benefits from clause-level granularity.
- Clear UX is as important as strong models.
Contracts are not just text. They’re risk graphs:
$$ Contract = \sum_{clauses} Risk_i $$
What's next for Lexora
- Fine-tuned legal domain model
- Deeper risk scoring engine
- Redline suggestions
- Multi-document comparison
- Collaboration tools for teams
Long term, Lexora aims to become the default AI legal copilot for startups and SMBs.
Built With
- next.js
- node.js
- openai-api-(gpt-models)
- postgresql
- prisma-orm
- rest-apis
- retrieval-augmented-generation-(rag)
- typescript
- vector-embeddings
Log in or sign up for Devpost to join the conversation.