DEV Community

Cover image for Day 25 of 60: I Built an AI Warehouse Stock Reconciliation System for Manufacturing Facilities
Cess Mbugua
Cess Mbugua

Posted on

Day 25 of 60: I Built an AI Warehouse Stock Reconciliation System for Manufacturing Facilities

Live demo: https://lnkd.in/e3mvH4JZ

Every day, warehouses at large manufacturing facilities
lose millions in stock, and nobody knows where it went.

Not because of large thefts.
Because of 1-2 crates per shift, ignored as "acceptable loss."

Here is how it happens:

A clerk counts stock at the start of their shift.
Records it on a paper form.
Records every sale manually during the shift.
Counts again at the end.
Hands over to the next clerk.

If the figures are off by 1-2 crates, it gets ignored.
"It is within acceptable range."

But multiply that by 3 shifts, 5 warehouses, 30 days,
and you have millions in untracked losses every month.

And when the monthly reconciliation comes?
It takes 2 full days of a manager's time to trace back
through paper books, and by then, the trail is cold.

I built StockSentry to fix this.

Here is how it works:

  1. Clerk opens shift digitally, records opening stock

  2. Every sale order recorded with:
    Order number and delivery number
    Client name and truck number
    Checker and forklift operator names
    Ordered vs dispatched quantity
    Any variance flagged immediately

  3. Interwarehouse movements tracked both ways:
    Sending warehouse records quantity sent
    Receiving warehouse confirms quantity received
    Any transit variance flagged instantly

  4. Clerk closes shift with closing stock count
    System calculates automatically:
    Opening + Movements In - Sales - Movements Out = Expected Closing
    Expected vs Actual = Variance
    Even 1 unit triggers a flag

  5. Human in the loop, always:
    Claude writes a plain language shift summary
    Supervisor receives Slack notification instantly
    Security notified if variance detected
    Supervisor reviews and signs off digitally
    No shift approved without human confirmation

  6. Monthly report, one click:
    What previously took 2 full days
    Now generates in under 1 second

Real test results:

Dark Stout 300ml
Opening: 200 | Sold: 30 | Expected: 170 | Actual: 168 | Variance: -2
Flagged immediately. Supervisor notified. Investigated.

Alpha Lager 500ml
Opening: 500 | Sold: 48 | Expected: 452 | Actual: 448 | Variance: -4
Flagged immediately. Escalated to security.

Previously? Those losses would have been ignored.
Across 30 days, that is 180 units gone with no record.

The system does not replace the warehouse team.
It gives them the visibility they never had before.
Every loss is seen. Every person in the chain is accountable.
And the monthly reconciliation that used to ruin two days?
Done in seconds.

Built with FastAPI, Claude AI, PostgreSQL, SQLAlchemy,
and Slack API.

GitHub: github.com/mbuguacessy-glitch/StockSentry

AIAutomation #WarehouseManagement #Manufacturing

FastAPI #Python #ClaudeAI #AfricanTech

BuildingInPublic #Nairobi

Top comments (0)