How pallavi-a11y/ertmac-nwis works
eRTMAC-NWIS turns uploaded scanned drilling reports into a searchable, structured corpus, then exposes dashboard, review, map, risk and grounded-chat workflows. The documented ingestion stages run from PDF rasterization through two-pass VLM extraction, figure detection, table reconstruction and persistence. README evidence supports the broad pipeline and capabilities; sampled source confirms the DrillMind route/retrieval flow and correction persistence, but several router and parser implementations were not sampled, so their internal wiring is shown only where documented.
Main entry points: client.js HTTP client · App.jsx Web app · database.py Structured corpus · unified_parser.py VLM extraction
Components 25
User interface
- Web app
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 - HTTP client
ertmac-nwis/src/api/client.js
API workflows
- Upload API
backend/routers/upload.py - Corpus API
backend/routers/corpus.py - Review API
backend/routers/review.py - Dashboard API
backend/routers/dashboard.py - Wells API
backend/routers/wells_map.py - Risk API
backend/routers/risk.py - Chat API
backend/routers/drillmind.py
Ingestion pipeline
- PDF rasterizer
backend/src/pdf_processor.py - VLM extraction
backend/src/unified_parser.py - Figure detector
backend/src/figure_extractor.py - Table reconstruction
backend/src/table_parser.py
Search and risk
- Grounded chat
backend/src/rag_engine.py - Hazard proximity
backend/src/hazard_monitor.py
Corpus storage
- Vector index
backend/src/vector_store.py - Structured corpus
backend/src/database.py
Other components
- Engineer
- Local Ollama
Connections 37
- Engineer → Web app: uses
- Web app → Upload: routes to
- Web app → Corpus review: routes to
- Web app → Dashboard: routes to
- Web app → Well map: routes to
- Web app → Risk monitor: routes to
- Web app → DrillMind chat: routes to
- Upload → HTTP client: submits PDF
- Corpus review → HTTP client: requests records
- Dashboard → HTTP client: requests summary
- Well map → HTTP client: requests wells
- Risk monitor → HTTP client: checks risk
- DrillMind chat → HTTP client: sends question
- HTTP client → Upload API: HTTP requests
- HTTP client → Corpus API: HTTP requests
- HTTP client → Dashboard API: HTTP requests
- HTTP client → Wells API: HTTP requests
- HTTP client → Risk API: HTTP requests
- HTTP client → Chat API: HTTP requests
- Upload API → PDF rasterizer: starts ingestion
- PDF rasterizer → VLM extraction: provides page images
- VLM extraction → Local Ollama: requests extraction
- VLM extraction → Figure detector: detects figures
- VLM extraction → Structured corpus: stores extracted data
- VLM extraction → Vector index: indexes page text
- Corpus API → Structured corpus: reads corpus
- Review API → Structured corpus: reads and saves corrections
- Review API → Table reconstruction: formats page tables
- Dashboard API → Structured corpus: reads totals
- Wells API → Structured corpus: reads well locations
- Risk API → Hazard proximity: checks proximity
- Hazard proximity → Structured corpus: queries hazards
- Chat API → Grounded chat: asks question
- Grounded chat → Vector index: retrieves passages
- Grounded chat → Structured corpus: looks up well names
- Grounded chat → Local Ollama: generates grounded answer
- DrillMind chat → Corpus API: loads file choices