How bhavikadlecha/enterprise-invoice-extractor works
This is an invoice-processing product for Accounts Payable: users upload PDF/image invoices, receive schema-validated extraction, and get semantic purchase-order matching for review. The Streamlit UI drives a FastAPI service; that service also supports ZIP batch jobs, PO creation, and operational metrics. Vision preprocessing, LLM extraction with validation retries, PO retrieval, and SQLite tracking form the internal processing layers. Some API-to-worker orchestration details are omitted from the excerpts, so those links are marked unverified rather than inferred as direct calls.
Main entry points: main.py FastAPI API · extractor.py Invoice Extractor · processor.py Batch Processor · streamlit_app.py Streamlit UI
Components 15
User Experience
- Streamlit UI
frontend/streamlit_app.py
Invoice Service
- FastAPI API
app/main.py - File Preparation
app/vision.py - Invoice Extractor
app/extractor.py - Invoice Validation
app/schemas.py - Batch Processor
app/batch/processor.py - Batch Job State
app/batch/processor.py
PO Matching
- PO Matcher
app/rag/matcher.py - PO Vector Store
app/rag/po_store.py - PO Catalog
app/main.py
Operations
- Metrics Tracker
app/observability/tracker.py - Metrics SQLite
app/observability/tracker.py - Runtime Settings
app/config.py
Other components
- Accountant
- Vision LLM
Connections 21
- Accountant → Streamlit UI: uploads invoice
README.md - Streamlit UI → FastAPI API: submits and polls
frontend/streamlit_app.py - FastAPI API → File Preparation: prepares upload
app/main.py - File Preparation → Invoice Extractor: encodes image
app/batch/processor.py - FastAPI API → Invoice Extractor: requests extraction
README.md - Invoice Extractor → Invoice Validation: validates output
app/extractor.py - Invoice Extractor → Vision LLM: extracts fields
README.md - Invoice Extractor → Metrics Tracker: records usage
app/extractor.py - FastAPI API → PO Matcher: requests PO match
README.md - PO Matcher → PO Vector Store: searches candidates
app/rag/matcher.py - FastAPI API → PO Catalog: adds purchase order
app/main.py - PO Catalog → PO Vector Store: stores PO
app/main.py - FastAPI API → Batch Processor: starts batch job
app/main.py - Batch Processor → File Preparation: converts files
app/batch/processor.py - Batch Processor → Invoice Extractor: extracts invoices
app/batch/processor.py - Batch Processor → PO Matcher: matches invoices
app/batch/processor.py - Batch Processor → Batch Job State: updates job state
app/batch/processor.py - FastAPI API → Batch Job State: reads job status
app/main.py - FastAPI API → Metrics Tracker: requests summaries
app/main.py - Streamlit UI → FastAPI API: loads metrics
frontend/streamlit_app.py - Metrics Tracker → Metrics SQLite: reads and writes
app/observability/tracker.py