Open source · Independent project
SmartStock RPA — Agentic AI for Inventory & Purchasing
Eight AI agents forecast demand, set reorder points, rank suppliers and flag anomalies every morning — then route each decision through an audited approval and purchase-order workflow so a person stays in control.
The problem
Small and mid-sized businesses reorder stock from spreadsheets and gut feel. That causes stock-outs on fast movers, expired stock on slow ones, and purchase orders nobody can explain or audit afterwards.
What I built
- Eight scheduled agents: demand forecasting, reorder point and quantity, supplier ranking, anomaly detection and more, each explaining its decision.
- A purchasing workflow from request to approval, purchase order, supplier, goods receipt and three-way invoice match.
- 162 FastAPI endpoints over 49 PostgreSQL tables, with Celery jobs, OCR for supplier invoices and a React + TypeScript dashboard.
- Full audit trail and single-use, expiring one-click approval links.
My engineering contribution
- Designed and built the whole system: data model, agents, workflow engine, API and frontend.
- Wrote 178 backend tests (about 90% coverage of the core) and Playwright end-to-end tests; CI runs on every push.
- Back-tested the agents on 90 days of data before trusting them with decisions.
Architecture and workflow
Sales, stock levels, suppliers and lead times live in PostgreSQL.
Technical decisions
- Agents recommend, people approve: no purchase order is created without a recorded human decision.
- Every agent explains its output so a rejected recommendation is still useful.
- Back-test first: agents were measured against history before being switched on.
Outcomes
- In a 90-day back-test on the project's data: forecast MAPE fell from 40.3% to 35.2%, stock-outs fell 74% and expired stock fell 92%.
- 178 backend tests and end-to-end tests passing in CI.