⚖️ Vakil.ai: Privacy-First AI Legal Counsel

💡 Project Tagline Democratizing Legal Understanding with Privacy-First AI. Your Lawyer in your pocket.

🏗️ 1. Problem Statement

The Reality: Legal help in India is broken for the average person.

The Solution: We need a way to get instant, accurate, and private legal advice without paying a fortune.

🚀 2. Solution Overview

Vakil.ai is an intelligent legal assistant that reads contracts and explains them in plain English.

✨ Key Value Propositions

Value Description
🔍 Instant Risk Analysis Upload a PDF and get a "Safety Score" (0-100). We highlight risks like Unfair Termination.
🇮🇳 Built for Indian Context Specifically checks against Indian Laws (e.g., Section 27 of the Indian Contract Act).
🔒 Privacy by Design We never store your uploaded contracts. Analyzed in-memory and deleted instantly.
💬 Talk to Your Lawyer A Chat Interface where you can ask specific questions like "Can they fire me?"

🏗️ 3. Architecture & Tech Stack

⚙️ Technical Flow

User Upload → Secure Proxy → FastAPI Backend → RAG Analysis → JSON Result

Architecture Diagram

graph TD
    User((User)) -->|Uploads PDF| Frontend[Next.js Frontend]
    Frontend -->|Secure Request| Backend[FastAPI Backend]

    subgraph "The Brain (Backend)"
        Backend -->|Extract Text| Parser[PDF Parser]
        Parser -->|Raw Text| Chunker[Text Chunker]
        Chunker -->|Vectors| VectorDB[(ChromaDB)]

        VectorDB <-->|Retrieve Context| RAG[RAG Controller]
        RAG <-->|Generate Answer| LLM[Groq Llama 3]
    end

    Backend -->|Store History| Database[(Postgres)]
    LLM -->|JSON Response| Frontend

Tech Stack Breakdown