How greeshmakurivella29/nyayaroute works
NyayaRoute is a Streamlit workspace for evidence-constrained Indian legal research. A user asks a question; the research engine assesses and rewrites it when needed, routes retrieval, reranks evidence, checks sufficiency, then answers with citations or returns a no-answer outcome. The workspace also supports source filtering, source-library URL ingestion, PDF ingestion, audit details, authority cards, and Markdown memo export. The graph combines README-documented stages with relationships visible in excerpts and the source index; unsampled implementation details are not inferred.
Main entry points: rag_engine.py Research orchestration · pdf_ingestor.py PDF ingestion · app.py Research UI · vector_store.py Vector store
Components 24
Research workspace
- Research UI
app.py - Memo export
app.py - Audit and authority cards
app.py
Research pipeline
- Research orchestration
rag_engine.py - Query quality
rag_engine.py - Rewrite and routing
rag_engine.py - BM25, vector, hybrid
rag_engine.py - Indian Kanoon search
live_web_searcher.py - Cross-encoder reranking
rag_engine.py - Evidence decision
rag_engine.py - Grounded answer
rag_engine.py
Source ingestion
- Source library
app.py - Trusted URL ingestion
trusted_sources.py - PDF ingestion
pdf_ingestor.py - PDF parsing
pdf_parser.py - Legal chunking
chunker.py - Document metadata
metadata.py
Search index
- Legal corpus
data - Vector store
vector_store.py - Text embeddings
embedding.py - FAISS index
faiss_store.py - Index metadata
metadata_store.py
Other components
- Researcher
- Groq model service
Connections 27
- Researcher → Research UI: asks question
README.md - Research UI → Research orchestration: submits query
README.md - Research orchestration → Query quality: checks quality
README.md - Research orchestration → Rewrite and routing: rewrites and routes
README.md - Research orchestration → BM25, vector, hybrid: retrieves candidates
README.md - BM25, vector, hybrid → Indian Kanoon search: searches live
rag_engine.py - BM25, vector, hybrid → Vector store: searches vectors
vector_store.py - Research orchestration → Cross-encoder reranking: reranks candidates
README.md - Research orchestration → Evidence decision: checks evidence
README.md - Research orchestration → Grounded answer: generates answer
README.md - Grounded answer → Groq model service: requests completion
rag_engine.py - Research orchestration → Research UI: returns outcome
README.md - Research UI → Audit and authority cards: displays evidence audit
README.md - Research UI → Memo export: exports memo
README.md - Researcher → Source library: adds trusted source
README.md - Source library → Trusted URL ingestion: ingests URL
app.py - Trusted URL ingestion → Legal corpus: appends chunks
trusted_sources.py - Researcher → PDF ingestion: uploads PDF
- PDF ingestion → PDF parsing: parses document
pdf_ingestor.py - PDF ingestion → Legal chunking: chunks text
pdf_ingestor.py - PDF ingestion → Document metadata: classifies chunks
pdf_ingestor.py - PDF ingestion → Legal corpus: appends records
pdf_ingestor.py - PDF ingestion → Vector store: adds records
pdf_ingestor.py - Legal corpus → Research orchestration: loads corpus
README.md - Vector store → Text embeddings: embeds records
vector_store.py - Vector store → FAISS index: stores vectors
vector_store.py - Vector store → Index metadata: stores record metadata
vector_store.py