How vaibhav2824/veridoc works
VeriDoc accepts invoice and bank-statement documents through a web UI, API, or MCP tools; classifies and extracts fields; verifies invoice values with confidence and page locations; and abstains uncertain fields for human review. The API also stores jobs and review state and can use past invoices as retrieval exemplars. The graph follows documented workflow and visible imports/calls; unsampled subsystems are included where the README documents them, with evidence limits reflected in the edges.
Main entry points: extractor.py Invoice and statement extraction · main.py FastAPI endpoints · graph.py Pipeline orchestration · router.py Document router
Components 20
User interfaces
- Web UI
web/app - Web API client
web/lib/api.ts - MCP tools
services/mcp/server.py
Document workflow
- FastAPI endpoints
services/api/main.py - Document ingestion
services/api/ingest.py - Pipeline orchestration
services/api/graph.py - Document router
services/api/nodes/router.py - Document type schema
services/api/models/router.py - Human review queue
services/api/models/review_queue.py
Extraction and trust
- Invoice and statement extraction
services/api/extractor.py - Invoice schema
services/api/models/invoice.py - Statement schema
services/api/models/bank_statement.py - Field verification
services/api/nodes/verifier.py - Confidence gate
services/api/nodes/gate.py - Verified results
services/api/models/verified_invoice.py
State and retrieval
- Jobs and audit store
services/api/db.py - Invoice exemplars
services/api/rag/retrieval.py
Models and tools
- Vision-language clients
services/api/clients - Gemini or Groq
Other components
- Document user
Connections 24
- Document user → Web UI: uploads document
README.md - Web UI → Web API client: uses API
README.md - Web API client → FastAPI endpoints: calls endpoints
README.md - FastAPI endpoints → Pipeline orchestration: runs pipeline
services/api/main.py - FastAPI endpoints → Jobs and audit store: stores job state
services/api/main.py - FastAPI endpoints → Human review queue: serves and resolves
services/api/main.py - Pipeline orchestration → Document ingestion: loads pages
services/api/graph.py - Pipeline orchestration → Document router: classifies document
README.md - Document router → Document type schema: returns classification
services/api/nodes/router.py - Document router → Vision-language clients: uses fallback
services/api/nodes/router.py - Pipeline orchestration → Invoice and statement extraction: dispatches extraction
README.md - Invoice and statement extraction → Vision-language clients: requests structured fields
services/api/extractor.py - Invoice and statement extraction → Invoice schema: extracts invoice
services/api/extractor.py - Invoice and statement extraction → Statement schema: extracts statement
services/api/extractor.py - Invoice and statement extraction → Field verification: verifies invoice fields
services/api/extractor.py - Invoice and statement extraction → Confidence gate: applies threshold
services/api/extractor.py - Confidence gate → Verified results: produces confidence results
README.md - FastAPI endpoints → Human review queue: queues uncertain fields
README.md - Invoice and statement extraction → Invoice exemplars: retrieves exemplars
services/api/extractor.py - Invoice and statement extraction → Invoice exemplars: stores confident examples
services/api/extractor.py - Invoice exemplars → Jobs and audit store: uses pgvector store
README.md - MCP tools → Pipeline orchestration: runs document pipeline
services/mcp/server.py - MCP tools → Invoice and statement extraction: runs direct extraction
services/mcp/server.py - Vision-language clients → Gemini or Groq: calls provider
README.md