AI agent that monitors inventory levels and triggers alerts when stock falls below reorder threshold.
import requests, json
API_INV = "https://api.example.com/v2/inventory/stock"
def fetch_stock():
resp = requests.get(API_INV)
return resp.json().get("items", [])
def check_alerts(items):
alerts = []
for item in items:
shortfall = item["threshold"] - item["level"]
if shortfall > 0:
severity = "critical" if item["level"] == 0 else "warning"
qty = max(shortfall * 2, 10)
alerts.append({
"sku": item["sku"],
"severity": severity,
"suggested_order": qty
})
return sorted(alerts, key=lambda x: x["suggested_order"], reverse=True)
alerts = check_alerts(fetch_stock())
print(json.dumps(alerts, indent=2))
Basic Package
Special SME traction programme by AINNA.
Limited starter website offer. AI usage, hosting, maintenance and custom integrations depend on the confirmed scope.
View SME Offer β
Ask about AINNA pages, services and articles.
AINNA website sources only Β· answers up to 5 lines
No section data available yet.
Sites with documented sections will appear here.
We value your privacy
We use browser storage to remember your choice. Optional analytics runs only after you allow it; your choice is recorded with an anonymous ID. Privacy Policy