Build 6-agent Kirana Detective invoice auditor with YOLO26n + MiniCPM fine-tuning
Session from kirana-detective-build-traces on Hugging Face by build-small-hackathon · MIT · condensed by Coders Talk
Build an AI invoice auditing pipeline for Indian kirana stores (Kirana Detective AI, HuggingFace hackathon), including fine-tuning YOLO26n for shelf detection and MiniCPM-V/MiniCPM5 for invoice OCR and product normalization, then implement the full 6-agent pipeline with a custom Gradio UI.
- +0Prompt · +0Research YOLO26n datasets for grocery detection per tasks.md, and how to generate synthetic data to fine-tune MiniCPM-V 4.6.
- +0mAgent did · +0mResearched datasets, checked project structure/.env/PRD, and assessed the 10-day plan's robustness given only 5 days left before the deadline.
- Break · 1h 59m away, not counted
- +3mAgent did · +3mScaffolded project directories, requirements.txt, README, .gitignore, and wrote three fine-tune scripts (train_yolo26n.py, generate_invoices.py, train_minicpm_v.py, train_minicpm5_1b.py).
- +17mAgent did · +17mBuilt build_catalog.py to generate a 200-SKU FMCG catalog with HSN codes and GST rates, fixing two errors (SKU count assertion, unicode print) before it ran cleanly.
- +27mPrompt · +27mCheck GST rates are current, and fix this WeasyPrint import error I hit on Windows after running generate_invoices.py.
- +29mAgent did · +29mFixed Tata Salt's GST rate (5% to 0%) and rewrote generate_invoices.py to use pure Pillow instead of WeasyPrint (which needed native libs unavailable on Windows), then generated all 500 synthetic invoice images.
- +57mPrompt · +57mModal YOLO training job failed with a libGL.so.1 import error from opencv via ultralytics.
- +57mAgent did · +57mAdded apt_install for libgl1-mesa-glx/libglib2.0-0 to the Modal image to fix the OpenGL dependency, then built storage.py (SQLite with degraded mode) and tracer.py, fixing a Windows file-lock test failure along the way.
- +1h 6mAgent did · +1h 6mImplemented all 6 pipeline agents (invoice extractor, product matcher, pricing, visual counter, reconciliation, savings) plus the orchestrating pipeline.py, fixing a missing dataclass field bug during smoke tests.
- +1h 30mPrompt · +1h 30mProceed, but research the latest Gradio UI features first and use them properly since it's a hackathon requirement.
- +1h 30mAgent did · +1h 30mResearched Gradio 6.x features, built app.py using gr.Server with SSE streaming and a custom static/index.html frontend, then marked completed tasks with [x] in tasks.md at the developer's request.
- +1h 46mOutcome · +1h 46mAll 17 core implementation tasks marked done in tasks.md; only Modal training runs (0.1-0.3) and final README/verify_models.py remain before hackathon submission.
Next time I'd flag the Windows-specific gotchas (WeasyPrint's native deps, SQLite file locks, libGL missing on Modal's slim image) up front in the first prompt since they cost real cycles to debug reactively. The correction that did the most work was asking it to verify plan robustness and check current GST rates before generating data — catching the wrong Tata Salt rate before I baked it into 500 synthetic invoices.