Saral Vakeel is an advanced AI-powered legal assistant designed to simplify complex legal documents for everyone. It leverages cutting-edge Retrieval-Augmented Generation (RAG) technology to analyze files, highlight risks, and answer specific questions with precise page citations all wrapped in a modern, responsive interface.
- 📄 Intelligent Document Analysis: Leverages Google Cloud Document AI for high-accuracy OCR and extracting key metadata including summaries, risk factors, and obligations using Google Gemini 2.5 Flash.
- 💬 RAG-Powered Chat: Ask questions about your uploaded documents and get accurate answers grounded in the text, complete with citations and source highlighting.
- ⚡ Real-Time Processing: Fast PDF ingestion, text chunking, and vector embedding generation.
- ☁️ Enterprise-Grade Scalability: Backend deployed on Google Cloud Platform (GCP), ensuring high availability and the ability to handle massive document workloads effortlessly.
- 🎨 Modern UI/UX: A sleek, accessible interface built with Next.js 15 and Tailwind CSS, featuring dark mode support and interactive background animations.
- 🔍 Precise Citations: Pinpoints the exact page and paragraph where an answer is found.
- 🔒 Secure Storage: Utilizes Supabase for secure file storage and vector database management.
- Framework: Next.js 15 (React 19)
- Styling: Tailwind CSS 4
- Animations: Framer Motion
- Icons: Lucide React
- State/Data: Axios, SWR (implied)
- Framework: FastAPI (Python)
- Cloud Provider: Google Cloud Platform (GCP) (Serverless/Scalable Deployment)
- Document Processing: Google Cloud Document AI (Intelligent OCR & Data Extraction)
- AI/LLM: Google Gemini (Flash 2.5 for Chat & Embedding-004 for Vectors)
- Orchestration: LangChain
- PDF Processing:
pdfplumber
- Vector Store: Supabase (pgvector)
- Authentication & Storage: Supabase Auth & Storage
Before running the project, ensure you have the following installed:
- Node.js (v18 or higher)
- Python (v3.10 or higher)
- Supabase Account (for database and storage)
- Google Cloud API Key (with Gemini API access)
git clone https://github.com/yourusername/saral-vakeel.git
cd saral-vakeelNavigate to the backend directory and set up the Python environment.
cd backend
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# Mac/Linux:
# source venv/bin/activate
pip install -r requirements.txtCreate a .env file in the root directory (parent of backend) with the following credentials:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
GOOGLE_API_KEY=your_google_gemini_api_keyNavigate to the frontend directory and install dependencies.
cd ../frontend
npm installCreate a .env.local file in the frontend directory:
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_keyFrom the backend directory (with venv activated):
uvicorn main:app --reloadThe backend API will run at http://localhost:8000.
From the frontend directory:
npm run devThe application will be available at http://localhost:3000.
c:\laww\
├── backend/
│ ├── main.py # Main FastAPI application & RAG logic
│ ├── requirements.txt # Python dependencies
│ └── ...
├── frontend/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # React components (Chat, Upload, Visuals)
│ ├── lib/ # Utility functions (Supabase, API)
│ ├── public/ # Static assets
│ └── ...
├── README.md # Project documentation
└── .env # Backend environment variables
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License.
