Work

AI-Assisted Inventory Write-Off Bot for a Hospitality Business

Automation
AI
Telegram Bot
API Integration
Python

A Telegram bot that lets kitchen staff log stock taken from inventory in plain language; a Claude LLM parses each message and the chef posts draft write-off documents into the venue's POS/accounting system — replacing slow, error-prone manual data entry.

Chef preparing food in a professional restaurant kitchen

Challenge

A café in Estonia recorded kitchen stock consumption by hand, then re-entered it into its commercial POS/accounting system — slow, error-prone work that also required matching colloquial product names to formal catalogue entries in another language. Because write-offs change real inventory balances, correctness and operational safety were non-negotiable.

Solution

  • Chat-first interface: a Telegram bot (python-telegram-bot, long-polling) where staff type “shift, product, quantity”; chefs get privileged commands for review and posting.
  • LLM parsing: Claude interprets each free-form message against a live product catalogue, extracting shift, product, quantity and unit — with a human-in-the-loop confirmation step (inline ✅ / ❌ / ✏️ buttons) guarding every entry.
  • Resilient POS integration: integrated the venue’s commercial POS/accounting system over its partner API (OAuth2 client-credentials); the catalogue is loaded per product group to surface warehouse items hidden by a storefront visibility filter. Documents are created as drafts only — never auto-posted (a deliberate safety decision).
  • Alias layer with a single source of truth: colloquial names map to catalogue items; the source of truth lives in the POS product card, synced to a local cache every 15 minutes, with write-through on edits and self-learning from staff corrections.
  • Unit-of-measure safety: validates the spoken unit against each item’s storage unit, converts (e.g. 500 g → 0.5 kg) and sums compound quantities (“1 kg 200 g” → 1.2 kg) to prevent mis-scaled write-offs.
  • Disambiguation UX: ambiguous terms surface inline buttons to pick the exact product card.
  • Engineering rigour: 14 Architecture Decision Records; deployed on a single Linux VPS via systemd with daily database backups.

Result

Running in production and used daily by kitchen staff: manual catalogue entry was replaced by chat-driven logging with chef confirmation. A group-based catalogue-loading fix increased API-visible items from ~76 to ~370. Quantitative impact (time saved, daily message volume) is being measured.