How gauravmatolia/regulatorydocintelligence works
Analysts select guideline and company PDFs, upload them through the web app, initialize indexing, then ask questions and receive cited answers; citation links can open source PDFs. The API coordinates ingestion and RAG setup, while retrieval searches separate guideline and company indexes, reranks results, and supplies context to the answer model. The README also describes version-change detection, but the provided tree and excerpts do not identify its implementation, so it is shown as an unverified capability. Relationships reflect shown calls or documented capabilities; unsampled internals are not inferred.
Main entry points: api.py FastAPI endpoints · vectorstore.py Index management · App.js App coordinator · chain.py RAG chain
Components 17
Web interface
- App coordinator
frontend/src/App.js - PDF selection
frontend/src/components/UploadSection.js - Chat and PDF preview
frontend/src/components/ChatSection.js
API and sessions
- FastAPI endpoints
backend/api.py - Uploaded PDF files
backend/api.py
Document indexing
- PDF parsing and chunking
backend/ingestion.py - Index management
backend/vectorstore.py - Guideline vector index
backend/vectorstore.py - Company vector index
backend/vectorstore.py
Retrieval and answers
- Context retrieval
backend/retriever.py - Document reranking
backend/reranker.py - RAG chain
backend/chain.py - Answer prompt
backend/prompt.py
Other components
- Analyst
- Ollama embeddings
- Gemini model
- Version change detection
Connections 20
- Analyst → App coordinator: uses
frontend/src/App.js - App coordinator → PDF selection: renders
frontend/src/App.js - App coordinator → Chat and PDF preview: renders
frontend/src/App.js - App coordinator → FastAPI endpoints: uploads and queries
frontend/src/App.js - App coordinator → FastAPI endpoints: starts or clears chat
frontend/src/App.js - Chat and PDF preview → FastAPI endpoints: loads cited PDF
frontend/src/components/ChatSection.js - FastAPI endpoints → Uploaded PDF files: writes and serves
backend/api.py - FastAPI endpoints → Index management: initializes indexes
backend/api.py - Index management → PDF parsing and chunking: parses and chunks
backend/vectorstore.py - Index management → Guideline vector index: writes and loads
backend/vectorstore.py - Index management → Company vector index: writes and loads
backend/vectorstore.py - Index management → Ollama embeddings: embeds documents
backend/vectorstore.py - FastAPI endpoints → Context retrieval: creates retrieval chain
backend/api.py - FastAPI endpoints → RAG chain: creates answer chain
backend/api.py - Context retrieval → Index management: gets retrievers
backend/retriever.py - Context retrieval → Document reranking: reranks candidates
backend/retriever.py - RAG chain → Context retrieval: uses context chain
backend/chain.py - RAG chain → Answer prompt: formats context
backend/chain.py - RAG chain → Gemini model: generates answer
backend/chain.py - Analyst → Version change detection: uses capability
README.md