Skip to content

ADVAITRD1296/HOF_PROJECT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 Live Demo: https://lexisco.vercel.app/

This project is a full-stack web application built with a modern frontend and a FastAPI backend. It provides a seamless user experience with efficient API handling, authentication, and real-time interactions.

βš–οΈ LexisCo β€” AI Legal Guide

"An AI legal assistant that not only explains the law, but guides users step-by-step to take real legal action β€” making justice accessible to everyone."

MIT License Python FastAPI AI/ML Track


πŸš€ About LexisCo

LexisCo is an AI-powered Legal Guidance Assistant for India that doesn't just answer legal questions β€” it walks users step-by-step to solve their legal problems, just like a smart mentor.

Unlike normal chatbots, our system focuses on "what to do next", not just "what the law says".


πŸ’‘ How It Works

A user explains their problem in simple language (Hindi/English), and the system:

  1. Understands the situation using NLP
  2. Finds the exact relevant law (IPC/BNS/Consumer Act/RTI, etc.) using RAG
  3. Breaks it down into simple, actionable steps
  4. Guides the user till actual action (complaint/FIR/next step)

πŸ”₯ Key Features

Feature Description
🧭 Step-by-Step Guidance Mentor-style, structured legal steps β€” not walls of text
πŸ“„ Complaint/FIR Generator Auto-generate FIR drafts, consumer complaints, legal notices
πŸ“š Verified Law + Citations Exact section references (IPC/BNS) with explanations
🌐 Hindi + English Support Bilingual interface for wider accessibility
🎀 Voice Input Speak your problem β€” helpful for non-technical users
⚠️ Anti-Hallucination RAG-grounded answers only, with clear disclaimers
πŸ€– Smart Suggestions Interactive follow-up actions after every answer

πŸ—οΈ Project Structure

LexisCo/
β”œβ”€β”€ frontend/           # HTML/CSS/JS frontend
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ js/
β”‚   └── assets/
β”œβ”€β”€ backend/            # FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   └── services/
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── .env.example
β”œβ”€β”€ rag_engine/         # RAG pipeline (embeddings, vector DB)
β”‚   β”œβ”€β”€ ingestion/
β”‚   β”œβ”€β”€ retrieval/
β”‚   └── data/
β”œβ”€β”€ data/               # Legal documents and datasets
β”‚   β”œβ”€β”€ raw/
β”‚   └── processed/
β”œβ”€β”€ notebooks/          # Research and experimentation
β”œβ”€β”€ docs/               # Documentation
└── docker-compose.yml

πŸ€– Tech Stack

Frontend

  • HTML5 / CSS3 / Vanilla JS
  • Responsive, bilingual UI

Backend

  • FastAPI (Python)
  • LangChain for RAG orchestration
  • Groq API (LLaMA 3) as LLM
  • FAISS / Pinecone as Vector DB
  • Sentence Transformers for embeddings

AI/ML Pipeline

  • RAG (Retrieval-Augmented Generation)
  • Legal document chunking & embedding
  • Prompt engineering for structured outputs
  • Guardrails to prevent hallucinations

⚑ Quick Start

Prerequisites

  • Python 3.10+
  • Node.js (optional, for dev server)
  • Groq API key

Backend Setup

cd backend
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys
uvicorn app.main:app --reload

Frontend

Open frontend/index.html in your browser, or serve with:

cd frontend
python -m http.server 3000

πŸ“‹ Environment Variables

GROQ_API_KEY=your_groq_api_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
VECTOR_DB=faiss  # or pinecone

πŸš€ Extended Backend Features (New)

1. Shareable Case Card

  • Endpoint: POST /api/case-card/generate
  • Purpose: Generates a structured JSON "case card" from a legal summary, including applicable laws and action steps. Provides a unique shareable_link.
  • Retrieval: GET /api/case-card/{card_id} (Publicly accessible).

2. Deadline Calculator

  • Endpoint: POST /api/deadline/calculate
  • Purpose: Calculates Indian law limitation periods for common case types (Consumer, FIR, Civil, RTI, NI Act, Labour).
  • Output: Returns filing_deadline, days_remaining, and a warning_status (Safe, Urgent, Critical, Expired).

3. Case Strength Analyzer

  • Endpoint: POST /api/case-strength/analyze
  • Purpose: Uses LLM + RAG to evaluate the strength of a case based on legal merit, evidence, documentation, and witnesses.
  • Output: Detailed scoring and improvement recommendations.

4. Journey Tracker

  • Endpoints: POST /api/journey/create, POST /api/journey/{id}/update, GET /api/journey/{id}
  • Purpose: Manages a user's legal lifecycle with predefined milestones for Consumer Complaints, FIRs, and RTIs.

🎯 Hackathon β€” AI/ML Track

Why LexisCo stands out:

  • βœ… Not just Q&A β†’ Action-oriented AI
  • βœ… High real-world impact (India-scale problem)
  • βœ… Combines Legal Domain + ML + UX thinking
  • βœ… Mentor-style guidance (unique twist)
  • βœ… RAG pipeline with anti-hallucination guardrails

⚠️ Disclaimer

LexisCo provides AI-generated legal guidance, not legal advice. Always consult a qualified lawyer for important legal matters.


πŸ“„ License

MIT License β€” see LICENSE for details.

About

This repository is created for the Hackofiesta Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors