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.
- 🔍 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
| 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 |
git clone <your-repo>
cd LexAI
pip install -r requirements.txtcp .env.example .env
# Edit .env and add your GROQ_API_KEY
# Get a free key at https://console.groq.compython create_embeddings.pystreamlit run app.pyLexAI/
├── 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)
| Variable | Description |
|---|---|
GROQ_API_KEY |
Your Groq API key (required) |
Model and retrieval settings can be adjusted in lexai.py:
model_name— switch Groq modeltemperature— controls response creativity (0.0–1.0)search_kwargs["k"]— number of context chunks retrieved
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.