LawMind is an AI-powered legal document analysis platform that helps legal professionals and businesses analyze, understand, and assess legal documents with advanced risk scoring and summarization capabilities.
- Document Upload: Upload PDF or TXT legal documents for analysis
- Clause Extraction: Automatically identify and classify legal clauses
- Smart Summarization: AI-generated summaries of complex legal documents
- Risk Assessment: Real-time risk scoring (0-100) with visual dashboard
- Key Point Identification: Extract important terms and conditions
- Actionable Recommendations: Get specific advice based on document content
- Responsive UI: Modern, user-friendly interface with real-time feedback
- Cerebras API: Legal clause extraction and classification
- Meta Llama 3: Document summarization and risk scoring
- Dynamic Analysis: Content-aware risk assessment based on document length and keywords
- Real-time Processing: Instant analysis and visualization of results
- Next.js 15 - React framework for production-ready applications
- TypeScript - Strongly typed programming language
- Tailwind CSS - Utility-first CSS framework
- Responsive Design - Works on all device sizes
- FastAPI - Modern, fast web framework for building APIs
- Python 3.12 - Programming language
- Uvicorn - ASGI server implementation
- Pydantic - Data validation and settings management
- Cerebras API - Legal clause extraction
- Meta Llama 3 - Document summarization and risk scoring
- Docker - Containerization platform
- Docker Compose - Multi-container Docker applications
lawmind/
├── backend/ # FastAPI backend service
│ ├── routes/ # API endpoints
│ ├── services/ # AI service integrations
│ └── main.py # Application entry point
├── frontend/ # Next.js frontend application
│ ├── app/ # React components and pages
│ └── public/ # Static assets
├── docker/ # Docker configuration files
└── documents/ # Sample legal documents
- Python 3.12+
- Node.js 18+
- Docker (optional, for containerized deployment)
- Cerebras API key
- Meta Llama 3 API key
-
Clone the repository:
git clone <repository-url> cd lawmind
-
Backend Setup:
cd backend # Copy the example environment file and configure your API keys cp .env.example .env # Edit .env file with your actual API keys pip install -r requirements.txt python main.py
-
Frontend Setup:
cd frontend npm install npm run dev -
Access the Application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
Create a .env file in the backend directory with the following variables:
CEREBRAS_API_KEY: Your Cerebras API key for clause extractionLLAMA_API_KEY: Your Meta Llama 3 API key for summarizationSECRET_KEY: Secret key for JWT token generationDEBUG: Set to True for development, False for production
Note: The .env file is ignored by Git to protect your API keys. Never commit actual API keys to the repository.
# Build and start services
docker-compose up --build
# Stop services
docker-compose downLawMind provides comprehensive risk analysis for legal documents:
- Dynamic Risk Scoring: Risk scores (0-100) based on document content
- Risk Level Classification: Automatically categorized as Low, Medium-Low, Medium, High, or Very High
- Content-Aware Analysis: Different analysis for short, medium, and long documents
- Keyword Detection: Identifies specific legal terms (confidentiality, liability, termination, etc.)
- Visual Dashboard: Color-coded risk visualization with progress indicators
- Key Points Extraction: Important terms and conditions highlighted
- Actionable Recommendations: Specific advice based on document complexity
- Contract Review: Quickly analyze contracts for key terms and risks
- Due Diligence: Assess legal documents during business transactions
- Compliance Checking: Identify potential compliance issues
- Legal Research: Extract and classify clauses for further analysis
- Risk Management: Evaluate potential legal risks before signing agreements
Backend API (http://localhost:8000)
POST /upload/- Upload and process legal documentsPOST /extract/- Extract and classify legal clausesPOST /summarize/- Generate document summary with risk scoringPOST /analyze/- Comprehensive document analysis
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Cerebras for providing the legal clause extraction API
- Meta for the Llama 3 language model
- The open-source community for the tools and libraries used in this project
For support, please open an issue on the GitHub repository or contact the development team.