How sukumar5705/lexgraph works
This is a project skeleton for Indian legal-precedent research using authority- and temporal-aware GraphRAG. The intended user workflow is search in the React interface, backend search routing, retrieval and reranking, then grounded answer generation with citation/conflict checks; graph and case exploration are additional capabilities. The README also describes ingestion and evaluation branches. Many modules are TODOs or unsampled, so only documented flows and source-index-supported calls are connected; evaluation is represented as a capability, not a runtime stage.
Main entry points: rag_pipeline.py RAG orchestration · hybrid_retriever.py Hybrid retrieval · main.py FastAPI application · routes_search.py Search routes
Components 28
User interface
- Search interface
frontend/src/pages/Home.jsx - API client
frontend/src/services/api.js - Case explorer
frontend/src/pages/CaseExplorer.jsx - Knowledge graph view
frontend/src/components/KnowledgeGraph.jsx
Backend API
- FastAPI application
backend/main.py - Search routes
backend/api/routes_search.py - Graph routes
backend/api/routes_graph.py - Case routes
backend/api/routes_cases.py
RAG pipeline
- RAG orchestration
backend/core/rag_pipeline.py - Cross-encoder reranking
retrieval/reranking/cross_encoder.py - Authority ranking
retrieval/reranking/authority_ranker.py - Temporal validation
backend/core/temporal_validator.py - Conflict detection
backend/core/conflict_detector.py - Citation verification
backend/core/citation_verifier.py - Grounded answer generation
backend/core/llm_service.py
Ingestion and retrieval
- Hybrid retrieval
retrieval/hybrid/hybrid_retriever.py - BM25 retrieval
retrieval/bm25/bm25_retriever.py - Embedding model
retrieval/vector/embedding_model.py - Vector store
retrieval/vector/vector_store.py - Citation graph retrieval
knowledge_graph/graph_retriever.py - Legal document ingestion
ingestion/extraction - Case preprocessing
ingestion/preprocessing - Legal chunking
ingestion/chunking - Citation graph building
ingestion/graph
Evaluation
- Retrieval baselines
evaluation/baselines - Research metrics
evaluation/metrics - Experiments
evaluation/experiments
Other components
- Legal researcher
Connections 27
- Legal researcher → Search interface: searches
README.md - Search interface → API client: submits query
- API client → Search routes: requests search
- FastAPI application → Search routes: registers
backend/main.py - FastAPI application → Graph routes: registers
backend/main.py - FastAPI application → Case routes: registers
backend/main.py - Search routes → RAG orchestration: runs pipeline
backend/api/routes_search.py - RAG orchestration → Hybrid retrieval: retrieves candidates
backend/core/rag_pipeline.py - Hybrid retrieval → Embedding model: embeds query
retrieval/hybrid/hybrid_retriever.py - Hybrid retrieval → Vector store: queries vectors
retrieval/hybrid/hybrid_retriever.py - Hybrid retrieval → BM25 retrieval: queries keywords
retrieval/hybrid/hybrid_retriever.py - RAG orchestration → Cross-encoder reranking: reranks candidates
backend/core/rag_pipeline.py - RAG orchestration → Authority ranking: scores authority
backend/core/rag_pipeline.py - Authority ranking → Citation graph retrieval: reads case relations
retrieval/reranking/authority_ranker.py - RAG orchestration → Temporal validation: validates dates
backend/core/rag_pipeline.py - RAG orchestration → Conflict detection: checks conflicts
backend/core/rag_pipeline.py - RAG orchestration → Citation verification: verifies citations
backend/core/rag_pipeline.py - RAG orchestration → Grounded answer generation: generates answer
backend/core/rag_pipeline.py - Graph routes → Knowledge graph view: serves graph data
- Legal researcher → Case explorer: explores cases
README.md - Case explorer → Case routes: requests case details
- Legal document ingestion → Case preprocessing: processes documents
README.md - Case preprocessing → Legal chunking: prepares case text
README.md - Legal chunking → Citation graph building: supports graph building
- Citation graph building → Citation graph retrieval: builds graph for retrieval
- Retrieval baselines → Experiments: compared in
- Experiments → Research metrics: evaluated with