Manual script to backfill AI analysis for all existing reports.
How to run
bash
cd lafaekstreet_backend
python -m manual_run.backfill_ai_analysisWhat it does (per report)
- Downloads image from S3
- Runs AI damage detection via Bedrock Nova
- Saves AI analysis log + updates image record + updates report title
- Submits AI validation to Hedera blockchain
- Generates multimodal embedding
Safety features
DRY_RUN = Trueby default — first run will only list reports that need processing, no changes made- Set
DRY_RUN = Falsewhen you're ready to actually process - Configurable delay between reports (
DELAY_SECONDS = 1.0) to avoid rate limits SKIP_HEDERAandSKIP_EMBEDDINGSflags if you want to skip thoseBATCH_LIMIT = 100to control how many reports per run- START/FINISHED logs per report with full details
- Summary at the end showing success/fail/skip counts
