How heera0812/drillsarthi works
eRTMAC-NWIS is an offline well-document intelligence system. Users upload scanned drilling reports; the backend rasterizes and extracts page text, well fields, and hazards, then indexes and stores the results for corpus browsing, mapping, risk checks, reports, and cited DrillMind answers. Human corrections are saved and preferred for later use. The graph follows the documented upload and query capabilities; some page-to-endpoint wiring is represented only at the API-client boundary because not every router implementation was excerpted.
Main entry points: App.jsx React application · main.py FastAPI app · client.js HTTP client · unified_parser.py VLM extraction
Components 28
User interface
- React application
ertmac-nwis/src/App.jsx - Upload
ertmac-nwis/src/pages/Upload.jsx - Corpus review
ertmac-nwis/src/pages/Corpus.jsx - Dashboard
ertmac-nwis/src/pages/Dashboard.jsx - Well map
ertmac-nwis/src/pages/MapVisualise.jsx - Risk monitor
ertmac-nwis/src/pages/RiskMonitor.jsx - DrillMind chat
ertmac-nwis/src/pages/DrillMind.jsx - Summary reports
ertmac-nwis/src/pages/SummaryReports.jsx - Well intelligence
ertmac-nwis/src/pages/WellIntelligence.jsx - HTTP client
ertmac-nwis/src/api/client.js
Backend API
- FastAPI app
backend/main.py - Upload endpoint
backend/routers/upload.py - Corpus endpoint
backend/routers/corpus.py - Review endpoint
backend/routers/review.py - Risk endpoint
backend/routers/risk.py - Map endpoint
backend/routers/wells_map.py - Dashboard endpoint
backend/routers/dashboard.py - Chat endpoint
backend/routers/drillmind.py
Document ingestion
- PDF rasterizer
backend/src/pdf_processor.py - VLM extraction
backend/src/unified_parser.py - Figure extraction
backend/src/figure_extractor.py - Table reconstruction
backend/src/table_parser.py
Search and analysis
- Hazard proximity
backend/src/hazard_monitor.py - Grounded RAG
backend/src/rag_engine.py
Persistence
- SQLite corpus
backend/src/database.py - Qdrant vector index
backend/src/vector_store.py
Other components
- User
- Local Ollama model
Connections 44
- User → React application: uses
README.md - React application → Upload: routes to
ertmac-nwis/src/App.jsx - React application → Corpus review: routes to
ertmac-nwis/src/App.jsx - React application → Dashboard: routes to
ertmac-nwis/src/App.jsx - React application → Well map: routes to
ertmac-nwis/src/App.jsx - React application → Risk monitor: routes to
ertmac-nwis/src/App.jsx - React application → DrillMind chat: routes to
ertmac-nwis/src/App.jsx - React application → Summary reports: routes to
ertmac-nwis/src/App.jsx - React application → Well intelligence: routes to
ertmac-nwis/src/App.jsx - Upload → HTTP client: sends requests
ertmac-nwis/src/pages/Upload.jsx - Corpus review → HTTP client: sends requests
ertmac-nwis/src/pages/Corpus.jsx - Dashboard → HTTP client: sends requests
ertmac-nwis/src/pages/Dashboard.jsx - Well map → HTTP client: sends requests
ertmac-nwis/src/pages/MapVisualise.jsx - Risk monitor → HTTP client: sends requests
ertmac-nwis/src/pages/RiskMonitor.jsx - DrillMind chat → HTTP client: sends requests
ertmac-nwis/src/pages/DrillMind.jsx - Summary reports → HTTP client: sends requests
ertmac-nwis/src/pages/SummaryReports.jsx - Well intelligence → HTTP client: sends requests
ertmac-nwis/src/pages/WellIntelligence.jsx - HTTP client → FastAPI app: HTTP requests
- FastAPI app → Upload endpoint: mounts
backend/main.py - FastAPI app → Corpus endpoint: mounts
backend/main.py - FastAPI app → Review endpoint: mounts
backend/main.py - FastAPI app → Risk endpoint: mounts
backend/main.py - FastAPI app → Map endpoint: mounts
backend/main.py - FastAPI app → Dashboard endpoint: mounts
backend/main.py - FastAPI app → Chat endpoint: mounts
backend/main.py - Upload endpoint → PDF rasterizer: rasterizes PDF
backend/routers/upload.py - Upload endpoint → VLM extraction: starts extraction
backend/routers/upload.py - PDF rasterizer → VLM extraction: provides page images
README.md - VLM extraction → Local Ollama model: requests extraction
README.md - VLM extraction → Figure extraction: extracts figures
backend/src/unified_parser.py - VLM extraction → Table reconstruction: reconstructs tables
backend/src/unified_parser.py - VLM extraction → SQLite corpus: stores extracted records
backend/src/unified_parser.py - VLM extraction → Qdrant vector index: indexes page text
backend/src/unified_parser.py - Review endpoint → SQLite corpus: reads and saves corrections
backend/routers/review.py - Review endpoint → Table reconstruction: renders tables
backend/routers/review.py - Corpus endpoint → SQLite corpus: reads corpus
backend/routers/corpus.py - Dashboard endpoint → SQLite corpus: reads totals
backend/routers/dashboard.py - Map endpoint → SQLite corpus: reads wells
backend/routers/wells_map.py - Risk endpoint → Hazard proximity: checks proximity
backend/routers/risk.py - Hazard proximity → SQLite corpus: reads hazards
- Chat endpoint → Grounded RAG: asks question
backend/routers/drillmind.py - Grounded RAG → Qdrant vector index: retrieves passages
backend/src/rag_engine.py - Grounded RAG → SQLite corpus: looks up well names
backend/src/rag_engine.py - Grounded RAG → Local Ollama model: generates grounded answer
backend/src/rag_engine.py