How shirleydhaka/multimodal-rag-provenance works
This repository implements a multimodal PDF claim-verification tool. A user supplies a PDF, query, and answer; the parser extracts text, tables, and image regions with page coordinates, then the RAG pipeline retrieves evidence, checks answer claims, and returns a provenance report for formatting. The code also provides an interactive provenance-graph and bounding-box viewer. The main workflow is evidenced by the excerpts; the viewer is a separate capability, and no connection from the PDF runner to it is shown.
Main entry points: main.py RAG orchestrator · run_real_pdf.py PDF runner · schema.py Evidence and report models · parser.py PDF parser
Components 12
PDF ingestion
- PDF runner
run_real_pdf.py - PDF parser
parser.py
Claim verification
- RAG orchestrator
main.py - Claim decomposer
engine.py - Graph retriever
engine.py - Stance verifier
engine.py
Provenance outputs
- Audit formatter
report_formatter.py - Interactive provenance viewer
visualizer.py - Verification report
Domain models
- Evidence and report models
schema.py
Other components
- User
- PDF document
Connections 16
- User → PDF runner: submits query
README.md - PDF document → PDF runner: provides file
README.md - PDF runner → PDF parser: parses PDF
run_real_pdf.py - PDF parser → Evidence and report models: creates evidence
parser.py - PDF runner → RAG orchestrator: ingests evidence
run_real_pdf.py - PDF runner → RAG orchestrator: requests verification
run_real_pdf.py - RAG orchestrator → Claim decomposer: decomposes claims
main.py - RAG orchestrator → Graph retriever: retrieves evidence
main.py - RAG orchestrator → Stance verifier: evaluates claims
main.py - Graph retriever → Evidence and report models: uses evidence nodes
engine.py - Stance verifier → Evidence and report models: returns verification
engine.py - RAG orchestrator → Evidence and report models: builds report
main.py - RAG orchestrator → Verification report: produces
main.py - PDF runner → Audit formatter: formats report
run_real_pdf.py - Verification report → Audit formatter: supplies data
- Verification report → Interactive provenance viewer: renders graph
visualizer.py