Making legal documents understandable for everyone
LegalEase AI is an intelligent document analysis platform that transforms complex legal documents into plain-English summaries with risk assessments. Upload your contracts, agreements, or legal documents and get instant AI-powered insights.
LegalEase AI leverages advanced AI technology to:
- Extract text from PDF and TXT documents
- Generate comprehensive summaries in bullet points
- Assess risk levels (Safe, Moderate, High)
- Identify specific risk factors with explanations
- Provide interactive chat for document-specific questions
Perfect for individuals, small businesses, and anyone who needs to understand legal documents without hiring expensive lawyers.
https://legal-ai-peach.vercel.app/
- Multi-format Support: PDF and TXT file uploads (up to 2MB)
- Advanced Text Extraction: Multiple extraction methods for maximum compatibility
- Smart Fallbacks: Handles various PDF types including complex layouts
- Plain-English Summaries: Complex legal jargon translated to understandable language
- Risk Assessment: Automated risk level evaluation with detailed explanations
- Risk Flagging: Identifies specific clauses that need attention
- Context-Aware: Understands legal document structure and terminology
- Document Q&A: Ask specific questions about your uploaded document
- Contextual Responses: AI answers based on the analyzed document content
- Real-time Interaction: Instant responses powered by Gemini AI
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Glassmorphism Effects: Beautiful, modern interface with backdrop blur
- Smooth Animations: Framer Motion powered transitions
- Dark Theme: Easy on the eyes with professional appearance
- Next.js 15.5.3 - React framework with App Router
- React 19.1.1 - UI library
- Tailwind CSS 4 - Utility-first CSS framework
- Framer Motion - Animation library
- Lucide React - Icon library
- Next.js API Routes - Serverless backend functions
- Formidable - File upload handling
- PDF Processing:
pdf-parse
- Primary PDF text extractionpdfjs-dist
- Advanced PDF parsing fallback
- Google Gemini AI - Document analysis and chat responses
- Vercel - Hosting and deployment platform
- Edge Functions - Serverless API endpoints
- Environment Variables - Secure API key management
legalai-main/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── chat/ # Chat page
│ │ ├── privacy/ # Privacy policy page
│ │ ├── layout.js # Root layout
│ │ └── page.js # Home page
│ ├── components/ # React components
│ │ ├── ui/ # UI components
│ │ │ ├── Navbar.jsx # Navigation component
│ │ │ └── resizable-navbar.jsx
│ │ ├── chat.jsx # Main chat interface
│ │ ├── Hero.jsx # Landing page hero
│ │ ├── Footer.jsx # Footer component
│ │ └── ... # Other components
│ ├── lib/ # Utility functions
│ │ ├── utils.js # General utilities
│ │ └── pdfReader.js # PDF processing utilities
│ └── pages/api/ # API routes
│ ├── extract.js # Document processing endpoint
│ ├── chat.js # Chat API endpoint
│ └── analyse/ # Analysis endpoints
├── public/ # Static assets
│ ├── Logo.svg # Application logo
│ └── logo.png # Alternative logo format
├── .env.local # Environment variables (not in repo)
├── package.json # Dependencies and scripts
└── README.md # This file
- Node.js 18+
- npm or yarn package manager
- Google Gemini API key
git clone https://github.com/kritgarg/Legal-AI.git
cd Legal-AI
npm install
# or
yarn install
Create a .env.local
file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_here
Getting a Gemini API Key:
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy the key to your
.env.local
file
npm run dev
Visit http://localhost:3000
to see the application running.
npm run dev
- Runs on
http://localhost:3000
- Hot reload enabled
- Development optimizations
npm run build
npm start
npm run type-check
npm run lint
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard:
GEMINI_API_KEY
: Your Google Gemini API key
- Deploy automatically on every push to main branch
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Set environment variables
vercel env add GEMINI_API_KEY
In your Vercel dashboard, add:
GEMINI_API_KEY
: Your Google Gemini API key
Coming soon - Add screenshots of your application in action
Important Legal Notice:
- This tool provides AI-generated analysis for informational purposes only
- NOT a substitute for professional legal advice
- Always consult qualified legal professionals for important legal matters
- No attorney-client relationship is created by using this service
- Users are responsible for verifying all information
- The developers assume no liability for decisions made based on AI analysis
This project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Commit:
git commit -m 'Add amazing feature'
- Push:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting
- 🐛 Bug fixes
- ✨ New features
- 📚 Documentation improvements
- 🎨 UI/UX enhancements
- 🔧 Performance optimizations
Q: What types of documents can I upload? A: Currently supports PDF and TXT files up to 2MB. Works best with text-based PDFs rather than scanned images.
Q: Is my document data secure? A: Documents are processed temporarily and not stored permanently. However, they are sent to Google's Gemini AI for analysis.
Q: How accurate is the AI analysis? A: The AI provides helpful insights but should not replace professional legal review for important documents.
Q: Why is my PDF not being processed? A: This usually happens with scanned PDFs or image-based documents. Try using a text-based PDF or convert your document first.
Q: Can I run this locally without an API key? A: No, the Gemini API key is required for document analysis and chat functionality.
Q: How do I report a bug? A: Please open an issue on GitHub with detailed steps to reproduce the problem.
Q: How do I add a new document format?
A: Extend the file processing logic in /src/pages/api/extract.js
and update the file input accept types.
Q: Can I use a different AI model? A: Yes, modify the API endpoints to use different AI services. The current implementation uses Google Gemini.
Q: How do I customize the UI theme?
A: Edit the Tailwind CSS classes in components and update the color scheme in tailwind.config.js
.
Made with ❤️ by Krit Garg
Empowering everyone to understand legal documents through AI