For Engineers: Implementation Details & Stack
Implementation favors boring reliable pieces with clear ownership. Event intake, typed schemas, and reversible writers beat clever monoliths that only the author can run. Python services handle scoring and orchestration because experiment loops are short and packaging is familiar to most staff hires. FastAPI endpoints expose inventory anomaly queries under authenticated scopes. Workers pull jobs from queues when register bursts would otherwise distort online latency.
Feature computation uses versioned transformations logged with the model that read them. We store raw and curated layers separately so audits can replay a decision. For document-heavy receiving, extraction pipelines mirror the structure we used on medical summarization agents: field schemas, confidence gates, and human queues for low scores. EHR-focused NLP taught us not to trust free text without validation. Retail packing slips get the same skepticism and unit tests.
Model choices stay pragmatic. Gradient boosting covers sparse SKU histories; sequence models appear only when basket order truly predicts attach rates. OpenAI-compatible interfaces appear where natural language reasons help managers, but structured outputs and citation of source rows stay mandatory. Local embedding caches cut repeat spend and keep private catalogs off public indexes. Deterministic rules always wrap machine scores on price and controlled substances categories if present.
Edge cases dominate retail production. Partial deliveries, catch-weight items, kit SKUs, and dual UPC mapping break naive unique keys. We encode those cases as first-class fixtures in test suites. Overnight jobs repair residual drift without clobbering same-day human corrections. Idempotent writers stop double-count nightmares after network blips at remote sites.
Observability hooks emit structured logs with store_id, skuid, model_version, and decision_id. Traces link a shelf alert to the exact feature snapshot. Metrics track precision@k on exception lists, time-to-acknowledge, and auto-action reverse rates. Alerting pages humans on sensor silence, not just threshold noise. Engineers debug with real fixtures scrubbed of PII instead of inventing toy carts.
Local development uses container compose stacks that fake POS webhooks. Seed data includes Shenandoah seasonal pattern samples so epoch choices are not urban-default. CI runs migration lint, contract tests, and sample inference latency budgets below registering floors shoppers feel. Pull requests require model metric deltas and a retail-language summary for ops review.