Skip to content

Pachushetty/Legal-Advisor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚖️ NyayaMitr AI - Indian Legal AI Assistant

NyayaMitr AI is an AI-powered chatbot that answers questions about Indian law in plain, accessible language. It uses RAG (Retrieval-Augmented Generation) to ground answers in authoritative legal documents.


✨ Features

  • 🔍 RAG-powered answers grounded in actual Indian legal texts
  • 💬 Conversational memory — follows multi-turn dialogue
  • 🧠 LLaMA 3.3 70B via Groq for fast, high-quality responses
  • 🎨 Clean teal/emerald UI with dark theme
  • Singleton pattern — model loads once per session

📚 Knowledge Base

Document Coverage
Constitution of India Fundamental Rights, DPSPs, Amendments
Indian Penal Code (IPC) Criminal offences and penalties
Indian Evidence Act Rules of evidence in courts
Indian Contract Act, 1872 Contracts, agreements, remedies

🚀 Quick Start

1. Clone & install

git clone <your-repo>
cd LexAI
pip install -r requirements.txt

2. Set up environment

cp .env.example .env
# Edit .env and add your GROQ_API_KEY
# Get a free key at https://console.groq.com

3. Build knowledge base (first time only)

python create_embeddings.py

4. Run the app

streamlit run app.py

🗂️ Project Structure

LexAI/
├── app.py                  # Streamlit UI
├── lexai.py                # Core RAG logic
├── create_embeddings.py    # One-time embedding script
├── requirements.txt
├── .env.example
├── .gitignore
├── data/                   # PDF legal documents
│   ├── Constitution of India.pdf
│   ├── Indian Penal Code (IPC).pdf
│   ├── Indian Evidence Act.pdf
│   └── Indian Contract Act, 1872.pdf
└── legal_vector_store/     # ChromaDB vector store (auto-generated)

⚙️ Configuration

Variable Description
GROQ_API_KEY Your Groq API key (required)

Model and retrieval settings can be adjusted in lexai.py:

  • model_name — switch Groq model
  • temperature — controls response creativity (0.0–1.0)
  • search_kwargs["k"] — number of context chunks retrieved

⚠️ Disclaimer

NyayaMitr AI provides general legal information only. It is not a substitute for professional legal advice. Always consult a qualified lawyer for matters specific to your situation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages