Project 001 · Pharmacy retail · Document AI

Distributor bills into checked stock,from a photo.

A photo of a distributor's bill in. Every line filled in and checked out, in about 14 seconds, then batch-wise stock and expiry alerts. The model reads; Python does the maths.

99.5%of held-out line values read right
11 / 12files with a printed wrong amount flagged
0false money warnings on 8 clean bill files
$0.03per bill, 14 seconds median

v1 · held-out · 6 synthetic bills, 20 files (PDF, scan, phone photo, Excel) · not yet tested on real phone photos

Demo · 1:44

The challenge

A small chemist gets 10–30 distributor bills a day and must record every purchase batch by batch: which batch, when it expires, how many were free, what rate was charged, and whether the amount matches.

Someone types it all in, 5–10 minutes a bill. Mistakes surface weeks later: stock that doesn't match the shelf, a ₹9 overcharge nobody noticed, a batch that expired before it could be returned.

A phone-first app for small chemists, from the bill photo to batch-wise stock and alerts. Nothing is saved until a person has checked it.

How it works

  1. 01

    Read

    Photo, PDF, Excel or CSV; several photos for one bill.

    A small model fills a fixed schema; a stronger one reads again only when the money is off.

    OpenAI · Python · FastAPI
  2. 02

    Check

    Every line: quantity × rate − discount must equal the amount.

    Lines add up to the total; rate above MRP, short expiry and bad GSTIN are flagged.

    Python
  3. 03

    Review

    Wrong cells turn red next to the zoomable photo.

    Each line matched to a known medicine; duplicates and price jumps flagged.

    React · Node · Express
  4. 04

    Stock

    Quantity plus free goes to the batch; sales take the earliest expiry first.

    Alerts: low stock, expiring in 90 days, expired.

    MongoDB · Node

How a request flows

Animated flow diagram of MedBill

Architecture

Screens

Home: today at a glance
Home: today at a glance
Review: a wrong amount turns red
Review: a wrong amount turns red
Stock, batch by batch
Stock, batch by batch
Expiry and low-stock alerts
Expiry and low-stock alerts

What I learned

  1. The model quietly fixes the distributor's mistakes. The stronger model "corrected" a planted overcharge, hiding the error the shopkeeper needs to see. The prompt now says to copy the amount even if it looks wrong.
  2. Photos fail in small, specific ways. Most misses were the narrow Free and Disc% columns swapped, and & in batch codes read as 8. So the review screen shows the photo beside the table, and the checks point at the exact cell.
  3. Still open: a real printing error sends the bill to the stronger model, so it costs 3–5× more. Next: scoring 20 real phone photos of real bills.

Stack

ReactNodeExpressPythonFastAPIMongoDBOpenAICaddyDocker