π 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.
"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."
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".
A user explains their problem in simple language (Hindi/English), and the system:
- Understands the situation using NLP
- Finds the exact relevant law (IPC/BNS/Consumer Act/RTI, etc.) using RAG
- Breaks it down into simple, actionable steps
- Guides the user till actual action (complaint/FIR/next step)
| 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 |
| RAG-grounded answers only, with clear disclaimers | |
| π€ Smart Suggestions | Interactive follow-up actions after every answer |
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
- HTML5 / CSS3 / Vanilla JS
- Responsive, bilingual UI
- FastAPI (Python)
- LangChain for RAG orchestration
- Groq API (LLaMA 3) as LLM
- FAISS / Pinecone as Vector DB
- Sentence Transformers for embeddings
- RAG (Retrieval-Augmented Generation)
- Legal document chunking & embedding
- Prompt engineering for structured outputs
- Guardrails to prevent hallucinations
- Python 3.10+
- Node.js (optional, for dev server)
- Groq API key
cd backend
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys
uvicorn app.main:app --reloadOpen frontend/index.html in your browser, or serve with:
cd frontend
python -m http.server 3000GROQ_API_KEY=your_groq_api_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
VECTOR_DB=faiss # or pinecone- 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).
- 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 awarning_status(Safe, Urgent, Critical, Expired).
- 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.
- 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.
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
LexisCo provides AI-generated legal guidance, not legal advice. Always consult a qualified lawyer for important legal matters.
MIT License β see LICENSE for details.