LegalMind AI is a comprehensive, enterprise-grade multi-document legal assistant designed to demystify complex legal documents. Built on a robust, service-oriented architecture, the platform combines a high-performance backend with a modern, responsive frontend to deliver unparalleled accuracy and insights in legal document analysis.
- Intelligent Document Processing: Automatically extracts content, identifies clauses, and assesses risk across various document types.
- Advanced Conversational AI: Features context-aware, multi-document chat functionality with accurate source citations and professional response synthesis.
- Dynamic Insights Generation: Generates concise document summaries, text-to-speech audio overviews, and structured PDF reports.
- Cross-Document Analytics: Maps relationships between multiple documents and provides aggregated risk assessments.
- Enterprise-Grade Infrastructure: Powered by 14 specialized microservices handling tasks ranging from chunking and real-time processing to secure storage management.
The platform is logically partitioned into two primary components:
The user interface is built as a single-page application focused on providing a seamless, desktop-class experience in the browser.
- Technologies: React 18, TypeScript, Vite, Tailwind CSS.
- Features: Split-screen authentication, interactive dashboard, multi-document chat interface with contextual sidebars, and real-time rendering of document insights.
- State Management: TanStack React Query handles server state caching and synchronization, ensuring a responsive interface without redundant network requests.
- Documentation: For detailed setup and development instructions, refer to
Frontend/README.md.
The intelligence engine is built on a high-performance Python framework, heavily utilizing asynchronous programming to manage concurrent processing workloads.
- Technologies: Python 3.10+, FastAPI, Google Cloud Platform (Document AI, Storage, Vertex AI/Gemini, Text-to-Speech).
- Features: Asynchronous document parsing, semantic chunking, secure signed-URL generation for direct-to-cloud uploads, and a highly modular service registry.
- Data Persistence: Currently leverages a synchronized local JSON data store (
legalmind_db.json), designed to easily transition to a robust NoSQL/SQL database in production. - Documentation: For detailed setup and development instructions, refer to
Backend/README.md.
- Node.js v18 or higher
- Python 3.10 or higher
- A Google Cloud Platform account with a provisioned Service Account containing required permissions.
- Navigate to the
Backenddirectory. - Copy
.env.exampleto.envand populate your Google Cloud credentials and API keys. - Install dependencies using
pip install -r requirements.txt. - Run the server using
python main.pyorpython3 main.py.
- Navigate to the
Frontenddirectory. - Copy
.env.exampleto.envand populate your Firebase credentials and API URL. - Install dependencies using
npm install. - Start the development server using
npm run dev.
- Data Isolation: User data and chat histories are isolated using X-User-ID headers and strict backend validation.
- Direct Cloud Uploads: The system utilizes Google Cloud Storage V4 Signed URLs to facilitate secure, temporary upload channels directly from the client to the cloud, bypassing the backend to minimize bandwidth overhead.
- Uniform Bucket-Level Access: The backend securely proxies authenticated requests to GCP to retrieve documents and generated audio files, maintaining strict compliance with bucket-level security policies.
Ensure you maintain the strict separation of concerns between the frontend presentation logic and the backend processing pipelines. Always use the generated .env.example files as a baseline for configuring new environments. Code modifications must adhere strictly to the established architectural patterns and typing standards.