Delectable AI — Executive Summary

Addressing Your Grocer's Core Questions

Technical Evidence

Five Questions.
Evidence-Based Answers.

Your Grocer has raised five important questions about the Delectable AI platform. This document provides concrete, code-referenced answers backed by the production system architecture.

27+ ML Models
11 Ranking Stages
8 Food Databases
70K+ Enriched SKUs
14× Cost Advantage
1

"This looks hardcoded — it's just search."

The concern is that Delectable AI is simply wrapping keyword search with a chatbot UI, with manually curated rules rather than genuine intelligence.

Delectable AI is an 11-Stage Adaptive Ranking Pipeline

Every product result passes through a composable, configurable pipeline where each stage applies a different model or algorithm. The pipeline is not static — it adapts per-user, per-session, and per-query.

Production Code agents/grocery/ranking/pipeline.py
Stage 1
Relevance Filter
Semantic matching + stemming
Stage 2
Dietary Hard Filter
Allergen safety enforcement
Stage 3
Dietary Enrichment
BQ attribute hydration
Stage 4
Freshness Rerank
Inventory age scoring
Stage 5
History Boost
Propensity-weighted repurchase
Stage 6
Session Diversity
Anti-monotony enforcement
Stage 7
Purchase Injection
Frequent-buy injection
Stage 8
Purchase Matching
SKU + brand affinity
Stage 9
Dietary Annotation
Badge + warning labels
Stage 10
Health Propensity
Nutrient-weighted scoring
Stage 11
Sponsored Placement
RMN injection points
Why this isn't "just search":

Same query, different results for every shopper. The pipeline personalizes based on propensity scores, purchase history, brand affinity, dietary restrictions, and health consciousness — all learned from behavioral data, not configured per-user.

5 configurable pipeline presets (SEARCH, CART, POST_SEARCH, ALTERNATIVES, RERANK) — each with different active stages for different contexts.

Per-stage enable/disable via environment variables — enabling A/B testing at the stage level, not just on/off.

Each stage emits observability: items_in, items_out, duration_ms, applied flag, metadata — enabling data-driven pipeline tuning.

What's Dynamic (Learned)

Propensity scoring — per-user weights derived from 12 months of purchase history. Score formula: S = S_base + λ_sodium·N + λ_sugar·N − λ_protein·N
K-Means mission clustering — 6 shopping archetypes discovered from 202M events across 27.9K users (BQML)
Bayesian pantry decay — per-household consumption rates updated with category priors: posterior = (n·household_rate + k·category_rate) / (n+k)
768-dim embeddings — Vertex AI text-embedding-005 for semantic product/ingredient matching
PMI flavor affinity — ingredient co-occurrence scores from 2.1M recipe corpus
Household personas — K=8 COSINE-distance clustering on 9 behavioral features with confidence scoring

What's Deterministic (By Design)

Unit conversions — 60+ exact conversion factors (tsp→tbsp, oz→cups). Rules are correct, not approximate — ML would introduce errors here.
Allergen hard-filtering — safety-critical. A probabilistic approach is unacceptable for nut allergy enforcement.
ILP cost optimization — OR-Tools SCIP solver finds provably optimal package combinations. An LLM would guess.
Ingredient stemming — "roma tomato" → "tomato" with 300+ aliases. False-friend detection prevents "coconut milk" from matching "milk".
Deterministic ≠ hardcoded. These are engineered algorithms chosen because they're more reliable than ML for these specific tasks. The system deliberately uses the right tool for each job.