Skip to content

Manual script to backfill AI analysis for all existing reports.

How to run

bash
cd lafaekstreet_backend
python -m manual_run.backfill_ai_analysis

What 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 = True by default — first run will only list reports that need processing, no changes made
  • Set DRY_RUN = False when you're ready to actually process
  • Configurable delay between reports (DELAY_SECONDS = 1.0) to avoid rate limits
  • SKIP_HEDERA and SKIP_EMBEDDINGS flags if you want to skip those
  • BATCH_LIMIT = 100 to control how many reports per run
  • START/FINISHED logs per report with full details
  • Summary at the end showing success/fail/skip counts

Built for Timor-Leste