How ankitchoudhary3002/packguard-ai works
PackGuard AI is a first-pass packaging compliance review tool. Its main workflow takes uploaded artwork and product details, extracts or lets the user review label text, routes supplied rules by jurisdiction, retrieves relevant candidates, evaluates product and rule checks, and presents a traceable decision and JSON report. The graph preserves separate extraction, retrieval, and validation stages. Some validation and vector-index internals are unsampled; their roles and selected links are included only where the README or shown orchestration supports them.
Main entry points: ui.py Streamlit workflow · orchestrator.py Compliance workflow · artwork.py Artwork data · reporting.py Report builder
Components 20
Review experience
- Streamlit workflow
src/packguard/ui.py - Report builder
src/packguard/reporting.py - Decision and JSON report
Artwork extraction
- PDF extraction
src/packguard/extraction/pdf.py - Image OCR
src/packguard/extraction/image.py - Label field detection
src/packguard/extraction/fields.py - Artwork data
src/packguard/models/artwork.py
Rule sourcing
- Rulebook ingestion
src/packguard/rules/loader.py - Regulatory rules
src/packguard/rules/rules.py - Jurisdiction routing
src/packguard/rules/router.py - Local vector index
src/packguard/rules/vector_index.py - Rule retrieval
src/packguard/rules/retriever.py
Compliance evaluation
- Product specification
src/packguard/models/product.py - Compliance workflow
src/packguard/agents/orchestrator.py - Product checks
src/packguard/validation/compliance.py - Structured and semantic evaluation
src/packguard/validation - Finding records
src/packguard/models/findings.py
Other components
- Reviewer
- Artwork input
- Rulebook input
Connections 25
- Reviewer → Streamlit workflow: submits review
README.md - Artwork input → Streamlit workflow: uploads artwork
src/packguard/ui.py - Streamlit workflow → PDF extraction: extracts PDF
src/packguard/ui.py - Streamlit workflow → Image OCR: extracts image
src/packguard/ui.py - Streamlit workflow → Label field detection: detects fields
src/packguard/ui.py - Label field detection → Streamlit workflow: autofills form
src/packguard/ui.py - PDF extraction → Artwork data: creates artwork data
src/packguard/extraction/pdf.py - Image OCR → Artwork data: creates artwork data
src/packguard/extraction/image.py - Streamlit workflow → Artwork data: builds reviewed input
src/packguard/ui.py - Streamlit workflow → Product specification: builds product input
src/packguard/ui.py - Rulebook input → Streamlit workflow: uploads rulebook
README.md - Streamlit workflow → Rulebook ingestion: ingests PDF rules
src/packguard/ui.py - Rulebook ingestion → Regulatory rules: loads rule records
src/packguard/rules/loader.py - Streamlit workflow → Compliance workflow: runs workflow
src/packguard/ui.py - Compliance workflow → Jurisdiction routing: routes sources
src/packguard/agents/orchestrator.py - Compliance workflow → Local vector index: builds and searches
src/packguard/agents/orchestrator.py - Compliance workflow → Rule retrieval: falls back to retrieval
src/packguard/agents/orchestrator.py - Jurisdiction routing → Regulatory rules: selects rules
src/packguard/rules/router.py - Compliance workflow → Product checks: validates product
src/packguard/agents/orchestrator.py - Compliance workflow → Structured and semantic evaluation: evaluates candidates
src/packguard/agents/orchestrator.py - Product checks → Finding records: produces findings
- Structured and semantic evaluation → Finding records: produces findings
- Compliance workflow → Report builder: passes results
src/packguard/reporting.py - Report builder → Decision and JSON report: serializes report
src/packguard/reporting.py - Streamlit workflow → Decision and JSON report: displays and downloads
src/packguard/ui.py