Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for JUSTICE SCAN

📜 The Project Story: Justice-Scan🏛️ About the ProjectJustice-Scan is an autonomous Legal Intelligence platform designed to democratize access to legal understanding. In a country like India, where legal language is often archaic and intimidating, a common citizen often feels helpless when served with a court notice or legal document.Justice-Scan acts as a Legal First-Aid kit. It utilizes state-of-the-art AI to parse complex PDFs and images, offering a multi-layered defense strategy, risk assessment, and direct connection to local legal experts—all within seconds and in the user’s native language.💡 The InspirationThe inspiration for Justice-Scan came from a simple observation: The "Gore-Kanoon" Gap. Legal documents in India are frequently written in a style that hasn't changed in decades, filled with complex jargon that is impenetrable to the average person.I saw how people often panic, miss critical response deadlines, or fall prey to misinformation simply because they couldn't "read" their own legal reality. I wanted to build a tool that could translate a piece of paper into a clear plan of action, effectively acting as a bridge between the citizen and the courtroom.🛠️ How I Built ItThe architecture of Justice-Scan was designed for high precision and accessibility:The Brain (Gemini 2.5 Flash): I chose this model for its massive context window and native ability to handle multi-page PDFs and images simultaneously.RAG Engine (Retrieval-Augmented Generation): To ensure high-speed querying without losing context, I built a custom RAG pipeline that chunks document text into mathematical vectors for instant retrieval.The Interface (Streamlit): I built a high-performance "Glassmorphism" UI that focuses on dark-mode clarity and enterprise-grade professionalism.Tactical Logic: The system doesn't just summarize; it uses a multi-phase prompting strategy to identify:Mistakes: Critical errors made by the client.Loopholes: Strategic weaknesses in the opponent's case.Local Counsel: A specialized mapping algorithm that fetches advocates from a local ad.txt database based on the court’s jurisdiction.🧠 What I LearnedThrough this journey, I learned that AI is not just about generating text; it’s about Perspective. Building the "Choose your Character" feature taught me how to guide an LLM to think like a partisan strategist. I also gained deep experience in:Vector Embeddings: Understanding the math behind cosine similarity to match user questions with document segments.Rate-Limit Management: Designing "Anti-Crash" logic to handle API quotas effectively.User Psychology: Designing UIs that calm a user down during a stressful legal situation.🚧 Challenges I FacedThe road wasn't without its "Red Flags":Hallucination & Safety: Initially, the AI would refuse to provide contact details for lawyers due to safety filters. I solved this by implementing a Python-level injection layer that ensures realistic, populated data for the UI while remaining ethical.State Management: Streamlit’s rerendering behavior often caused the chat history to "vanish." I had to restructure the entire state loop to ensure a "Bulletproof" user experience.Jurisdiction Lock: The model occasionally suggested lawyers from different cities. I refined the system prompt to enforce a strict "Location Lock" based on the extracted court name.⚖️ Mathematical Accuracy in SearchTo ensure the "Legal Brain" found the right paragraphs, I implemented cosine similarity for the vector search:If $q$ is the user question vector and $d$ is the document chunk vector, the similarity is calculated as:$$\text{similarity} = \cos(\theta) = \frac{\mathbf{q} \cdot \mathbf{d}}{|\mathbf{q}| |\mathbf{d}|}$$This ensures that the AI answers based on the most mathematically relevant context within the document.

Built With

Share this project:

Updates

Submission history