How yousra-khallou/achatclair works
AchatClair ingests purchase orders, goods receipts, and invoices, routes each document to native or multimodal extraction, normalizes the results, and applies deterministic three-way matching before persisting an auditable result. The Streamlit interface supports review and human validation; benchmark comparison and pipeline metrics provide evaluation and operational visibility. The README documents the major capabilities, while some subsystem links rely on its architecture description or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: pipeline_orchestrator.py Ingestion orchestrator · run_pipeline.py Persistence and reconciliation runner · engine.py Three-way matching engine · extractor.py VLM extractor
Components 26
Ingestion and extraction
- Ingestion orchestrator
scripts/pipeline_orchestrator.py - Document nature detector
scripts/vlm/detector.py - Native text extractor
scripts/LLM/native_extractor.py - VLM extractor
scripts/vlm/extractor.py - PDF rasterizer
scripts/vlm/converter.py - VLM output schemas
scripts/vlm/schemas.py
Domain and matching
- Shared domain types
achatclair/models/common.py - Purchase document models
achatclair/models/document.py - Purchase dossier model
achatclair/models/dossier.py - Reconciliation result models
achatclair/models/reconciliation.py - Three-way matching engine
achatclair/reconciliation/engine.py
Persistence and evaluation
- Persistence and reconciliation runner
scripts/run_pipeline.py - Production database helpers
scripts/db.py - PostgreSQL production and benchmark data
- Ground-truth loader
scripts/load_bench.py - Production benchmark comparison
scripts/compare_bench_prod.py - Extraction evaluation utilities
scripts/LLM/common.py - Extraction evaluation schema
scripts/LLM/schema.py
Review and operations
- Human review interface
ui/app.py - Email notifications
scripts/email_notifications.py - MinIO-triggered pipeline
airflow/dags/achatclair_minio_trigger.py - MinIO event logic
airflow/dags/minio_logic.py - Pipeline metrics store
airflow/dags/metrics_store.py
Other components
- Pipeline operator
- Raw purchase documents
- MinIO object storage
Connections 27
- Pipeline operator → Ingestion orchestrator: runs
scripts/pipeline_orchestrator.py - Raw purchase documents → MinIO object storage: lands in
- MinIO object storage → Ingestion orchestrator: supplies files
- Ingestion orchestrator → Document nature detector: classifies
scripts/pipeline_orchestrator.py - Ingestion orchestrator → Native text extractor: routes text to
scripts/pipeline_orchestrator.py - Ingestion orchestrator → VLM extractor: routes scans to
scripts/pipeline_orchestrator.py - VLM extractor → PDF rasterizer: uses rasterizer
scripts/vlm/extractor.py - VLM extractor → VLM output schemas: uses schemas
scripts/vlm/extractor.py - Ingestion orchestrator → Persistence and reconciliation runner: persists dossier via
scripts/pipeline_orchestrator.py - Ingestion orchestrator → Three-way matching engine: runs matching
scripts/pipeline_orchestrator.py - Persistence and reconciliation runner → Three-way matching engine: invokes
scripts/run_pipeline.py - Persistence and reconciliation runner → Production database helpers: stores records via
scripts/run_pipeline.py - Persistence and reconciliation runner → PostgreSQL production and benchmark data: writes results
- Production database helpers → PostgreSQL production and benchmark data: writes production data
scripts/db.py - Three-way matching engine → Purchase dossier model: evaluates
achatclair/reconciliation/engine.py - Purchase document models → Shared domain types: uses shared types
achatclair/models/document.py - Purchase dossier model → Purchase document models: groups documents
achatclair/models/dossier.py - Purchase dossier model → Reconciliation result models: holds expected results
achatclair/models/dossier.py - Reconciliation result models → Shared domain types: uses rule types
achatclair/models/reconciliation.py - Ground-truth loader → PostgreSQL production and benchmark data: loads ground truth
scripts/load_bench.py - Production benchmark comparison → PostgreSQL production and benchmark data: compares schemas
- Extraction evaluation schema → Extraction evaluation utilities: uses utilities
scripts/LLM/schema.py - Human review interface → PostgreSQL production and benchmark data: reads and updates
- Human review interface → Three-way matching engine: rechecks corrections
ui/app.py - MinIO-triggered pipeline → MinIO event logic: dispatches to
airflow/dags/achatclair_minio_trigger.py - MinIO-triggered pipeline → Pipeline metrics store: records run metrics
airflow/dags/achatclair_minio_trigger.py - Ingestion orchestrator → Email notifications: uses notifications
scripts/pipeline_orchestrator.py