How mohanreddy-11/legalresearch2 works
LegalResearch2 is a Streamlit assistant for researching Indian law. A user submits a question; the app invokes the RAG workflow, which retrieves relevant indexed passages, looks up related cases, builds a grounded prompt, and streams a model response with source and case references back to the interface. The graph separates retrieval, case metadata, and response generation. The repository includes law PDFs and an existing FAISS index, but the README and sampled source do not establish how the PDFs were used to build that index.
Main entry points: rag.py RAG workflow · app.py Chat interface · case_lookup.py Case matching · config.py Runtime settings
Components 10
User interface
- Chat interface
app.py
Legal retrieval
- RAG workflow
rag.py - Runtime settings
config.py - FAISS index
vectorstore/index.faiss - Text embeddings
rag.py
Case metadata
- Case matching
case_lookup.py - Legal metadata
data/metadata
Answer generation
- Legal prompt
prompts.py - NVIDIA model API
Other components
- Legal researcher
Connections 11
- Legal researcher → Chat interface: asks question
app.py - Chat interface → RAG workflow: submits question
app.py - Chat interface → Runtime settings: reads model name
app.py - RAG workflow → Chat interface: returns answer and sources
app.py - RAG workflow → Runtime settings: reads settings
rag.py - RAG workflow → Text embeddings: creates embeddings
rag.py - RAG workflow → FAISS index: loads and queries
rag.py - RAG workflow → Case matching: matches cases and laws
rag.py - Case matching → Legal metadata: reads CSV metadata
case_lookup.py - RAG workflow → Legal prompt: formats prompt
rag.py - RAG workflow → NVIDIA model API: streams completion
rag.py