How akshattp/nyayamitra_sih works
NyayaMitra AI is a legal-research and judicial-triage copilot with citation verification, alongside government compliance dashboards and a law-firm portal. The main workflow takes a case into the workspace, sends research requests through the API, retrieves and reranks legal material, verifies citations, and presents grounded results; reports can be exported. The tree and README document broader ingestion, governance, and firm-management capabilities. Some backend route-to-agent wiring is not shown in the sampled excerpts, so uncertain links are omitted.
Main entry points: main.py FastAPI application · retriever.py RAG retrieval · law_firm_service.py Firm management · orchestrator.py Legal ingestion
Components 28
Client application
- Angular app
angular-frontend/src/main.ts - Route access
angular-frontend/src/app/app.routes.ts - User authentication
angular-frontend/src/app/core/auth/auth.service.ts - Case workspace
angular-frontend/src/app/features/case-workspace/case-workspace.component.ts - API client
angular-frontend/src/app/core/services/api.service.ts
Backend API
- FastAPI application
backend/app/main.py - Case endpoints
backend/app/api/cases.py - Research endpoints
backend/app/api/research.py - Citation endpoints
backend/app/api/citations.py - Copilot endpoints
backend/app/api/copilot.py - Report endpoints
backend/app/api/reports.py
Legal research
- Research agents
backend/app/agents - Research planner
backend/app/agents/research_planner.py
Knowledge and verification
- RAG retrieval
backend/app/rag/retriever.py - Result reranker
backend/app/rag/reranker.py - FAISS index
backend/app/rag/faiss_store.py - NyayaGuard
backend/app/verification/nyayaguard.py - Legal ingestion
backend/app/ingestion/orchestrator.py - Legal-source connectors
backend/app/ingestion/connectors
Operations portals
- Government dashboards
backend/app/api/gov_routes.py - Compliance service
backend/app/services/compliance_service.py - Law-firm endpoints
backend/app/api/law_firm_routes.py - Firm management
backend/app/services/law_firm_service.py - Firebase services
backend/app/services/firebase_service.py
Other components
- Legal user
- External legal sources
- Firestore
- Research brief
Connections 26
- Legal user → Angular app: uses
- Angular app → Route access: navigates
- Route access → User authentication: guards
- Legal user → Case workspace: submits case
- Case workspace → API client: requests research
- API client → FastAPI application: sends API requests
- FastAPI application → Case endpoints: dispatches
- FastAPI application → Research endpoints: dispatches
- FastAPI application → Citation endpoints: dispatches
- FastAPI application → Copilot endpoints: dispatches
- FastAPI application → Report endpoints: dispatches
- Research endpoints → Research planner: plans research
- Research planner → RAG retrieval: queries precedents
- RAG retrieval → FAISS index: searches index
- RAG retrieval → Result reranker: ranks candidates
- Research agents → NyayaGuard: checks citations
- Citation endpoints → NyayaGuard: verifies citations
- Legal ingestion → Legal-source connectors: dispatches ingestion
- Legal-source connectors → External legal sources: fetches legal material
- Legal ingestion → FAISS index: updates index
- Government dashboards → Compliance service: reads compliance data
- Compliance service → External legal sources: refreshes from
- Law-firm endpoints → Firm management: manages firm data
- Firm management → Firestore: reads and writes
- Firm management → Firebase services: creates accounts
- Report endpoints → Research brief: exports report